Files
UltraGrid/ldgm/src/gpu.cuh
Martin Piatka eebb138626 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.
2022-05-12 10:13:28 +02:00

36 lines
975 B
Plaintext

#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
#if defined _MSC_VER || defined __MINGW32__
#ifdef EXPORT_DLL_SYMBOLS
#define CUDA_DLL_API __declspec(dllexport)
#else
#define CUDA_DLL_API __declspec(dllimport)
#endif
#else // other platforms
#define CUDA_DLL_API
#endif
CUDA_DLL_API void gpu_encode_upgrade (char* source_data,int *OUTBUF, int * PCM,int param_k,int param_m,int w_f,int packet_size ,int buf_size);
CUDA_DLL_API void gpu_decode_upgrade(char *data, int * PCM,int* SYNC_VEC,int* ERROR_VEC, int not_done, int *frame_size,int *, int*,int M,int K,int w_f,int buf_size,int packet_size);
#ifdef __cplusplus
}
#endif