Fix HIP_PATH, CHECK macro in samples.

This commit is contained in:
Ben Sander
2016-04-13 17:37:39 -05:00
parent 8736d77818
commit 830527bfdc
4 changed files with 16 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#Dependencies : [MYHIP]/bin must be in user's path.
HIP_PATH=?../../..
HIP_PATH?=../../..
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform)
HIPCC=$(HIP_PATH)/bin/hipcc
@@ -24,11 +24,14 @@ THE SOFTWARE.
#include <hip_runtime.h>
#define CHECK(error) \
#define CHECK(cmd) \
{\
hipError_t error = cmd;\
if (error != hipSuccess) { \
fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error,__FILE__, __LINE__); \
exit(EXIT_FAILURE);\
}
}\
}
void __global__
bit_extract_kernel(hipLaunchParm lp, uint32_t *C_d, const uint32_t *A_d, size_t N)
+5 -2
View File
@@ -22,11 +22,14 @@ THE SOFTWARE.
#include <stdio.h>
#include <cuda_runtime.h>
#define CHECK(error) \
#define CHECK(cmd) \
{\
hipError_t error = cmd;\
if (error != cudaSuccess) { \
fprintf(stderr, "error: '%s'(%d) at %s:%d\n", cudaGetErrorString(error), error,__FILE__, __LINE__); \
exit(EXIT_FAILURE);\
}
}\
}
/*
@@ -22,11 +22,14 @@ THE SOFTWARE.
#include <stdio.h>
#include <hip_runtime.h>
#define CHECK(error) \
#define CHECK(cmd) \
{\
hipError_t error = cmd;\
if (error != hipSuccess) { \
fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error,__FILE__, __LINE__); \
exit(EXIT_FAILURE);\
}
}\
}
/*