Skip to content

Commit 5dde122

Browse files
blackwerjanden
authored andcommitted
cuda: print warning when using streams without memory pool support
1 parent 162b3c2 commit 5dde122

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/cufinufft/impl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ int cufinufft_makeplan_impl(int type, int dim, int *nmodes, int iflag, int ntran
129129
// for support
130130
cudaDeviceGetAttribute(&d_plan->supports_pools, cudaDevAttrMemoryPoolsSupported,
131131
device_id);
132+
static bool warned = false;
133+
if (!warned && !d_plan->supports_pools && d_plan->opts.gpu_stream != nullptr) {
134+
fprintf(stderr,
135+
"[cufinufft] Warning: cudaMallocAsync not supported on this device. Use of "
136+
"CUDA streams may not perform optimally.\n");
137+
warned = true;
138+
}
132139

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

0 commit comments

Comments
 (0)