From dcc99ba5c66d3e03525405c2c6a019f2eeff8115 Mon Sep 17 00:00:00 2001 From: Yaxun Sam Liu Date: Fri, 17 Aug 2018 11:34:45 -0400 Subject: [PATCH] Fix build failure of hipTestHalf and hipTestIncludeMath for hip-clang [ROCm/hip commit: cf184460e9ee38fee4ea918737a10c57ce9b8639] --- projects/hip/include/hip/hcc_detail/device_functions.h | 5 +++-- projects/hip/include/hip/hcc_detail/hip_runtime.h | 2 +- projects/hip/include/hip/hcc_detail/math_functions.h | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/device_functions.h b/projects/hip/include/hip/hcc_detail/device_functions.h index b60a38aeea..b319f26e03 100644 --- a/projects/hip/include/hip/hcc_detail/device_functions.h +++ b/projects/hip/include/hip/hcc_detail/device_functions.h @@ -27,11 +27,12 @@ THE SOFTWARE. #include "math_fwd.h" #include +#include + + #include #include #include -#include - /* Integer Intrinsics */ diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime.h b/projects/hip/include/hip/hcc_detail/hip_runtime.h index d8093e6646..d4207c56fe 100644 --- a/projects/hip/include/hip/hcc_detail/hip_runtime.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime.h @@ -131,7 +131,7 @@ extern int HIP_TRACE_API; // Feature tests: -#if defined(__HCC_ACCELERATOR__) && (__HCC_ACCELERATOR__ != 0) +#if (defined(__HCC_ACCELERATOR__) && (__HCC_ACCELERATOR__ != 0)) || __HIP_DEVICE_COMPILE__ // Device compile and not host compile: // 32-bit Atomics: diff --git a/projects/hip/include/hip/hcc_detail/math_functions.h b/projects/hip/include/hip/hcc_detail/math_functions.h index 6c8510fcbb..702c120b86 100644 --- a/projects/hip/include/hip/hcc_detail/math_functions.h +++ b/projects/hip/include/hip/hcc_detail/math_functions.h @@ -22,14 +22,16 @@ THE SOFTWARE. #pragma once -#include "math_fwd.h" - -#include - #include #include #include #include +#include + +#include + +#include "hip_fp16_math_fwd.h" +#include "math_fwd.h" // HCC's own math functions should be included first, otherwise there will // be conflicts when hip/math_functions.h is included before hip/hip_runtime.h.