• 16.cuBLAS开发指南中文版--cuBLAS中的Level-1函数rotm()和rotmg()


    cuBLAS中的Level-1函数rotm()和rotmg()

    在这里插入图片描述

    2.5.10. cublasrotm()

    cublasStatus_t cublasSrotm(cublasHandle_t handle, int n, float  *x, int incx,
                               float  *y, int incy, const float*  param)
    cublasStatus_t cublasDrotm(cublasHandle_t handle, int n, double *x, int incx,
                               double *y, int incy, const double* param)
    
    • 1
    • 2
    • 3
    • 4

    此函数应用修改后的 Givens 变换

    H = h 1 1 h 1 2 h 2 1 h 2 2

    到向量 x 和 y。

    因此,结果是 x [ k ] = h 1 1 × x [ k ] + h 1 2 × y [ j ] 和 y [ j ] = h 2 1 × x [ k ] + h 2 2 × y [ j ] 其中 k = 1 + ( i - 1 ) * incx 和 j = 1 + ( i - 1 ) * incy 。 请注意,最后两个等式反映了用于与 Fortran 兼容的基于 1 的索引。

    矩阵 H 的元素 、 和 分别存储在 param[1]、param[2]、param[3] 和 param[4] 中。 flag=param[0] 为矩阵 H 项定义以下预定义值

    flag=-1.0flag= 0.0flag= 1.0flag=-2.0
    h 1 1 h 1 2 h 2 1 h 2 21 . 0 h 1 2 h 2 1 1 . 0h 1 1 1 . 0 - 1 . 0 h 2 21 . 0 0 . 0 0 . 0 1 . 0

    请注意,标志所隐含的值 -1.0、0.0 和 1.0 未存储在 param 中。

    Param.MemoryIn/outMeaning
    handleinputhandle to the cuBLAS library context.
    ninputnumber of elements in the vector x.
    xdeviceinput vector with n elements.
    incxinputstride between consecutive elements of x.
    ydevicein/out vector with n elements.
    incyinputstride between consecutive elements of y.
    paramhost or deviceinput vector of 5 elements, where param[0] and param[1-4] contain the flag and matrix H .

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

    Error ValueMeaning
    CUBLAS_STATUS_SUCCESS操作成功完成
    CUBLAS_STATUS_NOT_INITIALIZED库未初始化
    CUBLAS_STATUS_EXECUTION_FAILED该功能无法在 GPU 上启动

    请参考:
    srotm, drotm

    2.5.11. cublasrotmg()

    cublasStatus_t cublasSrotmg(cublasHandle_t handle, float  *d1, float  *d2,
                                float  *x1, const float  *y1, float  *param)
    cublasStatus_t cublasDrotmg(cublasHandle_t handle, double *d1, double *d2,
                                double *x1, const double *y1, double *param)
    
    • 1
    • 2
    • 3
    • 4

    此函数构造修改后的 Givens 变换

    H = h 1 1 h 1 2 h 2 1 h 2 2

    将 2 × 1 向量 (d 1 * x 1 , d 2 * y 1 ) T 的第二个条目归零。

    flag=param[0] 为矩阵 H 项定义以下预定义值

    flag=-1.0flag= 0.0flag= 1.0flag=-2.0
    h 1 1 h 1 2 h 2 1 h 2 21 . 0 h 1 2 h 2 1 1 . 0h 1 1 1 . 0 - 1 . 0 h 2 21 . 0 0 . 0 0 . 0 1 . 0
    Param.MemoryIn/outMeaning
    handleinputhandle to the cuBLAS library context.
    d1host or devicein/out scalar that is overwritten on exit.
    d2host or devicein/out scalar that is overwritten on exit.
    x1host or devicein/out scalar that is overwritten on exit.
    y1host or deviceinput scalar.
    paramhost or deviceoutput vector of 5 elements, where param[0] and param[1-4] contain the flag and matrix H .

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

    Error ValueMeaning
    CUBLAS_STATUS_SUCCESS操作成功完成
    CUBLAS_STATUS_NOT_INITIALIZED库未初始化
    CUBLAS_STATUS_EXECUTION_FAILED该功能无法在 GPU 上启动

    请参考:
    srotmg, drotmg

  • 相关阅读:
    如何固定 wsl-ubuntu 的 IP 地址
    Zookeeper经典应用场景实战(二)
    818专业课【考经】—《信号系统》之章节概要:第六章 连续时间系统的变换域分析
    100天精通Python(可视化篇)——第108天:Pyecharts绘制多种炫酷词云图参数说明+代码实战
    Wordpress自定义小工具logo调用设置(可视化)
    一种改进的进化模型和混沌优化的萤火虫算法-附代码
    南方电网的能源棋局上,蔚来换电扮演什么角色?
    python网页爬虫接口和常见反扒
    Android 11.0 framework层实现app默认全屏显示
    垃圾收集器
  • 原文地址:https://blog.csdn.net/kunhe0512/article/details/126285586