简体   繁体   English

为什么CuBlas不对三角形矩阵使用一维数组?

[英]Why does CuBlas not use a 1d array for triangular matrices?

This might be a throwback to the old BLAS library design, but I was surprised just now to find that CuBlas wastes memory by using regular 2d arrays for triangular matrices. 这可能是对旧的BLAS库设计的一种回想,但我刚才感到惊讶的是,发现CuBlas通过对三角形矩阵使用常规2d数组来浪费内存。 I suppose this makes interfacing with the rest of the API more convenient. 我想这使与API其余部分的接口更加方便。

I was surprised just now to find that CuBlas wastes memory by using regular 2d arrays for triangular matrices 刚才我很惊讶地发现CuBlas通过对三角形矩阵使用常规2d数组浪费了内存

That isn't strictly true. 严格说来并非如此。

If you look at the Level 2 BLAS routines, you will see that they operate on triangular or Hermitian matrices stored in a packed format. 如果您查看2级BLAS例程,您会发现它们在以打包格式存储的三角或Hermitian矩阵上运行。

The Level 3 BLAS routines don't, but there are two good reasons why they are stored in full dense format. 3级BLAS例程没有,但是有两个很好的理由将它们以完全密集的格式存储。

  • BLAS does it that way BLAS就是这样

  • Those routines were mostly added to BLAS as support for LAPACK solvers. 这些例程大部分已添加到BLAS中,以支持LAPACK求解器。 And those solvers typically store the results of factorizations in-situ in supplied full dense inputs, so it is logical to use that format in BLAS 而且这些求解器通常在提供的全密集输入中原位存储分解的结果,因此在BLAS中使用该格式是合乎逻辑的

I guess if you don't like the design choice you can always try writing to Jack Dongarra to complain. 我想如果您不喜欢这种设计选择,可以随时尝试写信给Jack Dongarra投诉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM