ldgm gpu: Move cuda_check_error macro

nvcc had some problems with gcc 12.1 stl map templates when compiling gpu.cu.
And since ldgm-session-gpu.h which contained the c++ code was only needed for
this one macro, it's probably better to move it to gpu.cuh which is
already included by all files that need it.
This commit is contained in:
Martin Piatka
2022-05-12 08:05:15 +00:00
committed by Martin Pulec
parent 514c9966a4
commit efbf0be226
3 changed files with 13 additions and 13 deletions

View File

@@ -23,7 +23,6 @@
#include <cuda_runtime.h>
//#include "timer-util.h"
#include "gpu.cuh"
#include "ldgm-session-gpu.h"
struct coding_params {
int num_lost;

View File

@@ -1,3 +1,16 @@
#include <stdio.h>
// CUDA check error
#define cuda_check_error(msg) \
{ \
cudaError_t err = cudaGetLastError(); \
if( cudaSuccess != err) { \
fprintf(stderr, "[LDGM GPU] [Error] %s (line %i): %s: %s.\n", \
__FILE__, __LINE__, msg, cudaGetErrorString( err) ); \
exit(-1); \
} \
} \
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -21,23 +21,11 @@
#define LDGM_SESSION_GPU_INC
#include <string.h>
#include <stdio.h>
#include "ldgm-session.h"
#include <map>
#include <queue>
// CUDA check error
#define cuda_check_error(msg) \
{ \
cudaError_t err = cudaGetLastError(); \
if( cudaSuccess != err) { \
fprintf(stderr, "[LDGM GPU] [Error] %s (line %i): %s: %s.\n", \
__FILE__, __LINE__, msg, cudaGetErrorString( err) ); \
exit(-1); \
} \
} \
/*
* =====================================================================================
* Class: LDGM_session_gpu