当前位置:网站首页>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. | Memory | In/out | Meaning |
|---|---|---|---|
| handle | input | handle to the cuBLAS library context. | |
| n | input | number of elements in the vector x. | |
| x | device | input | <type> vector with elements. |
| incx | input | stride between consecutive elements of x. | |
| result | host or device | output | the resulting index, which is 0 if n,incx<=0 |
Error values that this function may return and their meanings are listed below.
| Error Value | Meaning |
|---|---|
| CUBLAS_STATUS_SUCCESS | 操作成功完成 |
| CUBLAS_STATUS_NOT_INITIALIZED | 库未初始化 |
| CUBLAS_STATUS_ALLOC_FAILED | Unable to allocate shrink buffer |
| CUBLAS_STATUS_EXECUTION_FAILED | This 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. | Memory | In/out | Meaning |
|---|---|---|---|
| handle | input | handle to the cuBLAS library context. | |
| n | input | number of elements in the vector x. | |
| x | device | input | <type> vector with elements. |
| incx | input | stride between consecutive elements of x. | |
| result | host or device | output | the resulting index, which is 0 if n,incx<=0 |
Error values that this function may return and their meanings are listed below.
| Error Value | Meaning |
|---|---|
| CUBLAS_STATUS_SUCCESS | 操作成功完成 |
| CUBLAS_STATUS_NOT_INITIALIZED | 库未初始化 |
| CUBLAS_STATUS_ALLOC_FAILED | Unable to allocate shrink buffer |
| CUBLAS_STATUS_EXECUTION_FAILED | This function is not available GPU 上启动 |
请参考:
边栏推荐
猜你喜欢
随机推荐
蓝桥历届真题-蛇形填数
11.cuBLAS开发指南中文版--cuBLAS中的Level-1函数amax()和amin()
操作系统迁移实战之在openEuler上部署MySQL数据库
NC40 链表相加(二)
pytest 之 fixture的定义及作用域
RobotFramework 之 RF变量与标准库关键字使用
面试攻略系列(四)-- 你不知道的大厂面试
NC53 删除链表的倒数第n个节点
对百度的内容进行修改
Spark GC日志分析
Sql之各种Join
pytest 与 unittest 的区别
Q_08 更多信息
ODA一体机有什么缺点
激光器如何养护才能远离结露没烦恼
如何用vs新建Asp.net项目(Web页面)
pyhook3简单应用(1)--实现截图保存功能
客户端连接rtsp的步骤
目标检测类间不平衡问题
蓝桥历届真题-既约分数









