Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cuFFT/1d_mgpu_c2c/1d_mgpu_c2c_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ void spmg(dim_t fft, int &batch_size, gpus_t gpus, cpudata_t &h_data_in, cpudata
// Execute the plan
CUFFT_CALL(cufftXtExecDescriptor(plan, indesc, indesc, CUFFT_FORWARD));

#if CUFFT_VERSION >= 10400
// The transform runs on the plan's stream; wait for it before reading back
CUDA_RT_CALL(cudaStreamSynchronize(stream));
#endif

// Copy output data to CPU
CUFFT_CALL(cufftXtMemcpy(plan, reinterpret_cast<void *>(h_data_out.data()),
reinterpret_cast<void *>(indesc), CUFFT_COPY_DEVICE_TO_HOST));
Expand Down
5 changes: 5 additions & 0 deletions cuFFT/3d_mgpu_c2c/3d_mgpu_c2c_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ void spmg(dim_t fft, gpus_t gpus, cpudata_t &h_data_in, cpudata_t &h_data_out,
// Execute the plan
CUFFT_CALL(cufftXtExecDescriptor(plan, indesc, indesc, CUFFT_FORWARD));

#if CUFFT_VERSION >= 10400
// The transform runs on the plan's stream; wait for it before reading back
CUDA_RT_CALL(cudaStreamSynchronize(stream));
#endif

// Copy output data to CPU
CUFFT_CALL(cufftXtMemcpy(plan, reinterpret_cast<void *>(h_data_out.data()),
reinterpret_cast<void *>(indesc), CUFFT_COPY_DEVICE_TO_HOST));
Expand Down
10 changes: 10 additions & 0 deletions cuFFT/3d_mgpu_r2c_c2r/3d_mgpu_r2c_c2r_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,23 @@ void spmg(dim_t fft, gpus_t gpus, cpudata_t &h_data_in, cpudata_t &h_data_out,
// Execute the plan_r2c
CUFFT_CALL(cufftXtExecDescriptor(plan_r2c, indesc, indesc, CUFFT_FORWARD));

#if CUFFT_VERSION >= 10400
// The transform runs on the plan's stream; wait for it before reading back
CUDA_RT_CALL(cudaStreamSynchronize(stream));
#endif

// Scale complex results
float scale{2.f};
scaleComplex(indesc, scale, h_data_out.size(), gpus.size());

// Execute the plan_c2r
CUFFT_CALL(cufftXtExecDescriptor(plan_c2r, indesc, indesc, CUFFT_INVERSE));

#if CUFFT_VERSION >= 10400
// The transform runs on the plan's stream; wait for it before reading back
CUDA_RT_CALL(cudaStreamSynchronize(stream));
#endif

// Copy output data to CPU
CUFFT_CALL(cufftXtMemcpy(plan_c2r, (void *)h_data_out.data(), (void *)indesc,
CUFFT_COPY_DEVICE_TO_HOST));
Expand Down