CUBLAS library: find max of actual values rather than absolute values

StackOverflow https://stackoverflow.com/questions/15381956

  •  23-03-2022
  •  | 
  •  

سؤال

The CUBLAS library of NVIDIA CUDA allows finding the element/index with maximum absolute value (cublasIsamax). Is it possible to find the element/index with the maximum actual value somehow, using the CUBLAS reduction functions?

[I am using CUBLAS version 3.2.]

Edit
Constraint: I cannot alter the state of the production server in any way. This means that I cannot use thrust/cudpp, and that I'm stuck with using an older version of CUBLAS.

هل كانت مفيدة؟

المحلول

I am not sure what "reduction functions" you are referring to.

CUBLAS is basically just a "like-for-like" implementation of BLAS for CUDA devices. It only provides the standard Level 1, 2 and 3 BLAS functions, plus exactly three extensions - geam (scaled matrix addition/transposition), dgmm (diagonalised matrix-matrix dot product) and getrfBatched (batched LU factorisation for many small matrices). None of those functions will find the signed maximum value of a supplied vector or matrix.

NVIDIA ship cudpp and thrust, either of which are probably better for this sort operation. Also, CUBLAS 3.2 is two and a half years old.

As a final comment, I would strong recommend using either the CUBLAS 4.x or CUBLAS 5.x releases. The API and performance of the code has improved considerably, especially for newer hardware.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top