yields a sparse matrix 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 CUDASparseMatrix are automatically reclaimed from the GPU when they are no longer used.
  • The data in a CUDASparseMatrix can be retrieved by Normal.
  • A number of functions accept and return CUDASparseMatrix objects allowing operations to work with data that stays on the GPU.
  • Possible types for CUDASparseMatrix are:
  • RealComplex


open allclose all

Basic Examples  (1)

First, load the CUDALink application:

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

Retrieve the data from a CUDASparseMatrix:

Compute a dot product on the GPU (the result also resides on the GPU):

Scope  (1)

Information  (1)

Information about the CUDA sparse matrix:

Possible Issues  (1)

Normal of a CUDASparseMatrix is a SparseArray:

To get the underlying data, Normal is applied twice:

Wolfram Research (2022), CUDASparseMatrix, Wolfram Language function,


Wolfram Research (2022), CUDASparseMatrix, Wolfram Language function,


Wolfram Language. 2022. "CUDASparseMatrix." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2022). CUDASparseMatrix. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2023_cudasparsematrix, author="Wolfram Research", title="{CUDASparseMatrix}", year="2022", howpublished="\url{}", note=[Accessed: 18-June-2024 ]}


@online{reference.wolfram_2023_cudasparsematrix, organization={Wolfram Research}, title={CUDASparseMatrix}, year={2022}, url={}, note=[Accessed: 18-June-2024 ]}