cudolfinx.la

Wrapper classes for linear algebra objects on the GPU.

Classes

CUDAMatrix(ctx, petsc_mat)

Matrix on device.

CUDAVector(ctx, vec[, include_ghosts])

Vector on device.

class cudolfinx.la.CUDAMatrix(ctx, petsc_mat)[source]

Bases: object

Matrix on device.

Initialize the matrix.

assemble()[source]

Call assemble on the underlying PETSc matrix.

If the PETSc matrix is not a CUDA matrix, then matrix values will be explicitly copied to the host.

property mat

Return underlying CUDA matrix.

class cudolfinx.la.CUDAVector(ctx, vec, include_ghosts: bool = False)[source]

Bases: object

Vector on device.

Initialize the vector.

to_device()[source]

Copy host-side values (including ghosts) to device.

to_host()[source]

Copy device-side values to host.

property vector

Return underlying PETSc vector.