此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

CUDAMemoryCopyToHost

CUDAMemoryCopyToHost[mem]
force copies CUDAMemory from the GPU to the CPU.
  • The CUDALink application must be loaded using Needs.
First, load the CUDALink application:
This loads a Range list into CUDALink:
This gives information about the returned memory; notice how the is :
This forces a copy from the host memory (CPU) to the device memory (GPU):
This gives information about the returned memory; notice how both and are :
This will perform an unnecessary copy from the device to the host:
The information is not changed:
First, load the CUDALink application:
In[1]:=
Click for copyable input
This loads a Range list into CUDALink:
In[2]:=
Click for copyable input
Out[2]=
This gives information about the returned memory; notice how the is :
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 and are :
In[5]:=
Click for copyable input
Out[5]=
This will perform an unnecessary copy from the device to the host:
In[6]:=
Click for copyable input
Out[6]=
The information is not changed:
In[7]:=
Click for copyable input
Out[7]=