使用 cublas 作矩阵转置 - uulm's Blog

使用 cublas 作矩阵转置

uulm posted @ Thu, 21 Mar 2013 13:41:53 +0100 in 未分类 , 3613 readers

cublas 默认的矩阵内存布局是 colunm-major 的,用 c/c++ 调用做矩阵转置时需要一些技巧:

对于一个 row-major 的矩阵 A[m][n],设 alpha 为 1, beta 为 0,而且已经复制一份到矩阵 clone 中。

转置方法是

 

cublasSgeam( handle, CUBLAS_OP_T, CUBLAS_OP_N, m, n, &alpha, clone, n, &beta, clone, m, A, m );


Avatar_small
AAA said:
Sun, 24 Apr 2022 22:26:09 +0200

I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information. Merchant Service Agent Program

Avatar_small
AAA said:
Thu, 28 Apr 2022 19:29:37 +0200

Sweet blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thanks Credit Card Processing Agent

Avatar_small
Emma said:
Tue, 17 Jan 2023 11:16:17 +0100

Cublas is a cuda library that provides routines for matrix operations. One routine it provides is a matrix transpose. This real estate Colleyville routine can be used to transpose a matrix in place, meaning that the original matrix is overwritten with the transpose. This can be done with the following code:


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee