OpenCLMemoryCopyToHost[mem]
force copies OpenCLMemory from the GPU to the CPU.
OpenCLMemoryCopyToHost
OpenCLMemoryCopyToHost[mem]
force copies OpenCLMemory from the GPU to the CPU.
Details and Options
- The OpenCLLink application must be loaded using Needs["OpenCLLink`"].
- OpenCLMemory is returned by OpenCLMemoryLoad or OpenCLMemoryAllocate.
Examples
Basic Examples (1)
First, load the OpenCLLink application:
Needs["OpenCLLink`"]This loads the Range[10] list into OpenCLLink:
mem = OpenCLMemoryLoad[Range[10]]This gives information about the returned memory. Notice how the "DeviceStatus" is "Uninitialized":
OpenCLMemoryInformation[mem]This forces a copy from the host memory (CPU) to the device memory (GPU):
OpenCLMemoryCopyToDevice[mem]This gives information about the returned memory. Notice how both "HostStatus" and "DeviceStatus" are "Synchronized":
OpenCLMemoryInformation[mem]This will perform an unnecessary copy from the device to the host:
OpenCLMemoryCopyToHost[mem]The information is not changed:
OpenCLMemoryInformation[mem]Tech Notes
Related Guides
Related Links
Text
Wolfram Research (2010), OpenCLMemoryCopyToHost, Wolfram Language function, https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMemoryCopyToHost.html.
CMS
Wolfram Language. 2010. "OpenCLMemoryCopyToHost." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMemoryCopyToHost.html.
APA
Wolfram Language. (2010). OpenCLMemoryCopyToHost. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMemoryCopyToHost.html
BibTeX
@misc{reference.wolfram_2026_openclmemorycopytohost, author="Wolfram Research", title="{OpenCLMemoryCopyToHost}", year="2010", howpublished="\url{https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMemoryCopyToHost.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_openclmemorycopytohost, organization={Wolfram Research}, title={OpenCLMemoryCopyToHost}, year={2010}, url={https://reference.wolfram.com/language/OpenCLLink/ref/OpenCLMemoryCopyToHost.html}, note=[Accessed: 13-June-2026]}