zoukankan      html  css  js  c++  java
  • CuSparse 第一章

    (部分翻译)

    第一章 介绍

        1. 命名惯例

           CUSPARSE 包含了一系列处理稀疏矩阵的基本的线性代数子程式。是cuda函数库的一部分,从C,C++中调用。

           该库例程可以分为四类:

                 第一层:在稠密向量格式和稀疏矩阵向量格式之间的操作

                 第二层:在稀疏矩阵格式和稠密向量格式之间的操作

                 第三层:在稀疏矩阵格式和一组稠密向量之间的操作

                 转换:不同格式矩阵之间转换操作

                 CUSparse支持的数据格式有 float,double, cuComplex, cuDoubleComplex.  

                

                稀疏矩阵第一层,第二层,第三层函数都遵循这样的命名惯例:

               cusparse<t>[<matrix data format>]<operation>[<output matrix data format>]Introduction

               其中 <t> 可以是 S, D, C, Z, or X, 分别对应数据类型 float, double, cuComplex, cuDoubleComplex, and the generic type.
               <matrix data format> 可以是 dense, coo, csr, csc, or hyb, 分别对应 dense, coordinate, compressed sparse row, compressed sparse column, and hybrid storage formats.
              最后,  <operation> 可以是 axpyi, doti, dotci, gthr, gthrz, roti, or sctr, 对应 the Level 1 functions; 也可以是 mv or sv,  对应 Level 2 functions, 或者 mm or sm,  对应 the Level 3 functions.
               所有这些函数的返回值都是 cusparseStatus_t 类型的。

         2. 异步执行

              The CUSPARSE 库函数是类似主机的,异步执行的, 并且在结果算出来的时候会回到主机控制。
              开发这可以用 cudaDeviceSynchronize() 函数去确认CUSPARSE函数库里的命令已经执行完毕。 开发者也可以用 cudaMemcpy() routine 去拷贝数据,且不需要用  cudaDeviceSynchronize() 来确认执行完毕,如果参数是cudaMemcpyDeviceToHost 或者cudaMemcpyHostToDevice.



    参考文档:http://docs.nvidia.com/cuda/pdf/CUSPARSE_Library.pdf     《CUSPARSE LIBRARY》

  • 相关阅读:
    Path Sum II
    Convert Sorted Array to Binary Search Tree
    Construct Binary Tree from Inorder and Postorder Traversal
    Construct Binary Tree from Preorder and Inorder Traversal
    Maximum Depth of Binary Tree
    Binary Tree Zigzag Level Order Traversal
    Binary Tree Level Order Traversal
    Same Tree
    Validate Binary Search Tree
    Binary Tree Inorder Traversal
  • 原文地址:https://www.cnblogs.com/pangblog/p/3317880.html
Copyright © 2011-2022 走看看