Skip to content

Commit

Permalink
Fix deprecation warning for CUDA 12.4 (#3811)
Browse files Browse the repository at this point in the history
`cudaDeviceSetSharedMemConfig` has been deprecated since CUDA 12.4.
  • Loading branch information
WeiqunZhang authored Mar 19, 2024
1 parent a5720c9 commit 5501f73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Src/Base/AMReX_GpuDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,13 @@ Device::initialize_gpu ()
cudaDeviceGetAttribute(&memory_pools_supported, cudaDevAttrMemoryPoolsSupported, device_id);
#endif

#if (__CUDACC_VER_MAJOR__ < 12) || ((__CUDACC_VER_MAJOR__ == 12) && (__CUDACC_VER_MINOR__ < 4))
if (sizeof(Real) == 8) {
AMREX_CUDA_SAFE_CALL(cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeEightByte));
} else if (sizeof(Real) == 4) {
AMREX_CUDA_SAFE_CALL(cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeFourByte));
}
#endif

for (int i = 0; i < max_gpu_streams; ++i) {
AMREX_CUDA_SAFE_CALL(cudaStreamCreate(&gpu_stream_pool[i]));
Expand Down

0 comments on commit 5501f73

Please sign in to comment.