Skip to content

Commit

Permalink
cuda: print warning when using streams without memory pool support
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwer authored and janden committed Jun 27, 2024
1 parent 162b3c2 commit 5dde122
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/cufinufft/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ int cufinufft_makeplan_impl(int type, int dim, int *nmodes, int iflag, int ntran
// for support
cudaDeviceGetAttribute(&d_plan->supports_pools, cudaDevAttrMemoryPoolsSupported,
device_id);
static bool warned = false;
if (!warned && !d_plan->supports_pools && d_plan->opts.gpu_stream != nullptr) {
fprintf(stderr,
"[cufinufft] Warning: cudaMallocAsync not supported on this device. Use of "
"CUDA streams may not perform optimally.\n");
warned = true;
}

auto &stream = d_plan->stream = (cudaStream_t)d_plan->opts.gpu_stream;

Expand Down

0 comments on commit 5dde122

Please sign in to comment.