|
SOLUTIONS
|
OPENCLLINK 符号
OpenCLMemoryCopyToHost
OpenCLMemoryCopyToHost[mem]
force copies OpenCLMemory from the GPU to the CPU.
更多信息更多信息
- The OpenCLLink application must be loaded using Needs["OpenCLLink`"].
- OpenCLMemory is returned by OpenCLMemoryLoad or OpenCLMemoryAllocate.
范例范例打开所有单元关闭所有单元
基本范例 (1)基本范例 (1)
First, load the OpenCLLink application:
| In[1]:= |
This loads the Range[10] list into OpenCLLink:
| In[2]:= |
| Out[2]= |
This gives information about the returned memory. Notice how the
is
:
| In[3]:= |
| Out[3]= | ![]() |
This forces a copy from the host memory (CPU) to the device memory (GPU):
| In[4]:= |
| Out[4]= |
This gives information about the returned memory. Notice how both
and
are
:
| In[5]:= |
| Out[5]= | ![]() |
This will perform an unnecessary copy from the device to the host:
| In[6]:= |
| Out[6]= |
The information is not changed:
| In[7]:= |
| Out[7]= | ![]() |
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »



