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
Amin
always finds index 0
#359
Comments
I've created a branch on my fork where I add the sample above, if you want to reproduce the issue: https://github.com/Nyrio/CLBlast/tree/issue-359 |
I managed to reproduce, thanks. This is one of the few routines that isn't tested because it is not part of the regular BLAS interface. It seems adding |
Yes it's an extension. It can be tested against a custom implementation though, e.g: template<typename scalar_t>
inline int iamin(const int N, const scalar_t *X, const int incX)
{
int best = 0;
for(int i = incX; i < N * incX; i += incX) {
if(std::abs(X[i]) < std::abs(X[best])) {
best = i;
}
}
return best / incX;
} |
Fixed, thanks! |
I know, thanks for the snippet. The issue is that the CLBlast test framework doesn't easily accomodate these kind of tests (integer result and also non BLAS), thus there is a bit of boilerplate work. I though since this was only about 2 lines of different kernel code from another routine it should be safe but it turned out one of those 2 lines was wrong... I'll add a test when I have more time. |
I noticed that
Amin
was always finding the index 0, so I wrote this sample code to check that it is indeed the case:Amax
displays 4 as expected, butAmin
displays 0 instead of 3. Whatever the content of the vector, it always says 0.The text was updated successfully, but these errors were encountered: