WOLFRAM

CUDASparseVector[sparse,type]

yields a sparse vector of given type which resides on a CUDA enabled GPU.

Details and Options

  • The CUDALink application must be loaded using Needs["CUDALink`"].
  • The resources used by a CUDASparseVector are automatically reclaimed from the GPU when they are no longer used.
  • The data in a CUDASparseVector can be retrieved by Normal.
  • A number of functions accept and return CUDASparseVector objects allowing operations to work with data that stays on the GPU.
  • Possible types for CUDASparseVector are:
  • "Real32""ComplexReal32"
    "Real64""ComplexReal64"

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

First, load the CUDALink application:

Create a sparse vector of data that lives on the GPU:

Out[2]=2

Retrieve the data from a CUDASparseVector:

Out[3]=3

Multiply a dense matrix into the sparse vector (the result also lives on the GPU):

Out[4]=4

Scope  (1)Survey of the scope of standard use cases

Information  (1)

Information about the CUDA sparse vector:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

Normal of a CUDASparseVector is a SparseArray:

Out[1]=1

To get the underlying data, Normal is applied twice:

Out[2]=2
Wolfram Research (2022), CUDASparseVector, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.
Wolfram Research (2022), CUDASparseVector, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.

Text

Wolfram Research (2022), CUDASparseVector, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.

Wolfram Research (2022), CUDASparseVector, Wolfram Language function, https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.

CMS

Wolfram Language. 2022. "CUDASparseVector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.

Wolfram Language. 2022. "CUDASparseVector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html.

APA

Wolfram Language. (2022). CUDASparseVector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html

Wolfram Language. (2022). CUDASparseVector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html

BibTeX

@misc{reference.wolfram_2024_cudasparsevector, author="Wolfram Research", title="{CUDASparseVector}", year="2022", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html}", note=[Accessed: 27-March-2025 ]}

@misc{reference.wolfram_2024_cudasparsevector, author="Wolfram Research", title="{CUDASparseVector}", year="2022", howpublished="\url{https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html}", note=[Accessed: 27-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_cudasparsevector, organization={Wolfram Research}, title={CUDASparseVector}, year={2022}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html}, note=[Accessed: 27-March-2025 ]}

@online{reference.wolfram_2024_cudasparsevector, organization={Wolfram Research}, title={CUDASparseVector}, year={2022}, url={https://reference.wolfram.com/language/CUDALink/ref/CUDASparseVector.html}, note=[Accessed: 27-March-2025 ]}