Skip to content
Snippets Groups Projects
cuda_macro.h 574 B
Newer Older
/*
 * cuda_macro.h
 *
 *  Created on: Aug 17, 2014
 *      Author: Pietro Incardona
 */

#include <iostream>

Pietro Incardona's avatar
Pietro Incardona committed
#if defined(__HIP__)

#define CUDA_SAFE_CALL(call) {\
	hipError_t err = call;\
	if (hipSuccess != err) {\
		std::cerr << "HIP error in file "<< __FILE__ << " in line " << __LINE__ <<  ": " << hipGetErrorString(err);\
	}\
}

#elif defined(CUDA_GPU)

#define CUDA_SAFE_CALL(call) {\
	cudaError_t err = call;\
	if (cudaSuccess != err) {\
		std::cerr << "Cuda error in file "<< __FILE__ << " in line " << __LINE__ <<  ": " << cudaGetErrorString(err);\
	}\
}

Pietro Incardona's avatar
Pietro Incardona committed
#endif