Skip to content

Commit

Permalink
fix missing GPUCHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Jun 19, 2024
1 parent 7657753 commit e8414f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/fee/gpu/fee.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,9 @@ extern "C" const char *gpu_fee_calc_jones(const FLOAT *d_azs, const FLOAT *d_zas

gpuError_t error_id;
#ifdef DEBUG
error_id = gpuDeviceSynchronize();
if (error_id != gpuSuccess) {
return gpuGetErrorString(error_id);
}
GPUCHECK(gpuDeviceSynchronize());
#endif
error_id = gpuGetLastError();
if (error_id != gpuSuccess) {
return gpuGetErrorString(error_id);
}
GPUCHECK(gpuGetLastError());

// Free device memory
GPUCHECK(gpuFree(d_legendret));
Expand Down
14 changes: 14 additions & 0 deletions src/gpu_common/gpu_common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>


#ifdef SINGLE
#define FLOAT float
Expand Down Expand Up @@ -214,6 +216,18 @@ inline static __device__ FLOAT get_parallactic_angle(HADec hadec, FLOAT latitude

#endif // BINDGEN

#define GPUCHECK(error) \
{ \
gpuError_t localError = error; \
if ((localError != gpuSuccess)) \
{ \
const char *errorString = gpuGetErrorString(localError); \
printf("error: '%s'(%d) from %s at %s:%d\n", errorString, \
localError, #error, __FILE__, __LINE__); \
return errorString; \
} \
}

/*----------------------------------------------------------------------
**
**
Expand Down

0 comments on commit e8414f3

Please sign in to comment.