Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces of gemm, gemv, etc are not robust #65

Open
shiozaki opened this issue Jul 29, 2014 · 4 comments
Open

interfaces of gemm, gemv, etc are not robust #65

shiozaki opened this issue Jul 29, 2014 · 4 comments
Labels

Comments

@shiozaki
Copy link
Contributor

double gemm with alpha = 1.0 and beta = 2 would not be accepted.

Also types are handled in a very error-prone way because everything is passed around using const reference.

I made a hack to make sure that BAGEL is no slower than direct Lapack call (4f83749), but this should be a tentative fix. Without these fix, sometimes BAGEL was calling generic function!!

@shiozaki
Copy link
Contributor Author

Related to #32

@shiozaki shiozaki added the bug label Jul 29, 2014
@naokin
Copy link
Contributor

naokin commented Jul 30, 2014

The changes looks OK, but I was wondering why the following (lines 118-120
in axpy_impl.h) doesn't work?

typedef typename __traits_X::value_type __value_X;
typedef typename std::conditional<std::is_convertible<_T,
__value_X>::value, __value_X, _T>::type __alpha;
axpy_impl<std::is_convertible<_T, __value_X>::value>::call(Nsize,
static_cast<__alpha>(alpha), itrX, incX, itrY, incY);

I think it might be better if we can fixed that bug at this point.

Naoki

On Wed, Jul 30, 2014 at 4:22 AM, Toru Shiozaki [email protected]
wrote:

Related to #32 #32


Reply to this email directly or view it on GitHub
#65 (comment).

@shiozaki
Copy link
Contributor Author

For efficiency btas/optimize/contract.h directly calls _impl functions (or I could just call CBLAS directly but that's redundant).

On a separate note, there should be a mechanism to detect this sort of bug, in which unoptimized code is used in cases that could be processed by the standard BLAS. This was a critical bug!

@shiozaki
Copy link
Contributor Author

I think to close this bug, we need to have an interface in which we do not assume alpha and beta are the same type (but convertible to value_type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants