• 39.cuBLAS开发指南中文版--cuBLAS中的Level-2函数hpr()


    2.6.22. cublashpr()

    在这里插入图片描述

    cublasStatus_t cublasChpr(cublasHandle_t handle, cublasFillMode_t uplo,
                              int n, const float *alpha,
                              const cuComplex       *x, int incx,
                              cuComplex       *AP)
    cublasStatus_t cublasZhpr(cublasHandle_t handle, cublasFillMode_t uplo,
                              int n, const double *alpha,
                              const cuDoubleComplex *x, int incx,
                              cuDoubleComplex *AP)
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    此函数执行打包的 Hermitian rank-1 更新

    A = α x x H + A A=\alpha xx^H + A A=αxxH+A

    其中 A 是以列优先格式存储的 NxN Hermitian 矩阵,x 是向量, α \alpha α 是标量。

    如果 uplo == CUBLAS_FILL_MODE_LOWER 则将Hermitian 矩阵 A(i,j) 下三角部分的元素逐列无间隙地打包在一起,使得元素存储在内存位置 AP[i+((2*n -j+1)*j)/2] 对于 j=1,…,n 和 i>=j 。 因此,打包格式只需要 n(n+1)/2 个元素进行存储。

    如果 uplo == CUBLAS_FILL_MODE_UPPER 则将Hermitian 矩阵上三角部分的元素逐列无间隙地打包在一起,使得元素存储在内存位置 AP[i+(j*(j+1))/2 ] 对于 j=1,…,n 和 i<=j 。 因此,打包格式只需要 n(n+1)/2 个元素进行存储。

    Param.MemoryIn/outMeaning
    handleinputhandle to the cuBLAS library context.
    uploinputIndicates if matrix A lower or upper part is stored, the other Hermitian part is not referenced and is inferred from the stored elements.
    ninputnumber of columns of matrix A.
    alphahost or deviceinput scalar used for multiplication.
    APdeviceinput/output array with A stored in packed format. The imaginary parts of the diagonal elements are assumed and set to zero.
    xdeviceinput vector with n elements if transa == CUBLAS_OP_N and m elements otherwise.
    incxinputstride between consecutive elements of x.

    该函数可能返回的错误值及其含义如下所列。

    ErrorValueMeaning
    CUBLAS_STATUS_SUCCESS操作成功完成
    CUBLAS_STATUS_NOT_INITIALIZED库未初始化
    CUBLAS_STATUS_INVALID_VALUEIf n < 0 or if incx == 0 or if uplo != CUBLAS_FILL_MODE_UPPER ,CUBLAS_FILL_MODE_LOWER or if lda < max(1, n) oralpha == NULL
    CUBLAS_STATUS_EXECUTION_FAILED该功能无法在 GPU 上启动

    详细信息, 请参考:

    chpr, zhpr

  • 相关阅读:
    测试杂谈——一条SQL引发的思考
    LayoutLMv3 : 基于统一文本和带Masking图像的文档AI预训练【论文翻译】
    Net 高级调试之二:CLR和Windows加载器及应用程序域介绍
    ggplot2颜色设置总结
    为什么MySQL使用B+树索引,而不使用其他作为索引呢?
    暗云III木马技术分析
    Ajax:异步的 JavaScript 和 XML
    29.7.3 问题解决
    PROFINET非周期读写分析笔记
    spring bean实例注入到map 集合中
  • 原文地址:https://blog.csdn.net/kunhe0512/article/details/128012656