cblas_dgemm - 仅如果(测试版)是功率的二 [英] cblas_dgemm - works ONLY if (beta) is power-of-two

查看:676
本文介绍了cblas_dgemm - 仅如果(测试版)是功率的二的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全难住了。我用C语言编写一个相当大的递归程序调用cblas_dgemm()。其结果是由正常工作程序独立验证。

I am totally stumped. I have a fairly large recursive program written in c that calls cblas_dgemm(). The result is verified independently by a program that works correctly.

C = alpha*A*B + beta*C 

在使用随机矩阵和参数的所有可能的组合,程序给出正确答案反复测试只有当ABS(测试版)= 2 ^ N(1,2,4,8 ......)。任何值适用于阿尔法。任何其他正/负,奇/偶的β值给出了正确答案B的时间/ w的10-30%。

On repeated tests using random matrices and all possible combination of parameters the program gives correct answer ONLY if abs(beta) = 2^n (1,2,4,8..). Any value works for alpha. Any other positive/negative, odd/even value for beta gives correct answer b/w 10-30% of the time.

我使用Ubuntu 10.04,GCC 4.4.x到,我已经试过系统安装BLAS / cblas /图册以及手工编制地图集。

I am using Ubuntu 10.04, GCC 4.4.x, I have tried system installed blas/cblas/atlas as well as manually compiled atlas.

任何提示或建议将不胜AP preciated。我很惊讶的奇妙大方(聪明)人潜伏在这个网站。

Any hints or suggestions would be greatly appreciated. I am amazed at the wonderfully generous (and smart) folks lurking at this site.

感谢你的所有提前,

拉​​斯

推荐答案

两个完全不相干的错误密谋产生虚幻的画面。它让我找错了地方的问题。

Two completely unrelated errors conspired to produce an illusive picture. It made me look for problems in the wrong place.

(1)有一个在函数调用DGEMM的逻辑一简单的错误。本来如果我不追错误的问题得到容易固定。

(1) There was a simple error in the logic of the function calling dgemm. Would have been easily fixed if I was not chasing the wrong problem.

(2)我的双比较功能:AlmostEqual2sComplement(双版)(http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm)使用不正确大小的整数 - 导致下真不正确某些罕见的情况。这是第一次错误咬我!

(2) My double-compare function: double version of AlmostEqual2sComplement() (http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm) used incorrect sized integer - resulting in an incorrect TRUE under certain rare circumstances. This was the first time the error bit me!

使用尝试调试程序时,科学方法的有益建议,再次感谢。

Thanks again for the useful suggestion of using the scientific method when trying to debug a program.

拉​​斯

这篇关于cblas_dgemm - 仅如果(测试版)是功率的二的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆