I'm looking at using viennacl for integer matrices, especially for matrix multiplication. I've been using the 1.7.1 release.
Changing the ScalarType to int or long in examples/tutorials/blas3.cu results in both ublas::prod and viennacl::prod to compute the wrong answer.
Surprisingly, the random number generator used to initialise the matrices generates numbers between 0 and 1, is static_cast to an int or long. This fills the matrices with zeros. I'm perplexed as to what's causing ublas's and viennacl's to report non-zero values in the result.
This has been happening for A=28x16384 B=16384x28 and A=1024x1024 B=1024x1024 (after making the changes included in myPatch.diff, with minimal changes to blas3.cu)
viennacl::linalg::cuda::prod does work for int and long. I had to change the iteration bounds of the GPU-CPU result check to iterate over ublas_C, instead of ublas_A.
-Sanjay
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm looking at using viennacl for integer matrices, especially for matrix multiplication. I've been using the 1.7.1 release.
Changing the ScalarType to int or long in examples/tutorials/blas3.cu results in both ublas::prod and viennacl::prod to compute the wrong answer.
Surprisingly, the random number generator used to initialise the matrices generates numbers between 0 and 1, is static_cast to an int or long. This fills the matrices with zeros. I'm perplexed as to what's causing ublas's and viennacl's to report non-zero values in the result.
This has been happening for A=28x16384 B=16384x28 and A=1024x1024 B=1024x1024 (after making the changes included in myPatch.diff, with minimal changes to blas3.cu)
Any thoughts on why this is the case ?
Thanks,
Sanjay
Last edit: Sanjay 2017-08-18
Hi Sanjay,
let me have a look at this - will take 2-3 days.
Best regards,
Karli
Hello Karl,
viennacl::linalg::cuda::prod does work for int and long. I had to change the iteration bounds of the GPU-CPU result check to iterate over ublas_C, instead of ublas_A.
-Sanjay
Thanks, Sanjay, I used your suggestions to improve the blas3 example:
https://github.com/viennacl/viennacl-dev/commit/d38dcb39519ae49bf5398ec4906e5f5ee9e4c8cb