CUDALink`
CUDALink`

CUDAMemoryCopyToDevice

CUDAMemoryCopyToDevice[mem]

force copies CUDAMemory from the CPU to the GPU.

更多信息和选项更多信息
  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • CUDAMemory is returned by CUDAMemoryLoad or CUDAMemoryAllocate.
  • 范例

    基本范例  (1)

    First, load the CUDALink application:

    In[1]:=
    Click for copyable input

    This loads a Range[10] list into CUDALink:

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

    This gives information about the returned memory; notice how the "DeviceStatus" is "Uninitialized":

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

    This forces a copy from the host memory (CPU) to the device memory (GPU):

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

    This gives information about the returned memory; notice how both "HostStatus" and "DeviceStatus" are "Synchronized":

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

    参见

    CUDAMemoryCopyToHost  CUDAMemoryLoad  CUDAMemoryAllocate  CUDAMemoryGet  CUDAMemoryUnload  CUDAMemoryInformation

    教程