CUDASparseContext#

class MCEq.solvers.CUDASparseContext(int_m, dec_m, device_id=0)[source]#

Bases: object

This class handles the transfer between CPU and GPU memory, and the calling of GPU kernels. Initialized by MCEq.core.MCEqRun and used by solv_CUDA_sparse().

Methods Summary

alloc_grid_sol(dim, nsols)

Allocates memory for intermediate if grid solution requested.

dump_sol()

Saves current solution to a new index in grid solution memory.

get_gridsol()

Downloads grid solution to main memory.

get_phi()

Downloads current solution from GPU memory.

set_matrices(int_m, dec_m)

Upload sparce matrices to GPU memory

set_phi(phi)

Uploads initial condition to GPU memory.

solve_step(rho_inv, dX)

Makes one solver step on GPU using cuSparse (BLAS)

Methods Documentation

alloc_grid_sol(dim, nsols)[source]#

Allocates memory for intermediate if grid solution requested.

dump_sol()[source]#

Saves current solution to a new index in grid solution memory.

get_gridsol()[source]#

Downloads grid solution to main memory.

get_phi()[source]#

Downloads current solution from GPU memory.

set_matrices(int_m, dec_m)[source]#

Upload sparce matrices to GPU memory

set_phi(phi)[source]#

Uploads initial condition to GPU memory.

solve_step(rho_inv, dX)[source]#

Makes one solver step on GPU using cuSparse (BLAS)