English 中文(简体)
CUDA 幼崽<t>gbmv 理解
原标题:CUDA cublas<t>gbmv understanding
  • 时间:2012-05-23 17:13:56
  •  标签:
  • cuda
  • cublas

我最近想要使用一个简单的 CUDA 矩阵- 矢量乘法 。 我在 cubablas 库库中找到了一个合适的功能 : cublas< & gt; & gt; & gt; gbmv。 这里是 < href=" http://www.google.by/url? sa=t& rct=j& qamp; esrc=s& 源代码=we& cd=3& 0CE0QFAC& url=http% 3A2FLT;% 2FdevZone% 2Fdocs% 2Fhtml% 2FUFUDALaribraies% 2Fdoc% 2FDUBASS_LIbrary.pdf& ei=Ngm8T4E4vesaw0ozdod@amp; us=AFTAY2NBBE8R819_ UDDD=ZQ_ amp=RQQQQQQQQQQA= real=R=R0amp

But it is actually very poor, so I didn t manage to understand what the kl and ku parameters mean. Moreover, I have no idea what stride is (it must also be provided). There is a brief explanation of these parameters (Page 37), but it looks like I need to know something else.

在互联网上搜索并不能提供关于这一问题的大量有用信息,多数参考文件的不同版本。

我有几个问题要问GPU/CUDA/cublas Gurus:

  1. How do I find more understandable docs or guides about using cublas?
  2. If you know how to use this very function, couldn t you explain me how do I use it?
  3. Maybe cublas library is somewhat extraordinary and everyone uses something more popular, better documented and so on?

非常感谢。

最佳回答

因此,>BLAS (基本线性代数子方案)通常是一个API,如其名称所说,用于基本的线性代数常规,包括矢量-矢量操作(一级低位常规)、矩阵-矢量操作(二级)和矩阵-矩阵-矩阵操作(三级)。有 可用,可以正确执行一切,但大部分时间你对结构使用优化实施。 CUDA 的 cuBLAS 是 CUDA 的一种实施。

BLAS API非常成功,是一个描述其被广泛采用的基本操作的API。然而,(a) 由于当时的建筑限制(这是1979年,而API的定义是使用8个或8个以下字符的名称,以确保它能够广泛汇编),这些名称非常神秘。 (b) 之所以成功,是因为它非常笼统,因此即使是最简单的功能电话也要求许多不相干的论点。

因为它如此广泛, 它常常假设,如果你再做数字线性代数, 你已经知道API的总论了, 所以执行手册经常会遗漏重要的细节, 我认为这就是你正在经历的。

2级和3级常规一般都有表单的函数名称 TMMOO. T 是矩阵/矢量器的数值类型(单精度/双精度真实的 S /D D/code>,单精度/双精度复合的 C /code/code>是矩阵类型(通用的 >>GE ,例如,只有一个密集的矩阵,不能说任何其他的话;一般带宽矩阵的 GB ,对符号矩阵的,等等),以及“code>OOO 是操作。

这一切都看起来有点荒谬,但效果和效果相对较好-- 你很快就学会了扫描这些相似的操作, 这样SGEMV就是一个单一精准的一般矩阵乘数乘数乘数( 这可能是你想要的, 不是SGBMV), DGEMM是双精度矩阵乘数,等等。 但是它确实需要一些实践。

所以,如果你查看幼崽Sgemv指令,或的“http://www.netlib.org/blas/sgemv.f” rel=“noreferr” 原始 的文件,您可以跳过参数列表。首先,基本操作是:

This function performs the matrix-vector multiplication y = a op(A)x + b y where A is a m x n matrix stored in column-major format, x and y are vectors, and and are scalars.

op(A) 可以是 A, A T , 或 A H 。 所以,如果您想要 y = Ax , 和常见情况一样, 那么, a = 1 , b = 0 。 和 transa = cubLAS_OP_N

incx 中不同元素之间的斜线; 有很多情况下, 这会有用, 但是如果 > x 只是包含矢量的简单 1d 数组, 那么斜线将是 1 。

这就是SGEMV所需要的一切

问题回答

暂无回答




相关问题
Why won t OpenCV compile in NVCC?

I am trying to integrate CUDA and openCV in a project. Problem is openCV won t compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC ...

error in CUDA compilation

I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008 LINK : fatal error LNK1181: cannot open input file cutil32D.lib Any pointers how to ...

CUDA Memory Allocation accessible for both host and device

I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...