当前位置:网站首页>13.cuBLAS开发指南中文版--cuBLAS中的Level-1函数copy()和dot()
13.cuBLAS开发指南中文版--cuBLAS中的Level-1函数copy()和dot()
2022-08-11 01:33:00 【扫地的小何尚】
2.5.5. cublas<t>copy()

cublasStatus_t cublasScopy(cublasHandle_t handle, int n,
const float *x, int incx,
float *y, int incy)
cublasStatus_t cublasDcopy(cublasHandle_t handle, int n,
const double *x, int incx,
double *y, int incy)
cublasStatus_t cublasCcopy(cublasHandle_t handle, int n,
const cuComplex *x, int incx,
cuComplex *y, int incy)
cublasStatus_t cublasZcopy(cublasHandle_t handle, int n,
const cuDoubleComplex *x, int incx,
cuDoubleComplex *y, int incy)
该函数将向量 x 复制到向量 y 中。 因此,执行的操作是 y [ j ] = x [ k ] 对于 i = 1 , … , n , k = 1 + ( i - 1 ) * incx 和 j = 1 + ( i - 1 ) * incy 。 请注意,最后两个等式反映了用于与 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 n elements. |
| incx | input | stride between consecutive elements of x. | |
| y | device | in/out | <type> vector with n elements. |
| incy | input | stride between consecutive elements of y. |
| Error Value | Meaning |
|---|---|
| CUBLAS_STATUS_SUCCESS | 操作成功完成 |
| CUBLAS_STATUS_NOT_INITIALIZED | 库未初始化 |
| CUBLAS_STATUS_ALLOC_FAILED | 无法分配缩减缓冲区 |
请参考:
2.5.6. cublas<t>dot()
cublasStatus_t cublasSdot (cublasHandle_t handle, int n,
const float *x, int incx,
const float *y, int incy,
float *result)
cublasStatus_t cublasDdot (cublasHandle_t handle, int n,
const double *x, int incx,
const double *y, int incy,
double *result)
cublasStatus_t cublasCdotu(cublasHandle_t handle, int n,
const cuComplex *x, int incx,
const cuComplex *y, int incy,
cuComplex *result)
cublasStatus_t cublasCdotc(cublasHandle_t handle, int n,
const cuComplex *x, int incx,
const cuComplex *y, int incy,
cuComplex *result)
cublasStatus_t cublasZdotu(cublasHandle_t handle, int n,
const cuDoubleComplex *x, int incx,
const cuDoubleComplex *y, int incy,
cuDoubleComplex *result)
cublasStatus_t cublasZdotc(cublasHandle_t handle, int n,
const cuDoubleComplex *x, int incx,
const cuDoubleComplex *y, int incy,
cuDoubleComplex *result)
此函数计算向量 x 和 y 的点积。 因此,结果是 ∑ i = 1 n ( x [ k ] × y [ j ] ) 其中 k = 1 + ( i - 1 ) * incx 和 j = 1 + ( i - 1 ) * incy 。 请注意,在第一个方程中,如果函数名称以字符“c”结尾,则应使用向量 x 的元素的共轭,并且最后两个方程反映了用于与 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 n elements. |
| incx | input | stride between consecutive elements of x. | |
| y | device | in/out | <type> vector with n elements. |
| incy | input | stride between consecutive elements of y. | |
| result | host or device | output | the resulting dot product, which is 0.0 if n<=0. |
该函数可能返回的错误值及其含义如下所列。
| Error Value | Meaning |
|---|---|
| CUBLAS_STATUS_SUCCESS | 操作成功完成 |
| CUBLAS_STATUS_NOT_INITIALIZED | 库未初始化 |
| CUBLAS_STATUS_ALLOC_FAILED | 无法分配缩减缓冲区 |
| CUBLAS_STATUS_EXECUTION_FAILED | 该功能无法在 GPU 上启动 |
边栏推荐
- Exception: try catch finally throws throw
- 进程间通信(IPC)的分类以及通信方式的发展
- 两日总结十一
- 简陋的nuxt3学习笔记
- what is an array
- apache+PHP+MySQL+word press,安装word press时页面报错?
- J9 Digital Theory: DAO governance is more like an ecological process: governance is native to the network and continues to evolve
- MySQL索引与事务
- MySQL基础篇【第一篇】| 数据库概述及数据准备、常用命令、查看表结构步骤
- Linux install redis database
猜你喜欢

SQL statement--get database table information, table name, column name, description comment, etc.

第二课第一周第4-6节 医学预后案例欣赏+作业解析

Exceptions and exception handling mechanisms
![【iframe父页面调用子页面的方法】踩坑:获取元素的时候需要用 `[x]`是关键,不能用`.eq(x)`否则获取不到。](/img/ec/0cca8c7011770429c34a6aa1f36460.png)
【iframe父页面调用子页面的方法】踩坑:获取元素的时候需要用 `[x]`是关键,不能用`.eq(x)`否则获取不到。

22、库存服务

Flink二阶段提交
![Deep Learning [Chapter 2]](/img/09/5eb16731c3c47965da131c2aa0c2c3.png)
Deep Learning [Chapter 2]

阿里的数据同步神器——Canal

Word set before the title page

络达开发---自定义Timer的实现
随机推荐
loop word
数据分析面试手册《统计篇》
[ASM] The relationship between the role of the bytecode operation ClassWriter COMPUTE_FRAMES and visitMaxs
软件测试面试题:对 RUP,CMM,CMMI,XP,PSP,TSP 的认识?
Shengxin experiment record (part2)--tf.reduce_sum() usage introduction
Elastic scaling of construction resources
数据库数据采集利器FlinkCDC
ABP中的数据过滤器
【微波工程学习记录1】功率分配器和定向耦合器
#yyds干货盘点#【愚公系列】2022年08月 Go教学课程 008-数据类型之整型
Is container technology really the savior of environmental management?
研发项目流程规范
Vim take on a window.
Linux安装redis数据库
HCIP-R&S By Wakin自用笔记(3)OSPF之引入外部路由、Forwarding-Address、汇总、特殊区域
BEVDepth: Acquisition of Reliable Depth for Multi-view 3D Object Detection Paper Notes
dump_stack()
软件测试面试题:什么是数据的对立性,有几个层次?
还在用 Xshell?你 out 了,推荐一个更现代的终端连接工具,好用到爆!
导入数据包上传宝贝提示“类目不能为空”是什么原因,怎么解决?