From ac4b7e3f91241f2ca9268771e0c3bb67f7049628 Mon Sep 17 00:00:00 2001 From: pensun Date: Tue, 28 Feb 2017 07:33:01 -0600 Subject: [PATCH] update hip_porting_guide regarding platform depended macros Change-Id: I3029c6ae6cb280500bba294925ed6e9dc9dcc94d --- docs/markdown/hip_porting_guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/markdown/hip_porting_guide.md b/docs/markdown/hip_porting_guide.md index e34bed0cbc..0acdc246f9 100644 --- a/docs/markdown/hip_porting_guide.md +++ b/docs/markdown/hip_porting_guide.md @@ -166,7 +166,7 @@ Both nvcc and hcc make two passes over the code: one for host code and one for d ``` // #ifdef __CUDA_ARCH__ -#ifdef __HIP_DEVICE_COMPILE__ +#ifdef __HIP_DEVICE_COMPILE__ && (__HIP_DEVICE_COMPILE__ == 1) ``` Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 0 or 1, and it doesn’t represent the feature capability of the target device. @@ -182,7 +182,7 @@ Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 0 or 1, and it doe |`__HIPCC__` | Defined | Defined | Undefined |`__HIP_ARCH_*` | 0 or 1 depending on feature support (see below) | 0 or 1 depending on feature support (see below) | 0 |nvcc-related defines:| -|`__CUDACC__` | Undefined | Defined if compiling for Cuda device; undefined otherwise | Undefined +|`__CUDACC__` | Undefined | Defined if source code is compiled by nvcc; undefined otherwise | Undefined |`__NVCC__` | Undefined | Defined | Undefined |`__CUDA_ARCH__` | Undefined | Unsigned representing compute capability (e.g., "130") if in device code; 0 if in host code | Undefined |hcc-related defines:|