CUDALink`
CUDALink`

CUDADot

CUDADot[vec1,vec2]

gives the dot product of vec1 and vec2.

CUDADot[mat,vec]

gives the matrix-vector product of mat and vec.

CUDADot[mat1,mat2]

gives the matrix-matrix product of mat1 and mat2.

更多信息和选项更多信息
  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDADot works only on general vectors types such as "Float", "Double", .
  • CUDADot does not work on fixed vector structure types like "Float[2]", "Integer32[2]", .
  • 范例

    基本范例  (4)

    First, load the CUDALink application:

    In[1]:=
    Click for copyable input

    This performs matrix-matrix multiplication:

    In[2]:=
    Click for copyable input
    Out[2]//MatrixForm=

    This performs matrix-vector multiplication:

    In[1]:=
    Click for copyable input
    Out[1]//MatrixForm=

    This performs the dot product:

    In[1]:=
    Click for copyable input
    Out[1]=

    If input is CUDAMemory, then memory is returned as output:

    In[1]:=
    Click for copyable input

    This multiplies the two input memories together:

    In[2]:=
    Click for copyable input
    Out[2]=

    Memory is retrieved using CUDAMemoryGet:

    In[3]:=
    Click for copyable input
    Out[3]//MatrixForm=

    Memory must be freed with CUDAMemoryUnload:

    In[4]:=
    Click for copyable input

    参见

    Dot  CUDATotal  CUDATranspose

    教程