Karl Rupp <[email protected]> writes:
> What is a bit tricky is the question of *when* to call cudaSetDevice() 
> then. We require users to call PetscInitialize() before anything else, 
> so cudaSetDevice() needs to be called from some other place. I like the 
> lazy instantiation model, where the GPU backends (OpenCL, CUDA) are 
> initialized only when the first object (e.g. a Vec) is created. 

This should also enable compiling libraries/binaries that support GPUs,
but then running on machines that don't have GPUs or don't have _enough_
for the number of MPI ranks you are using (provided you aren't making
GPU objects).  This is a very desirably property.

When at all possible, defer decisions to run-time when you have more
information about what is needed.

> I think this can be implemented fairly quickly - I'll do it unless
> there are any objections later today.

Thanks!

Attachment: pgp96akU1FCnO.pgp
Description: PGP signature

Reply via email to