CUDAVector[data]
yields a vector of data which resides on a CUDA enabled GPU.
CUDAVector[data,type]
yields a vector of the specified type.
CUDAVector
CUDAVector[data]
yields a vector of data which resides on a CUDA enabled GPU.
CUDAVector[data,type]
yields a vector of the specified type.
Details and Options
- The CUDALink application must be loaded using Needs["CUDALink`"].
- The resources used by a CUDAVector are automatically reclaimed from the GPU when they are no longer used.
- The data in a CUDAVector can be retrieved by Normal.
- A number of functions accept and return CUDAVector objects allowing operations to work with data that stays on the GPU.
- Possible types for CUDAVector are:
-
"Integer32" "Real32" "ComplexReal32" "Integer64" "Real64" "ComplexReal64"
Examples
open all close allBasic Examples (1)
First, load the CUDALink application:
Needs["CUDALink`"]Create a vector of data that lives on the GPU:
vec = CUDAVector[ {1., 2., 3.}]Compute a dot product on the GPU:
CUDADot[vec, vec]Retrieve the data from a CUDAVector:
Normal[vec]Scope (1)
Possible Issues (1)
Normal of a CUDAVector is a NumericArray:
cuvec = CUDAVector[{1., 2., 3.}];
Normal[cuvec]To get the underlying data, Normal is applied twice:
Normal[Normal[cuvec]]Tech Notes
Related Guides
-
▪
- CUDALink
Text
Wolfram Research (2022), CUDAVector, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDAVector.html.
CMS
Wolfram Language. 2022. "CUDAVector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDAVector.html.
APA
Wolfram Language. (2022). CUDAVector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDAVector.html
BibTeX
@misc{reference.wolfram_2026_cudavector, author="Wolfram Research", title="{CUDAVector}", year="2022", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDAVector.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cudavector, organization={Wolfram Research}, title={CUDAVector}, year={2022}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDAVector.html}, note=[Accessed: 15-June-2026]}