Menu

ublas::prod and viennacl::prod report incorrect results when 'typedef ScalarType long(or)int;' in examples/tutorial/blas3.cu

Sanjay
2017-08-18
2017-08-18
  • Sanjay

    Sanjay - 2017-08-18

    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
  • Karl Rupp

    Karl Rupp - 2017-08-19

    Hi Sanjay,
    let me have a look at this - will take 2-3 days.
    Best regards,
    Karli

     
  • Sanjay

    Sanjay - 2017-08-21

    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

     

Log in to post a comment.