| 227 | } |
| 228 | |
| 229 | void |
| 230 | DeallocateRandomSeedDevArray () |
| 231 | { |
| 232 | #ifdef AMREX_USE_GPU |
| 233 | #ifdef AMREX_USE_SYCL |
| 234 | if (rand_engine_descr) { |
| 235 | delete rand_engine_descr; |
| 236 | Gpu::streamSynchronize(); |
| 237 | rand_engine_descr = nullptr; |
| 238 | } |
| 239 | if (gpu_rand_generator != nullptr) { |
| 240 | delete gpu_rand_generator; |
| 241 | Gpu::streamSynchronize(); |
| 242 | gpu_rand_generator = nullptr; |
| 243 | } |
| 244 | #else |
| 245 | if (gpu_rand_state != nullptr) |
| 246 | { |
| 247 | The_Arena()->free(gpu_rand_state); |
| 248 | gpu_rand_state = nullptr; |
| 249 | } |
| 250 | if (gpu_rand_generator != nullptr) |
| 251 | { |
| 252 | #if defined(AMREX_USE_CUDA) |
| 253 | AMREX_CURAND_SAFE_CALL(curandDestroyGenerator(gpu_rand_generator)); |
| 254 | #else |
| 255 | AMREX_HIPRAND_SAFE_CALL(hiprandDestroyGenerator(gpu_rand_generator)); |
| 256 | #endif |
| 257 | gpu_rand_generator = nullptr; |
| 258 | } |
| 259 | #endif |
| 260 | #endif |
| 261 | } |
| 262 | |
| 263 | void FillRandom (Real* p, Long N) |
| 264 | { |
no test coverage detected