gather
Transfer a gpuArray to the host workspace.
📝Syntax
A = gather(G)
📥Input Arguments
Parameter Description
G a gpuArray, or any host value.
📤Output Arguments
Parameter Description
A a host array with the same values and underlying type.
📄Description

A = gather(G) copies the gpuArray G from the device back to the host workspace. The result is a single, logical or complex single array, matching the underlying type of G.

When G is already a host value, gather returns it unchanged.

💡Examples
G = gpuArray(single([1 2 3]));
A = gather(G + 1)
🔗See Also
gpuArray
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub