Remove hip-hcc codes: Part four

Remove __HCC__, __HCC_ONLY__, __HCC_CPP__, __HCC_C__,
__HCC_OR_HIP_CLANG__, __HIP_ROCclr__ and their guarded codes.

Remove Hcc codes from directed_tests and samples.

Remove __HIP_PLATFORM_HCC__ and __HIP_PLATFORM_NVCC__ from
some files where they are not necessary.

Add deprecation notice.

Change-Id: I1ae467eafd749d6c25bca204c1724b026be21fce
此提交包含在:
Tao Sang authored and Tao Sang committed 2021-01-08 10:53:34 -05:00
1 父節點 d1c921ffca
當前提交 b34dd95124
61 file changed
+151 -1739

No files matched your search

+10 -11
查看文件
@@ -47,17 +47,16 @@ In the above, BUILD commands provide instructions on how to build the test case
The supported syntax for the BUILD command is:
```
BUILD: %t %s HIPCC_OPTIONS <hipcc_specific_options> HCC_OPTIONS <hcc_specific_options> CLANG_OPTIONS <clang_specific_options> NVCC_OPTIONS <nvcc_specific_options> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <hcc|rocclr> EXCLUDE_HIP_COMPILER <hcc|clang> DEPENDS EXCLUDE_HIP_LIB_TYPE <static|shared> <dependencies>
BUILD: %t %s HIPCC_OPTIONS <hipcc_specific_options> CLANG_OPTIONS <clang_specific_options> NVCC_OPTIONS <nvcc_specific_options> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <rocclr> EXCLUDE_HIP_COMPILER <clang> DEPENDS EXCLUDE_HIP_LIB_TYPE <static|shared> <dependencies>
```
%s: refers to current source file name. Additional source files needed for the test can be specified by name (including relative path).
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
HIPCC_OPTIONS: All options specified after this delimiter are passed to hipcc on both amd and nvidia platforms.
HCC_OPTIONS: All options specified after this delimiter are passed to hipcc on hcc compiler only.
CLANG_OPTIONS: All options specified after this delimiter are passed to hipcc on HIP-Clang compiler only.
NVCC_OPTIONS: All options specified after this delimiter are passed to hipcc on nvidia platform only.
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from amd, nvidia or both platforms.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from hcc or rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from clang compiler.
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test case from particular runtime and compiler.
EXCLUDE_HIP_LIB_TYPE: This can be used to exclude a test case from static or shared libs.
DEPENDS: This can be used to specify dependencies that need to be built before building the current target.
@@ -67,7 +66,7 @@ DEPENDS: This can be used to specify dependencies that need to be built before b
The supported syntax for the BUILD_CMD command is:
```
BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <hcc|rocclr> EXCLUDE_HIP_COMPILER <hcc|clang> EXCLUDE_HIP_LIB_TYPE <static|shared> DEPENDS <dependencies>
BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <rocclr> EXCLUDE_HIP_COMPILER <clang> EXCLUDE_HIP_LIB_TYPE <static|shared> DEPENDS <dependencies>
```
%s: refers to current source file name. Additional source files needed for the test can be specified by name (including relative path).
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
@@ -78,8 +77,8 @@ BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EX
%S: refers to path to current source file.
%T: refers to path to current build target.
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from amd, nvidia or both platforms.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from hcc or rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from clang compiler.
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test from particular runtime and compiler.
EXCLUDE_HIP_LIB_TYPE: This can be used to exclude a test case from static or shared libs.
DEPENDS: This can be used to specify dependencies that need to be built before building the current target.
@@ -89,12 +88,12 @@ DEPENDS: This can be used to specify dependencies that need to be built before b
The supported syntax for the TEST command is:
```
TEST: %t <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <hcc|rocclr> EXCLUDE_HIP_COMPILER <hcc|clang> EXCLUDE_HIP_LIB_TYPE <static|shared>
TEST: %t <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <rocclr> EXCLUDE_HIP_COMPILER <clang> EXCLUDE_HIP_LIB_TYPE <static|shared>
```
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from amd, nvidia or both platforms.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from hcc or rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from rocclr runtime.
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from clang compiler.
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test from particular runtime and compiler.
EXCLUDE_HIP_LIB_TYPE: This can be used to exclude a test case from static or shared libs.
@@ -104,7 +103,7 @@ Note that if the test has been excluded for a specific platform/runtime/compiler
When using the TEST command, HIT will squash and append the arguments specified to the test executable name to generate the CMAKE test name. Sometimes we might want to specify a more descriptive name. The TEST_NAMED command is used for that. The supported syntax for the TEST_NAMED command is:
```
TEST: %t CMAKE_TEST_NAME <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <hcc|rocclr> EXCLUDE_HIP_COMPILER <hcc|clang> EXCLUDE_HIP_LIB_TYPE <static|shared>
TEST: %t CMAKE_TEST_NAME <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <amd|nvidia|all> EXCLUDE_HIP_RUNTIME <rocclr> EXCLUDE_HIP_COMPILER <clang> EXCLUDE_HIP_LIB_TYPE <static|shared>
```
+3 -7
查看文件
@@ -11,11 +11,10 @@ message(STATUS "HIP runtime lib type - ${HIP_LIB_TYPE}")
message(STATUS "CMAKE_TESTING_TOOL: ${CMAKE_TESTING_TOOL}")
#-------------------------------------------------------------------------------
# Helper macro to parse BUILD instructions
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends _dir)
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends _dir)
set(${_target})
set(${_sources})
set(${_hipcc_options})
set(${_hcc_options})
set(${_clang_options})
set(${_nvcc_options})
set(${_link_options})
@@ -33,7 +32,6 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_op
set(_target_found TRUE)
set(${_target} ${arg})
elseif("x${arg}" STREQUAL "xHIPCC_OPTIONS"
OR "x${arg}" STREQUAL "xHCC_OPTIONS"
OR "x${arg}" STREQUAL "xCLANG_OPTIONS"
OR "x${arg}" STREQUAL "xNVCC_OPTIONS"
OR "x${arg}" STREQUAL "xLINK_OPTIONS"
@@ -45,8 +43,6 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_op
set(_flag ${arg})
elseif("x${_flag}" STREQUAL "xHIPCC_OPTIONS")
list(APPEND ${_hipcc_options} ${arg})
elseif("x${_flag}" STREQUAL "xHCC_OPTIONS")
list(APPEND ${_hcc_options} ${arg})
elseif("x${_flag}" STREQUAL "xCLANG_OPTIONS")
list(APPEND ${_clang_options} ${arg})
elseif("x${_flag}" STREQUAL "xNVCC_OPTIONS")
@@ -282,7 +278,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_build_command(_target _sources _hipcc_options _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends ${_dir} ${_cmd})
parse_build_command(_target _sources _hipcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends ${_dir} ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms)
insert_into_map("_exclude" "${target}" TRUE)
@@ -297,7 +293,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent)
else()
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_reset_flags()
hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} CLANG_OPTIONS ${_clang_options} NVCC_OPTIONS ${_nvcc_options} EXCLUDE_FROM_ALL)
hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} CLANG_OPTIONS ${_clang_options} NVCC_OPTIONS ${_nvcc_options} EXCLUDE_FROM_ALL)
target_link_libraries(${target} PRIVATE ${_link_options})
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target} RUNTIME_OUTPUT_DIRECTORY ${_label} LINK_DEPENDS "${HIP_LIB_FILES}")
add_dependencies(${_parent} ${target})
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../test_common.cpp HCC_OPTIONS -Xclang -fallow-half-arguments-and-returns CLANG_OPTIONS -Xclang -fallow-half-arguments-and-returns EXCLUDE_HIP_PLATFORM nvidia
* BUILD: %t %s ../test_common.cpp CLANG_OPTIONS -Xclang -fallow-half-arguments-and-returns EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t
* HIT_END
*/
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../test_common.cpp HCC_OPTIONS -Xclang -fallow-half-arguments-and-returns CLANG_OPTIONS -Xclang -fallow-half-arguments-and-returns EXCLUDE_HIP_PLATFORM nvidia
* BUILD: %t %s ../test_common.cpp CLANG_OPTIONS -Xclang -fallow-half-arguments-and-returns EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t
* HIT_END
*/
-3
查看文件
@@ -151,11 +151,8 @@ void test() {
}
int main() {
// ToDo: Fix bug in HCC causing linking error at -O0.
#ifndef __HCC__
test<float>();
test<double>();
#endif
passed();
return 0;
}
+1 -1
查看文件
@@ -32,7 +32,7 @@ THE SOFTWARE.
__global__ void DotFunctions(bool* result) {
#if (__hcc_workweek__ >= 19015) || __HIP_CLANG_ONLY__
#if __HIP_CLANG_ONLY__
// Dot Functions
short2 sa{1}, sb{1};
result[0] = amd_mixed_dot(sa, sb, 1, result[0]) && result[0];
+1 -1
查看文件
@@ -155,7 +155,7 @@ void __half2Test(bool* result, __half2 a) {
result[0] = !(a < a) && result[0];
result[0] = !(a > a) && result[0];
#if (__hcc_workweek__ >= 19015) || __HIP_CLANG_ONLY__
#if __HIP_CLANG_ONLY__
// Dot Functions
result[0] = amd_mixed_dot(a, a, 1, 1) && result[0];
#endif
+1 -1
查看文件
@@ -35,7 +35,7 @@ THE SOFTWARE.
#include "hip/hip_vector_types.h"
#include "test_common.h"
#if (__hcc_workweek__ >= 16164) || defined(__HIP_PLATFORM_NVIDIA__) || defined(__HIP_CLANG_ONLY__)
#if defined(__HIP_PLATFORM_NVIDIA__) || defined(__HIP_CLANG_ONLY__)
#define HIP_ASSERT(x) (assert((x) == hipSuccess))
-10
查看文件
@@ -48,15 +48,5 @@ int main(int argc, char* argv[]) {
CHECK(hipGetDeviceProperties(&props, deviceId));
printf("info: running on device #%d %s\n", deviceId, props.name);
#ifdef __HCC__
hc::accelerator acc;
CHECK(hipHccGetAccelerator(deviceId, &acc));
std::wcout << "device_path=" << acc.get_device_path() << "\n";
hc::accelerator_view* av;
CHECK(hipHccGetAcceleratorView(0 /*nullStream*/, &av));
#endif
passed();
};
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_RUNTIME hcc
* BUILD: %t %s ../test_common.cpp
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+1 -1
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_RUNTIME hcc
* BUILD: %t %s ../test_common.cpp
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
-12
查看文件
@@ -31,10 +31,6 @@ THE SOFTWARE.
#include <test_common.h>
#ifdef __HCC__
#include <hc.hpp>
#endif
// cudaA
// Simple tests for variable type qualifiers:
@@ -89,14 +85,6 @@ __global__ void vectorADD(T __restrict__* A_d, T* B_d, T* C_d, size_t N) {
float fastZ = __sin(x);
#endif
#ifdef __HCC__
int b = threadIdx.x;
int c;
atomicAdd(&c, b);
#endif
__syncthreads();
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+2 -2
查看文件
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia EXCLUDE_HIP_RUNTIME hcc EXCLUDE_HIP_COMPILER hcc
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* HIT_END
*/
+1 -1
查看文件
@@ -39,7 +39,7 @@ void runTest(int width,int height,int depth, hipChannelFormatKind formatKind)
}
}
}
printf("test- sizeof(T) =%d\n", sizeof(T));
printf("test- sizeof(T) =%zu\n", sizeof(T));
hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, formatKind);
hipArray *arr,*arr1;
-12
查看文件
@@ -32,14 +32,6 @@ THE SOFTWARE.
#include "hip/hip_runtime.h"
#include "test_common.h"
#define USE_HCC_MEMTRACKER 0 /* Debug flag to show the memtracker periodically */
#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_ROCclr__)
#include <hc_am.hpp>
#else
#define USE_HCC_MEMTRACKER 0
#endif
int elementSizes[] = {1, 16, 1024, 524288, 16 * 1000 * 1000};
int nSizes = sizeof(elementSizes) / sizeof(int);
@@ -166,10 +158,6 @@ void testMultiGpu(int dev0, int dev1, int numElements, bool hostSync) {
HIPCHECK(hipHostMalloc(&dataHost, sizeElements));
memset(dataHost, 13, sizeElements);
#if USE_HCC_MEMTRACKER
hc::am_memtracker_print(0x0);
#endif
printf(" test: init complete\n");
runTestImpl(true, hostSync, gpu0Stream, gpu1Stream, numElements, dataGpu0_0, dataGpu0_1,
dataGpu1, dataHost, expected);