I believe there are a few PetscMallocCuda impls in 
src/sys/memory/cuda/mcudahost.cu that seem to do what you are describing. If 
you are creating mats you can also consider cudaMallocPitch, but I’m not sure 
how that plays with the sparse storage impls that petsc mat uses. Seems more 
useful for dense.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)
Cell: (312) 694-3391

> On Sep 2, 2020, at 09:58, Mark Adams <mfad...@lbl.gov> wrote:
> 
> PETSc mallocs seem to boil down to PetscMallocAlign. There are switches in 
> here but I don't see a Cuda malloc. THis would seem to be convenient if I 
> want to create an Object entirely on Cuda or any device. 
> 
> Are there any thoughts along these lines or should I just duplicate Mat 
> creation, for instance, by hand?

Reply via email to