File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -861,6 +861,14 @@ int Cuda::impl_is_initialized() {
861
861
862
862
void Cuda::impl_initialize (InitializationSettings const &settings) {
863
863
Impl::CudaInternal::singleton ().initialize (Impl::get_gpu (settings));
864
+
865
+ // In order to support setting an atexit hook for Kokkos::finalize
866
+ // We need to ensure that the Cuda deep_copy instance is not destroyed
867
+ // before that atexit hook is getting called.
868
+ // Thus we create the static instance here, so that it will be deallocated
869
+ // after the potential atexit call.
870
+ // This is neccessary since we will access that instance in Kokkos::finalize
871
+ (void )::Kokkos::Impl::cuda_get_deep_copy_space (true );
864
872
}
865
873
866
874
std::vector<unsigned > Cuda::detect_device_arch () {
You can’t perform that action at this time.
0 commit comments