Skip to content
Merged
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
2 changes: 2 additions & 0 deletions benchmark/benchmark.cu
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,12 @@ int main(int argc, char** argv) {
// Note: excluding scaling from timing
#ifdef R2C
scale<<<(pinfo_x_r.size + 1024 - 1) / 1024, 1024>>>(output_r, 1.0 / fftsize, pinfo_x_r);
CHECK_CUDA_LAUNCH_EXIT();
if (out_of_place) std::swap(input, output);
if (out_of_place) std::swap(input_r, output_r);
#else
scale<<<(pinfo_x_c.size + 1024 - 1) / 1024, 1024>>>(output, 1.0 / fftsize, pinfo_x_c);
CHECK_CUDA_LAUNCH_EXIT();
if (out_of_place) std::swap(input, output);
#endif

Expand Down
10 changes: 10 additions & 0 deletions examples/cc/basic_usage/basic_usage.cu
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
} \
} while (false)

#define CHECK_CUDA_LAUNCH_EXIT() \
do { \
cudaError_t err = cudaGetLastError(); \
if (cudaSuccess != err) { \
fprintf(stderr, "%s:%d CUDA error. (%s)\n", __FILE__, __LINE__, cudaGetErrorString(err)); \
exit(EXIT_FAILURE); \
} \
} while (false)

#define CHECK_MPI_EXIT(call) \
{ \
int err = call; \
Expand Down Expand Up @@ -223,6 +232,7 @@ int main(int argc, char** argv) {
int threads_per_block = 256;
int nblocks = (pinfo_x.size + threads_per_block - 1) / threads_per_block;
initialize_pencil<<<nblocks, threads_per_block>>>(data_d, pinfo_x);
CHECK_CUDA_LAUNCH_EXIT();

// Allocating cuDecomp workspace

Expand Down
10 changes: 10 additions & 0 deletions examples/cc/basic_usage/basic_usage_autotune.cu
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
} \
} while (false)

#define CHECK_CUDA_LAUNCH_EXIT() \
do { \
cudaError_t err = cudaGetLastError(); \
if (cudaSuccess != err) { \
fprintf(stderr, "%s:%d CUDA error. (%s)\n", __FILE__, __LINE__, cudaGetErrorString(err)); \
exit(EXIT_FAILURE); \
} \
} while (false)

#define CHECK_MPI_EXIT(call) \
{ \
int err = call; \
Expand Down Expand Up @@ -207,6 +216,7 @@ int main(int argc, char** argv) {
int threads_per_block = 256;
int nblocks = (pinfo_x.size + threads_per_block - 1) / threads_per_block;
initialize_pencil<<<nblocks, threads_per_block>>>(data_d, pinfo_x);
CHECK_CUDA_LAUNCH_EXIT();

// Allocating cuDecomp workspace

Expand Down
Loading