当前位置:网站首页>11. cuBLAS Development Guide Chinese version--Level-1 functions amax() and amin() in cuBLAS

11. cuBLAS Development Guide Chinese version--Level-1 functions amax() and amin() in cuBLAS

2022-08-09 14:18:00 Little He Shang who sweeps the floor

2.5. cuBLAS Level-1 Function Reference

在本章中,We describe performing scalar and vector-based operations Level-1 基本线性代数子程序 (BLAS1) 函数. We will use abbreviations <type> 表示类型,使用 <t> Represents the corresponding short type,To express the implemented functionality more concisely and clearly. 除非另有说明,<type><t> 的含义如下:

在这里插入图片描述

<type><t>Meaning
float‘s’ or ‘S’real single-precision
double‘d’ or ‘D’real double-precision
cuComplex‘c’ or ‘C’complex single-precision
cuDoubleComplex‘z’ or ‘Z’complex double-precision

When the parameters and return value of the function are different,Sometimes complex input occurs,<t>It can also have the following meanings“Sc”、“Cs”、“Dz”和“Zd”.

缩写 Re(.) 和 Im(.) will represent the real and imaginary parts of the number, respectively. Since the imaginary part of a real number does not exist,We treat it as zero,It can usually be simply dropped from the equations that use it. 此外,α ̄ 将表示 α的复共轭.

一般来说,在整个文档中,Lowercase Greek symbolsα 和 β will represent a scalar,Lowercase English letters in bold x 和 y,will represent vectors and uppercase English lettersA, B和C,and will represent a matrix.

2.5.1. cublasI<t>amax()

This function finds the largest element(最小)索引. 因此,| I m ( x [ j ] ) | + | R e ( x [ j ] ) | The result is the first for i = 1 , … , n 和 j = 1 + ( i - 1 ) * incx 最大的结果. 请注意,The last equation reflects for AND Fortran 兼容的基于 1 的索引.

Param.MemoryIn/outMeaning
handleinputhandle to the cuBLAS library context.
ninputnumber of elements in the vector x.
xdeviceinput<type> vector with elements.
incxinputstride between consecutive elements of x.
resulthost or deviceoutputthe resulting index, which is 0 if n,incx<=0

Error values ​​that this function may return and their meanings are listed below.

Error ValueMeaning
CUBLAS_STATUS_SUCCESS操作成功完成
CUBLAS_STATUS_NOT_INITIALIZED库未初始化
CUBLAS_STATUS_ALLOC_FAILEDUnable to allocate shrink buffer
CUBLAS_STATUS_EXECUTION_FAILEDThis function is not available GPU 上启动

请参考:

isamax, idamax, icamax, izamax

2.5.2. cublasI<t>amin()

cublasStatus_t cublasIsamin(cublasHandle_t handle, int n,
                            const float *x, int incx, int *result)
cublasStatus_t cublasIdamin(cublasHandle_t handle, int n,
                            const double *x, int incx, int *result)
cublasStatus_t cublasIcamin(cublasHandle_t handle, int n,
                            const cuComplex *x, int incx, int *result)
cublasStatus_t cublasIzamin(cublasHandle_t handle, int n,
                            const cuDoubleComplex *x, int incx, int *result)

This function finds the smallest element(最小)索引. 因此,| I m ( x [ j ] ) | + | R e ( x [ j ] ) | The result is the first for i = 1 , … , n 和 j = 1 + ( i - 1 ) * incx 最小的结果. 请注意,The last equation reflects for AND Fortran 兼容的基于 1 的索引.

Param.MemoryIn/outMeaning
handleinputhandle to the cuBLAS library context.
ninputnumber of elements in the vector x.
xdeviceinput<type> vector with elements.
incxinputstride between consecutive elements of x.
resulthost or deviceoutputthe resulting index, which is 0 if n,incx<=0

Error values ​​that this function may return and their meanings are listed below.

Error ValueMeaning
CUBLAS_STATUS_SUCCESS操作成功完成
CUBLAS_STATUS_NOT_INITIALIZED库未初始化
CUBLAS_STATUS_ALLOC_FAILEDUnable to allocate shrink buffer
CUBLAS_STATUS_EXECUTION_FAILEDThis function is not available GPU 上启动

请参考:

isamin

原网站

版权声明
本文为[Little He Shang who sweeps the floor]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208091314084337.html