Add simple device-side assert macro
Currently swallows asserts but will compile.
Este cometimento está contido em:
@@ -77,6 +77,17 @@ extern int HIP_TRACE_API;
|
|||||||
#define __HCC_ACCELERATOR__ __KALMAR_ACCELERATOR__
|
#define __HCC_ACCELERATOR__ __KALMAR_ACCELERATOR__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO-HCC add a dummy implementation of assert, need to replace with a proper kernel exit call.
|
||||||
|
#if __HIP_DEVICE_COMPILE__ == 1
|
||||||
|
#undef assert
|
||||||
|
#define assert(COND) { if (COND) {} }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Feature tests:
|
// Feature tests:
|
||||||
#if defined(__HCC_ACCELERATOR__) && (__HCC_ACCELERATOR__ != 0)
|
#if defined(__HCC_ACCELERATOR__) && (__HCC_ACCELERATOR__ != 0)
|
||||||
// Device compile and not host compile:
|
// Device compile and not host compile:
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ __device__ void integer_intrinsics()
|
|||||||
__umulhi((unsigned int)1, (unsigned int)2);
|
__umulhi((unsigned int)1, (unsigned int)2);
|
||||||
__urhadd((unsigned int)1, (unsigned int)2);
|
__urhadd((unsigned int)1, (unsigned int)2);
|
||||||
__usad((unsigned int)1, (unsigned int)2, 0);
|
__usad((unsigned int)1, (unsigned int)2, 0);
|
||||||
|
|
||||||
|
assert(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
__global__ void compileIntegerIntrinsics(hipLaunchParm lp, int ignored)
|
__global__ void compileIntegerIntrinsics(hipLaunchParm lp, int ignored)
|
||||||
|
|||||||
Criar uma nova questão referindo esta
Bloquear um utilizador