diff --git a/projects/hip/cmake/FindHIP.cmake b/projects/hip/cmake/FindHIP.cmake
index b59cb3ac37..4578ee0701 100644
--- a/projects/hip/cmake/FindHIP.cmake
+++ b/projects/hip/cmake/FindHIP.cmake
@@ -382,19 +382,31 @@ macro(HIP_GET_SOURCES_AND_OPTIONS _sources _cmake_options _hipcc_options _clang_
set(${_clang_options})
set(${_nvcc_options})
set(_hipcc_found_options FALSE)
+ set(_hcc_found_options FALSE)
set(_clang_found_options FALSE)
set(_nvcc_found_options FALSE)
foreach(arg ${ARGN})
if("x${arg}" STREQUAL "xHIPCC_OPTIONS")
set(_hipcc_found_options TRUE)
+ set(_hcc_found_options FALSE)
+ set(_clang_found_options FALSE)
+ set(_nvcc_found_options FALSE)
+ elseif("x${arg}" STREQUAL "xHCC_OPTIONS")
+ # To be removed after HCC_OPTIONS is removed from hip_add_executable()
+ # via upstream updation
+ message(WARNING, "Please remove obsolete HCC_OPTIONS from hip_add_executable()")
+ set(_hipcc_found_options FALSE)
+ set(_hcc_found_options TRUE)
set(_clang_found_options FALSE)
set(_nvcc_found_options FALSE)
elseif("x${arg}" STREQUAL "xCLANG_OPTIONS")
set(_hipcc_found_options FALSE)
+ set(_hcc_found_options FALSE)
set(_clang_found_options TRUE)
set(_nvcc_found_options FALSE)
elseif("x${arg}" STREQUAL "xNVCC_OPTIONS")
set(_hipcc_found_options FALSE)
+ set(_hcc_found_options FALSE)
set(_clang_found_options FALSE)
set(_nvcc_found_options TRUE)
elseif(
@@ -407,6 +419,8 @@ macro(HIP_GET_SOURCES_AND_OPTIONS _sources _cmake_options _hipcc_options _clang_
else()
if(_hipcc_found_options)
list(APPEND ${_hipcc_options} ${arg})
+ elseif(_hcc_found_options)
+ message(WARNING, "Please remove obsolete HCC_OPTIONS ${arg} from hip_add_executable()")
elseif(_clang_found_options)
list(APPEND ${_clang_options} ${arg})
elseif(_nvcc_found_options)
diff --git a/projects/hip/docs/reference/kernel_language.md b/projects/hip/docs/reference/kernel_language.md
index 5d41ebffba..64b82792fa 100644
--- a/projects/hip/docs/reference/kernel_language.md
+++ b/projects/hip/docs/reference/kernel_language.md
@@ -418,7 +418,7 @@ Following is the list of supported floating-point intrinsics. Note that intrinsi
| double __dsqrt_rn ( double x )
Compute `√x` in round-to-nearest-even mode. |
## Texture Functions
-The supported Texture functions are listed in header files "texture_fetch_functions.h"(https://github.com/ROCm-Developer-Tools/HIP/blob/main/include/hip/amd_detail/texture_fetch_functions.h) and"texture_indirect_functions.h" (https://github.com/ROCm-Developer-Tools/HIP/blob/main/include/hip/amd_detail/texture_indirect_functions.h).
+The supported Texture functions are listed in header files "texture_fetch_functions.h"(https://github.com/ROCm-Developer-Tools/HIP/blob/main/include/hip/hcc_detail/texture_fetch_functions.h) and"texture_indirect_functions.h" (https://github.com/ROCm-Developer-Tools/HIP/blob/main/include/hip/hcc_detail/texture_indirect_functions.h).
Texture functions are not supported on some devices.
Macro __HIP_NO_IMAGE_SUPPORT == 1 can be used to check whether texture functions are not supported in device code.
diff --git a/projects/hip/include/hip/channel_descriptor.h b/projects/hip/include/hip/channel_descriptor.h
index d8b7d7d796..8fa71970a7 100644
--- a/projects/hip/include/hip/channel_descriptor.h
+++ b/projects/hip/include/hip/channel_descriptor.h
@@ -28,9 +28,9 @@ THE SOFTWARE.
// on NVCC path:
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/device_functions.h b/projects/hip/include/hip/device_functions.h
index 9a86171e45..8388a5c24b 100644
--- a/projects/hip/include/hip/device_functions.h
+++ b/projects/hip/include/hip/device_functions.h
@@ -27,9 +27,9 @@ THE SOFTWARE.
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/driver_types.h b/projects/hip/include/hip/driver_types.h
index 9580763dfa..1720fa3ab3 100644
--- a/projects/hip/include/hip/driver_types.h
+++ b/projects/hip/include/hip/driver_types.h
@@ -27,10 +27,13 @@ THE SOFTWARE.
#include
#endif
-#if !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "driver_types.h"
-#elif defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#elif (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
+// The follow macro should be removed after upstream updation.
+// It's defined here for workarround of rocThrust building failure.
+#define HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H
#if !defined(__HIPCC_RTC__)
#ifndef __cplusplus
#include
diff --git a/projects/hip/include/hip/hip_bf16.h b/projects/hip/include/hip/hip_bf16.h
index 20947b2e25..09da636047 100644
--- a/projects/hip/include/hip/hip_bf16.h
+++ b/projects/hip/include/hip/hip_bf16.h
@@ -25,9 +25,11 @@ THE SOFTWARE.
#include
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_bfloat16.h b/projects/hip/include/hip/hip_bfloat16.h
index 988f793ebc..dcd8c61442 100644
--- a/projects/hip/include/hip/hip_bfloat16.h
+++ b/projects/hip/include/hip/hip_bfloat16.h
@@ -33,9 +33,11 @@
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#warning "hip_bfloat16.h is not supported on nvidia platform"
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_common.h b/projects/hip/include/hip/hip_common.h
index a1e000d8ce..f0a8f2ccac 100644
--- a/projects/hip/include/hip/hip_common.h
+++ b/projects/hip/include/hip/hip_common.h
@@ -31,6 +31,11 @@ THE SOFTWARE.
// Auto enable __HIP_PLATFORM_AMD__ if compiling on AMD platform
// Other compiler (GCC,ICC,etc) need to set one of these macros explicitly
#if defined(__clang__) && defined(__HIP__)
+// The following macro will be removed after upstream updation
+#ifndef __HIP_PLATFORM_HCC__
+#define __HIP_PLATFORM_HCC__
+#endif
+
#ifndef __HIP_PLATFORM_AMD__
#define __HIP_PLATFORM_AMD__
#endif
@@ -38,6 +43,11 @@ THE SOFTWARE.
// Auto enable __HIP_PLATFORM_NVIDIA__ if compiling with NVIDIA platform
#if defined(__NVCC__) || (defined(__clang__) && defined(__CUDA__) && !defined(__HIP__))
+// The following macro will be removed after upstream updation
+#ifndef __HIP_PLATFORM_NVCC__
+#define __HIP_PLATFORM_NVCC__
+#endif
+
#ifndef __HIP_PLATFORM_NVIDIA__
#define __HIP_PLATFORM_NVIDIA__
#endif
diff --git a/projects/hip/include/hip/hip_complex.h b/projects/hip/include/hip/hip_complex.h
index a8d1b6ee61..0e70f245d5 100644
--- a/projects/hip/include/hip/hip_complex.h
+++ b/projects/hip/include/hip/hip_complex.h
@@ -27,9 +27,9 @@ THE SOFTWARE.
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_cooperative_groups.h b/projects/hip/include/hip/hip_cooperative_groups.h
index 4baff68120..b43c7ca19a 100644
--- a/projects/hip/include/hip/hip_cooperative_groups.h
+++ b/projects/hip/include/hip/hip_cooperative_groups.h
@@ -33,11 +33,11 @@ THE SOFTWARE.
#include
#include
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#if __cplusplus && defined(__clang__) && defined(__HIP__)
#include
#endif
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_fp16.h b/projects/hip/include/hip/hip_fp16.h
index 67def4ee1a..8be8623b39 100644
--- a/projects/hip/include/hip/hip_fp16.h
+++ b/projects/hip/include/hip/hip_fp16.h
@@ -25,9 +25,9 @@ THE SOFTWARE.
#include
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "cuda_fp16.h"
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_gl_interop.h b/projects/hip/include/hip/hip_gl_interop.h
index 8af6ec32d1..ed1f72c789 100644
--- a/projects/hip/include/hip/hip_gl_interop.h
+++ b/projects/hip/include/hip/hip_gl_interop.h
@@ -23,10 +23,9 @@ THE SOFTWARE.
#define HIP_GL_INTEROP_H
#include
-
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "hip/amd_detail/amd_hip_gl_interop.h"
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "hip/nvidia_detail/nvidia_hip_gl_interop.h"
#endif
-#endif
+#endif
\ No newline at end of file
diff --git a/projects/hip/include/hip/hip_math_constants.h b/projects/hip/include/hip/hip_math_constants.h
index 4cce93c0fc..97684b8786 100644
--- a/projects/hip/include/hip/hip_math_constants.h
+++ b/projects/hip/include/hip/hip_math_constants.h
@@ -26,9 +26,9 @@ THE SOFTWARE.
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__))
#include "hip/amd_detail/amd_hip_math_constants.h"
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "hip/nvidia_detail/nvidia_hip_math_constants.h"
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_runtime.h b/projects/hip/include/hip/hip_runtime.h
index 20dd9703df..e6164f7a9a 100644
--- a/projects/hip/include/hip/hip_runtime.h
+++ b/projects/hip/include/hip/hip_runtime.h
@@ -58,14 +58,57 @@ THE SOFTWARE.
#include
#include
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
#endif
+// The following are deprecation notices.
+// They will be removed after upstream updation
+#if 0 // Temporarily disable deprecation warning as it will fail rocgdb test
+#if defined(__clang__)
+//The following work for clang rather than for gnu gcc/g++/c++
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wcpp"
+#ifdef __HCC__
+#warning("__HCC__ is deprecated, please don't use it")
+#endif
+
+#ifdef __HIP_ROCclr__
+#warning("__HIP_ROCclr__ is deprecated, please don't use it")
+#endif
+
+#ifdef __HIP_PLATFORM_HCC__
+#warning("__HIP_PLATFORM_HCC__ is deprecated, please use __HIP_PLATFORM_AMD__ instead")
+#endif
+
+#ifdef __HIP_PLATFORM_NVCC_
+#warning("__HIP_PLATFORM_NVCC_ is deprecated, please use __HIP_PLATFORM_NVIDIA__ instead")
+#endif
+#pragma GCC diagnostic pop
+#elif defined(__GNUC__)
+//The following work for gnu gcc/g++/c++ rather than for clang
+#ifdef __HCC__
+#pragma message ("__HCC__ is deprecated, please don't use it")
+#endif
+
+#ifdef __HIP_ROCclr__
+#pragma message ("__HIP_ROCclr__ is deprecated, please don't use it")
+#endif
+
+#ifdef __HIP_PLATFORM_HCC__
+#pragma message ("__HIP_PLATFORM_HCC__ is deprecated, please use __HIP_PLATFORM_AMD__ instead")
+#endif
+
+#ifdef __HIP_PLATFORM_NVCC_
+#pragma message ("__HIP_PLATFORM_NVCC_ is deprecated, please use __HIP_PLATFORM_NVIDIA__ instead")
+#endif
+#endif // defined(__clang__)
+#endif
+
#if !defined(__HIPCC_RTC__)
#include
#include
diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h
index 33888b1d70..d43526bf37 100644
--- a/projects/hip/include/hip/hip_runtime_api.h
+++ b/projects/hip/include/hip/hip_runtime_api.h
@@ -473,7 +473,7 @@ enum hipComputeMode {
hipComputeModeExclusiveProcess = 3
};
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#include
@@ -8586,7 +8586,7 @@ static inline hipError_t hipMallocFromPoolAsync(
#endif
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "hip/nvidia_detail/nvidia_hip_runtime_api.h"
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hip_vector_types.h b/projects/hip/include/hip/hip_vector_types.h
index cea4e92cd6..cfb23078a3 100644
--- a/projects/hip/include/hip/hip_vector_types.h
+++ b/projects/hip/include/hip/hip_vector_types.h
@@ -28,11 +28,11 @@ THE SOFTWARE.
#include
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#if __cplusplus
#include
#endif
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/hiprtc.h b/projects/hip/include/hip/hiprtc.h
index 48efc501ce..6f764bfa4a 100644
--- a/projects/hip/include/hip/hiprtc.h
+++ b/projects/hip/include/hip/hiprtc.h
@@ -23,9 +23,12 @@ THE SOFTWARE.
#include
-#if !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#elif (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && \
+ !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
+
#ifdef __cplusplus
extern "C" {
diff --git a/projects/hip/include/hip/library_types.h b/projects/hip/include/hip/library_types.h
index 8a453a8a6d..6251b7f2ce 100644
--- a/projects/hip/include/hip/library_types.h
+++ b/projects/hip/include/hip/library_types.h
@@ -27,7 +27,7 @@ THE SOFTWARE.
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
typedef enum hipDataType {
HIP_R_32F = 0,
@@ -66,7 +66,7 @@ typedef enum hipLibraryPropertyType {
HIP_LIBRARY_PATCH_LEVEL
} hipLibraryPropertyType;
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "library_types.h"
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/math_functions.h b/projects/hip/include/hip/math_functions.h
index 967fdb47aa..3216e24317 100644
--- a/projects/hip/include/hip/math_functions.h
+++ b/projects/hip/include/hip/math_functions.h
@@ -31,9 +31,9 @@ THE SOFTWARE.
#include
#endif
-#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include
-#elif !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
//#include
#else
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
diff --git a/projects/hip/include/hip/texture_types.h b/projects/hip/include/hip/texture_types.h
index 3473c81886..63ae301811 100644
--- a/projects/hip/include/hip/texture_types.h
+++ b/projects/hip/include/hip/texture_types.h
@@ -34,9 +34,9 @@ THE SOFTWARE.
#include
#endif
-#if !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
+#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
#include "texture_types.h"
-#elif defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
+#elif (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
/*******************************************************************************
* *
* *