Remove hip-hcc codes: Part three

1.Rename include/hip/hcc_detail/ as include/hip/amd_detail/

2.Rename include/hip/nvcc_detail/ as include/hip/nvidia_detail/

3.Create __HIP_PLATFORM_AMD__ to replace __HIP_PLATFORM_HCC__

4.Create __HIP_PLATFORM_NVIDIA__ to replace __HIP_PLATFORM_NVCC__

After hcc_detail, nvcc_detail, __HIP_PLATFORM_HCC__ and __HIP_PLATFORM_NVCC__
have been removed from upstream, they will be removed from hip runtime.

Change-Id: I1ae457effd739d6c25bca203c1724b026be21fce
Этот коммит содержится в:
Tao Sang
2020-12-15 17:38:08 -05:00
коммит произвёл Tao Sang
родитель f692064d10
Коммит c2adc70d4d
159 изменённых файлов: 411 добавлений и 4485 удалений
+2 -2
Просмотреть файл
@@ -836,7 +836,7 @@ INPUT = $(HIP_PATH)/docs/doxygen-input/mainpage.txt \
$(HIP_PATH)/INSTALL.md \
$(HIP_PATH)/docs/markdown \
$(HIP_PATH)/include/hip \
$(HIP_PATH)/include/hip/hcc_detail/ \
$(HIP_PATH)/include/hip/amd_detail/ \
$(HIP_PATH)/src/
# This tag can be used to specify the character encoding of the source files
@@ -2170,7 +2170,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = __HCC__ __HIP_PLATFORM_HCC__
PREDEFINED = __HCC__ __HIP_PLATFORM_HCC__ __HIP_PLATFORM_AMD__
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
+1 -1
Просмотреть файл
@@ -456,7 +456,7 @@ __ushort_as_half
# The dictionary is to place description of each device function. Expand it to all the device functions
deviceFuncDesc = {'acosf': "This function returns floating point of arc cosine from a floating point input"}
fnames = ["../../include/hip/hcc_detail/math_functions.h","../../include/hip/hcc_detail/device_functions.h","../../include/hip/hcc_detail/hip_fp16.h"]
fnames = ["../../include/hip/amd_detail/math_functions.h","../../include/hip/amd_detail/device_functions.h","../../include/hip/amd_detail/hip_fp16.h"]
markdownFileName = "./hip-math-api.md"
preamble = "# HIP MATH APIs Documentation \n"+\
+1 -1
Просмотреть файл
@@ -209,7 +209,7 @@ hipErrorToCudaError
hipCUDAErrorTohipError
hipCUResultTohipError
If platform portability is important, use #ifdef __HIP_PLATFORM_NVCC__ to guard the CUDA-specific code.
If platform portability is important, use #ifdef __HIP_PLATFORM_NVIDIA__ to guard the CUDA-specific code.
### How do I trace HIP application flow?
See the [HIP Logging](hip_logging.md) for more information.
+5 -5
Просмотреть файл
@@ -178,11 +178,11 @@ The below sample shows how to use `hipModuleGetFunction`.
#define LEN 64
#define SIZE LEN<<2
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define fileName "vcpy_isa.co"
#endif
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
#define fileName "vcpy_isa.ptx"
#endif
@@ -201,7 +201,7 @@ int main(){
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipInit(0);
hipDevice_t device;
hipCtx_t context;
@@ -238,7 +238,7 @@ int main(){
std::cout<<A[i]<<" - "<<B[i]<<std::endl;
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtxDetach(context);
#endif
@@ -248,7 +248,7 @@ int main(){
## HIP Module and Texture Driver API
HIP supports texture driver APIs however texture reference should be declared in host scope. Following code explains the use of texture reference for __HIP_PLATFORM_HCC__ platform.
HIP supports texture driver APIs however texture reference should be declared in host scope. Following code explains the use of texture reference for __HIP_PLATFORM_AMD__ platform.
```
// Code to generate code object
+6 -6
Просмотреть файл
@@ -155,7 +155,7 @@ All HIP projects target either AMD or NVIDIA platform. The platform affects whic
Often, it's useful to know whether the underlying compiler is HIP-Clang or nvcc. This knowledge can guard platform-specific code or aid in platform-specific performance tuning.
```
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
// Compiled with HIP-Clang
#endif
```
@@ -194,8 +194,8 @@ Unlike `__CUDA_ARCH__`, the `__HIP_DEVICE_COMPILE__` value is 1 or undefined, an
|Define | HIP-Clang | nvcc | Other (GCC, ICC, Clang, etc.)
|--- | --- | --- |---|
|HIP-related defines:|
|`__HIP_PLATFORM_HCC__`| Defined | Undefined | Defined if targeting AMD platform; undefined otherwise |
|`__HIP_PLATFORM_NVCC__`| Undefined | Defined | Defined if targeting nvcc platform; undefined otherwise |
|`__HIP_PLATFORM_AMD__`| Defined | Undefined | Defined if targeting AMD platform; undefined otherwise |
|`__HIP_PLATFORM_NVIDIA__`| Undefined | Defined | Defined if targeting NVIDIA platform; undefined otherwise |
|`__HIP_DEVICE_COMPILE__` | 1 if compiling for device; undefined if compiling for host |1 if compiling for device; undefined if compiling for host | Undefined
|`__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
@@ -393,10 +393,10 @@ The hip_runtime.h and hip_runtime_api.h files define the types, functions and en
CUDA has slightly different contents for these two files. In some cases you may need to convert hipified code to include the richer hip_runtime.h instead of hip_runtime_api.h.
### Using a Standard C++ Compiler
You can compile hip\_runtime\_api.h using a standard C or C++ compiler (e.g., gcc or ICC). The HIP include paths and defines (`__HIP_PLATFORM_HCC__` or `__HIP_PLATFORM_NVCC__`) must pass to the standard compiler; hipconfig then returns the necessary options:
You can compile hip\_runtime\_api.h using a standard C or C++ compiler (e.g., gcc or ICC). The HIP include paths and defines (`__HIP_PLATFORM_AMD__` or `__HIP_PLATFORM_NVIDIA__`) must pass to the standard compiler; hipconfig then returns the necessary options:
```
> hipconfig --cxx_config
-D__HIP_PLATFORM_HCC__ -I/home/user1/hip/include
-D__HIP_PLATFORM_AMD__ -I/home/user1/hip/include
```
You can capture the hipconfig output and passed it to the standard compiler; below is a sample makefile syntax:
@@ -577,7 +577,7 @@ To see the detailed commands that hipcc issues, set the environment variable HIP
export HIPCC_VERBOSE=1
make
...
hipcc-cmd: /opt/hcc/bin/hcc -hc -I/opt/hcc/include -stdlib=libc++ -I../../../../hc/include -I../../../../include/hcc_detail/cuda -I../../../../include -x c++ -I../../common -O3 -c backprop_cuda.cu
hipcc-cmd: /opt/hcc/bin/hcc -hc -I/opt/hcc/include -stdlib=libc++ -I../../../../hc/include -I../../../../include/amd_detail/cuda -I../../../../include -x c++ -I../../common -O3 -c backprop_cuda.cu
```
### What Does This Error Mean?