| bffec52e | 19-Oct-2015 |
Karl Rupp <rupp@iue.tuwien.ac.at> |
PetscInitialize/CUDA: Now reentrant.
cudaSetDeviceFlags() cannot be called repeatedly if the device is in use, so we only call it in the first call of PetscInitialize(). The alternative would be to
PetscInitialize/CUDA: Now reentrant.
cudaSetDeviceFlags() cannot be called repeatedly if the device is in use, so we only call it in the first call of PetscInitialize(). The alternative would be to call cudaDeviceReset() in PetscFinalize(), but that would destroy all buffers ever allocated. Since this would potentially break quite a bunch of user-codes, just calling cudaSetDeviceFlags() once causes less harm.
Of course it would be better to have a nice way of configuring the CUDA setup before calling PetscInitialize() and then a graceful cleanup in PetscFinalize(). This, however, is substantially more involved and needs to be part of a general overhaul of the CUDA backend.
show more ...
|