diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake index 5840181a8e..b4a5cb239e 100644 --- a/cmake/FindHIP.cmake +++ b/cmake/FindHIP.cmake @@ -11,7 +11,6 @@ set(HIP_HCC_FLAGS "" CACHE STRING "Semicolon delimited flags for HCC") set(HIP_CLANG_FLAGS "" CACHE STRING "Semicolon delimited flags for CLANG") set(HIP_NVCC_FLAGS "" CACHE STRING "Semicolon delimted flags for NVCC") mark_as_advanced(HIP_HIPCC_FLAGS HIP_HCC_FLAGS HIP_CLANG_FLAGS HIP_NVCC_FLAGS) - set(_hip_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) list(REMOVE_DUPLICATES _hip_configuration_types) foreach(config ${_hip_configuration_types}) @@ -222,7 +221,7 @@ elseif("${HIP_COMPILER}" STREQUAL "clang") endif() if(HIP_CLANG_NUM_PARALLEL_JOBS GREATER 1) if(${HIP_CLANG_SUPPORTS_PARALLEL_JOBS}) - set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "-Wno-format-nonliteral -parallel-jobs=${HIP_CLANG_NUM_PARALLEL_JOBS}") + set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "-parallel-jobs=${HIP_CLANG_NUM_PARALLEL_JOBS} -Wno-format-nonliteral") set(HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS "-parallel-jobs=${HIP_CLANG_NUM_PARALLEL_JOBS}") else() message("clang compiler doesn't support parallel jobs") @@ -233,22 +232,6 @@ elseif("${HIP_COMPILER}" STREQUAL "clang") set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o -shared" ) set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") - - if("${HIP_RUNTIME}" STREQUAL "ROCclr") - if(TARGET host) - message(STATUS "host interface - found") - set(HIP_HOST_INTERFACE host) - else() - # Find hip - find_package(hip) - if(TARGET hip::host) - message(STATUS "hip::host interface - found") - set(HIP_HOST_INTERFACE hip::host) - else() - message(STATUS "hip::host interface - not found") - endif() - endif() - endif() endif() ############################################################################### @@ -661,11 +644,6 @@ macro(HIP_ADD_EXECUTABLE hip_target) add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) endif() set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP) - # Link with host - if (HIP_HOST_INTERFACE) - # hip rt should be ROCclr, compiler should be clang - target_link_libraries(${hip_target} ${HIP_HOST_INTERFACE}) - endif() endmacro() ############################################################################### @@ -684,11 +662,6 @@ macro(HIP_ADD_LIBRARY hip_target) add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) endif() set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX}) - # Link with host - if (HIP_HOST_INTERFACE) - # hip rt should be ROCclr, compiler should be clang - target_link_libraries(${hip_target} ${HIP_HOST_INTERFACE}) - endif() endmacro() # vim: ts=4:sw=4:expandtab:smartindent diff --git a/hip-config.cmake.in b/hip-config.cmake.in index fe3f09a824..d5af845cd6 100644 --- a/hip-config.cmake.in +++ b/hip-config.cmake.in @@ -101,7 +101,6 @@ include( "${CMAKE_CURRENT_LIST_DIR}/hip-targets.cmake" ) # without worrying other transitive dependencies find_dependency(hsa-runtime64) find_dependency(Threads) -find_dependency(ROCclr) #get_filename_component cannot resolve the symlinks if called from /opt/rocm/lib/hip #and do three level up again diff --git a/rocclr/CMakeLists.txt b/rocclr/CMakeLists.txt index 85099a1682..64d581959d 100755 --- a/rocclr/CMakeLists.txt +++ b/rocclr/CMakeLists.txt @@ -38,9 +38,8 @@ set(USE_PROF_API "1") find_package(ROCclr REQUIRED CONFIG PATHS - /opt/rocm/rocclr - PATH_SUFFIXES - lib/cmake/rocclr) + /opt/rocm + /opt/rocm/rocclr) ############################# # Profiling API support @@ -218,14 +217,14 @@ endif() set_target_properties(amdhip64 PROPERTIES LINK_FLAGS_RELEASE -s) set_target_properties(amdhip64 PROPERTIES PUBLIC_HEADER ${PROF_API_STR}) add_library(host INTERFACE) -target_link_libraries(host INTERFACE amdhip64) +target_link_libraries(host INTERFACE hip::amdhip64) add_library(device INTERFACE) target_link_libraries(device INTERFACE host) # Short-Term solution for pre-compiled headers for online compilation -if(${__HIP_ENABLE_PCH}) - target_sources(amdhip64 PRIVATE ${CMAKE_BINARY_DIR}/hip_pch.o) +if(__HIP_ENABLE_PCH) + target_link_libraries(amdhip64 PRIVATE ${CMAKE_BINARY_DIR}/hip_pch.o) endif() # TODO: we may create host_static and device_static to let app @@ -233,14 +232,31 @@ endif() # FIXME: Linux convention is to create static library with same base # filename. -target_link_libraries(amdhip64 PRIVATE amdrocclr_static Threads::Threads dl hsa-runtime64::hsa-runtime64) +if(${BUILD_SHARED_LIBS}) + target_link_libraries(amdhip64 PRIVATE amdrocclr_static Threads::Threads dl hsa-runtime64::hsa-runtime64) -add_custom_command(TARGET amdhip64 POST_BUILD COMMAND - ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/.hipInfo ${PROJECT_BINARY_DIR}/lib/.hipInfo) -add_custom_command(TARGET amdhip64 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + add_custom_command(TARGET amdhip64 POST_BUILD COMMAND + ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/.hipInfo ${PROJECT_BINARY_DIR}/lib/.hipInfo) + add_custom_command(TARGET amdhip64 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + + INSTALL(PROGRAMS $ DESTINATION lib COMPONENT MAIN) +else() + target_link_libraries(amdhip64 PRIVATE Threads::Threads dl hsa-runtime64::hsa-runtime64 amd_comgr) + # combine objects of vid and hip into amdhip64_static + add_custom_target( + amdhip64_static_combiner + ALL + COMMAND rm -rf static_lib_temp && mkdir static_lib_temp && cd static_lib_temp # Create temp folder to contain *.o + COMMAND ${CMAKE_AR} -x $ # Extract *.o from amdrocclr_static + COMMAND ${CMAKE_AR} -rcs $ *.o # Append *.o to amdhip64_static + COMMAND cd .. && rm -rf static_lib_temp # Remove temp folder + DEPENDS amdhip64 amdrocclr_static # To make sure this is the last step + COMMENT "Combining static libs into amdhip64_static" + ) + INSTALL(PROGRAMS $ DESTINATION lib COMPONENT MAIN) +endif() -INSTALL(PROGRAMS $ DESTINATION lib COMPONENT MAIN) INSTALL(TARGETS amdhip64 host device EXPORT hip-targets DESTINATION ${LIB_INSTALL_DIR}) INSTALL(EXPORT hip-targets DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR} NAMESPACE hip::) diff --git a/samples/0_Intro/bit_extract/CMakeLists.txt b/samples/0_Intro/bit_extract/CMakeLists.txt index ec3930f691..c9b13be812 100644 --- a/samples/0_Intro/bit_extract/CMakeLists.txt +++ b/samples/0_Intro/bit_extract/CMakeLists.txt @@ -2,14 +2,6 @@ project(bit_extract) cmake_minimum_required(VERSION 3.10) -if(NOT DEFINED __HIP_ENABLE_PCH) - set(__HIP_ENABLE_PCH ON CACHE BOOL "enable/disable pre-compiled hip headers") -endif() - -if(${__HIP_ENABLE_PCH}) - add_definitions(-D__HIP_ENABLE_PCH) -endif() - # Search for rocm in common locations list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) diff --git a/samples/0_Intro/bit_extract/bit_extract.cpp b/samples/0_Intro/bit_extract/bit_extract.cpp index 1f7770ccb5..e87124f47f 100644 --- a/samples/0_Intro/bit_extract/bit_extract.cpp +++ b/samples/0_Intro/bit_extract/bit_extract.cpp @@ -54,20 +54,6 @@ int main(int argc, char* argv[]) { size_t N = 1000000; size_t Nbytes = N * sizeof(uint32_t); -#ifdef __HIP_ENABLE_PCH - // Verify hip_pch.o - const char* pch = nullptr; - unsigned int size = 0; - __hipGetPCH(&pch, &size); - printf("pch size: %u\n", size); - if (size == 0) { - printf("__hipGetPCH failed!\n"); - return -1; - } else { - printf("__hipGetPCH succeeded!\n"); - } -#endif - int deviceId; CHECK(hipGetDevice(&deviceId)); hipDeviceProp_t props; diff --git a/samples/0_Intro/square/CMakeLists.txt b/samples/0_Intro/square/CMakeLists.txt index 2e101e1470..845c43fd1f 100644 --- a/samples/0_Intro/square/CMakeLists.txt +++ b/samples/0_Intro/square/CMakeLists.txt @@ -7,9 +7,6 @@ cmake_minimum_required(VERSION 3.10) # Search for rocm in common locations list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) -# create square.cpp -execute_process(COMMAND sh -c "/opt/rocm/hip/bin/hipify-perl ../square.cu > ../square.cpp") - # Find hip find_package(hip) diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt index dbfdf9a908..0e8020a67a 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt @@ -9,9 +9,6 @@ if(NOT DEFINED HIP_PATH) endif() set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) -# Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} /opt/rocm) - project(12_cmake) set(HIP_CLANG_NUM_PARALLEL_JOBS 2) diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md b/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md index 9aa6b96fab..4e322fd83e 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md @@ -37,13 +37,7 @@ Use the following commands to build and execute the sample ``` mkdir build cd build - -For shared lib of hip rt, cmake .. -Or for static lib of hip rt, -cmake -DCMAKE_PREFIX_PATH="/opt/rocm/llvm/lib/cmake" .. - -Then, make ./MatrixTranspose ``` diff --git a/samples/README.md b/samples/README.md index c54ec20b3a..739045382e 100644 --- a/samples/README.md +++ b/samples/README.md @@ -12,22 +12,16 @@ make 2.CMakeLists.txt can support shared and static libs of hip-rocclr runtime. -To build a sample, run in the sample folder, +To build a sample, type in sample folder, -mkdir -p build && cd build +mkdir build (if build folder is missing) -rm -rf * (to clear up) - -a. to build with shared libs, run +cd build cmake .. -b. to build with static libs, run - -cmake -DCMAKE_PREFIX_PATH="/opt/rocm/llvm/lib/cmake" .. - -Then run, - make -Note that if you want debug version, add "-DCMAKE_BUILD_TYPE=Debug" in cmake cmd. \ No newline at end of file +If you want debug version, follow, + +cmake -DCMAKE_BUILD_TYPE=Debug .. \ No newline at end of file diff --git a/tests/README.md b/tests/README.md index a38e496d83..275a25f9dd 100644 --- a/tests/README.md +++ b/tests/README.md @@ -26,7 +26,7 @@ Copy this to a new test name and modify it. ### HIP Integrated Tester (HIT) -The HIT framework automatically finds and adds test cases to the CMAKE testing environment. It achives this by parsing all files in the tests/src folder. +The HIT framework sutomatically finds and adds test cases to the CMAKE testing environment. It achives this by parsing all files in the tests/src folder. The parser looks for a code block similar to the one below. ``` /* HIT_START @@ -47,7 +47,7 @@ In the above, BUILD commands provide instructions on how to build the test case The supported syntax for the BUILD command is: <<<<<<< HEAD -BUILD: %t %s HIPCC_OPTIONS HCC_OPTIONS CLANG_OPTIONS NVCC_OPTIONS EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER EXCLUDE_HIP_LIB_TYPE DEPENDS +BUILD: %t %s HIPCC_OPTIONS HCC_OPTIONS CLANG_OPTIONS NVCC_OPTIONS EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER DEPENDS ``` %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. @@ -59,7 +59,6 @@ EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or 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 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: EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER EXCLUDE_HIP_LIB_TYPE DEPENDS +BUILD_CMD: EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER DEPENDS ``` %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. @@ -81,7 +80,6 @@ EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or 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 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,22 +87,20 @@ 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 EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER EXCLUDE_HIP_LIB_TYPE +TEST: %t EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER ``` %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 HCC, NVCC 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 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. - Note that if the test has been excluded for a specific platform/runtime/compiler in the BUILD command, it is automatically excluded from the TEST command as well for the sameplatform. #### TEST_NAMED command 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 EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER EXCLUDE_HIP_LIB_TYPE +TEST: %t CMAKE_TEST_NAME EXCLUDE_HIP_PLATFORM EXCLUDE_HIP_RUNTIME EXCLUDE_HIP_COMPILER ``` diff --git a/tests/hit/HIT.cmake b/tests/hit/HIT.cmake index e11334c408..839b90befb 100755 --- a/tests/hit/HIT.cmake +++ b/tests/hit/HIT.cmake @@ -3,14 +3,10 @@ find_package(HIP REQUIRED) set(HIP_CTEST_CONFIG_DEFAULT "default") set(HIP_CTEST_CONFIG_PERFORMANCE "performance") -set(HIP_LIB_TYPE "shared") -if (NOT ${BUILD_SHARED_LIBS}) - set(HIP_LIB_TYPE "static") -endif() -message(STATUS "HIP_LIB_TYPE - ${HIP_LIB_TYPE}") + #------------------------------------------------------------------------------- # 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 _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _depends _dir) set(${_target}) set(${_sources}) set(${_hipcc_options}) @@ -21,181 +17,239 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _clang_op set(${_exclude_platforms}) set(${_exclude_runtime}) set(${_exclude_compiler}) - set(${_exclude_lib_type}) set(${_depends}) - set(_target_found FALSE) - set(_flag "") - + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) foreach(arg ${ARGN}) if(NOT _target_found) 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" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE" - OR "x${arg}" STREQUAL "xDEPENDS") - 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") - list(APPEND ${_nvcc_options} ${arg}) - elseif("x${_flag}" STREQUAL "xLINK_OPTIONS") - list(APPEND ${_link_options} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM") - list(APPEND ${_exclude_platforms} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME") - list(APPEND ${_exclude_runtime} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER") - list(APPEND ${_exclude_compiler} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - list(APPEND ${_exclude_lib_type} ${arg}) - elseif("x${_flag}" STREQUAL "xDEPENDS") - list(APPEND ${_depends} ${arg}) + elseif("x${arg}" STREQUAL "xHIPCC_OPTIONS") + set(_hipcc_options_found TRUE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xHCC_OPTIONS") + set(_hipcc_options_found FALSE) + set(_hcc_options_found TRUE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xCLANG_OPTIONS") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found TRUE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xNVCC_OPTIONS") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found TRUE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xLINK_OPTIONS") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found TRUE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found TRUE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found TRUE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found TRUE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xDEPENDS") + set(_hipcc_options_found FALSE) + set(_hcc_options_found FALSE) + set(_clang_options_found FALSE) + set(_nvcc_options_found FALSE) + set(_link_options_found FALSE) + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found TRUE) else() - list(APPEND ${_sources} "${_dir}/${arg}") + if(_hipcc_options_found) + list(APPEND ${_hipcc_options} ${arg}) + elseif(_hcc_options_found) + list(APPEND ${_hcc_options} ${arg}) + elseif(_clang_options_found) + list(APPEND ${_clang_options} ${arg}) + elseif(_nvcc_options_found) + list(APPEND ${_nvcc_options} ${arg}) + elseif(_link_options_found) + list(APPEND ${_link_options} ${arg}) + elseif(_exclude_platforms_found) + list(APPEND ${_exclude_platforms} ${arg}) + elseif(_exclude_runtime_found) + list(APPEND ${_exclude_runtime} ${arg}) + elseif(_exclude_compiler_found) + list(APPEND ${_exclude_compiler} ${arg}) + elseif(_depends_found) + list(APPEND ${_depends} ${arg}) + else() + list(APPEND ${_sources} "${_dir}/${arg}") + endif() endif() endforeach() endmacro() # Helper macro to parse CUSTOM BUILD instructions -macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends) +macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends) set(${_target}) - set(${_buildcmd}) + set(${_buildcmd} " ") set(${_exclude_platforms}) - set(${_exclude_runtime}) - set(${_exclude_compiler}) - set(${_exclude_lib_type}) set(${_depends}) - set(_target_found FALSE) - set(_flag "") - + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) foreach(arg ${ARGN}) if(NOT _target_found) set(_target_found TRUE) set(${_target} ${arg}) - elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE" - OR "x${arg}" STREQUAL "xDEPENDS") - set(_flag ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM") - list(APPEND ${_exclude_platforms} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME") - list(APPEND ${_exclude_runtime} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER") - list(APPEND ${_exclude_compiler} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - list(APPEND ${_exclude_lib_type} ${arg}) - elseif("x${_flag}" STREQUAL "xDEPENDS") - list(APPEND ${_depends} ${arg}) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM") + set(_exclude_platforms_found TRUE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found TRUE) + set(_exclude_compiler_found FALSE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found TRUE) + set(_depends_found FALSE) + elseif("x${arg}" STREQUAL "xDEPENDS") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + set(_depends_found TRUE) else() - list(APPEND ${_buildcmd} ${arg}) # always before exclude lists - endif() - endforeach() -endmacro() - -# Helper macro to parse command part of CUSTOM BUILD instructions -macro(PARSE_CUSTOMBUILD_COMMAND_PART _compiler _target _target_type _sources _options) - set(${_compiler}) - set(${_target}) - set(${_target_type} "EXECUTABLE") - set(${_sources}) - set(${_options}) - set(_compiler_found FALSE) - set(_target_found FALSE) - - foreach(arg ${ARGN}) - if(NOT _compiler_found) - set(_compiler_found TRUE) - set(${_compiler} ${arg}) - elseif("x${arg}" STREQUAL "x-o") - set(_target_found TRUE) - elseif(_target_found) - set(${_target} ${arg}) - set(_target_found FALSE) - elseif("x${arg}" STREQUAL "x-c" OR "x${arg}" STREQUAL "x--genco") - set(${_target_type} "OBJECT") - list(APPEND ${_options} ${arg}) - elseif("x${arg}" STREQUAL "x-shared") - # Note: Currently all directed_tests are linux based. - set(${_target_type} "SHARED") - list(APPEND ${_options} ${arg}) - elseif("x${arg}" MATCHES "^x-I") - # -I - list(APPEND ${_options} ${arg}) - elseif("x${arg}" MATCHES "^x.*\.cpp$") - # cpp file - list(APPEND ${_sources} ${arg}) - elseif("x${arg}" MATCHES "^x.*\.c$") - # c file - list(APPEND ${_sources} ${arg}) - else() - list(APPEND ${_options} ${arg}) + if(_exclude_platforms_found) + list(APPEND ${_exclude_platforms} ${arg}) + elseif(_exclude_runtime_found) + list(APPEND ${_exclude_runtime} ${arg}) + elseif(_exclude_compiler_found) + list(APPEND ${_exclude_compiler} ${arg}) + elseif(_depends_found) + list(APPEND ${_depends} ${arg}) + else() + list(APPEND ${_buildcmd} ${arg}) + endif() endif() endforeach() endmacro() # Helper macro to parse TEST instructions -macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type) +macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms _exclude_runtime _exclude_compiler) set(${_target}) set(${_arguments} " ") set(${_exclude_platforms}) set(${_exclude_runtime}) set(${_exclude_compiler}) - set(${_exclude_lib_type}) - set(_target_found FALSE) - set(_flag "") - + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) foreach(arg ${ARGN}) if(NOT _target_found) set(_target_found TRUE) set(${_target} ${arg}) - elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - set(_flag ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM") - list(APPEND ${_exclude_platforms} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME") - list(APPEND ${_exclude_runtime} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER") - list(APPEND ${_exclude_compiler} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - list(APPEND ${_exclude_lib_type} ${arg}) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM") + set(_exclude_platforms_found TRUE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found TRUE) + set(_exclude_compiler_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found TRUE) else() - list(APPEND ${_arguments} ${arg}) # always before exclude lists + if(_exclude_platforms_found) + list(APPEND ${_exclude_platforms} ${arg}) + elseif(_exclude_runtime_found) + list(APPEND ${_exclude_runtime} ${arg}) + elseif(_exclude_compiler_found) + list(APPEND ${_exclude_compiler} ${arg}) + else() + list(APPEND ${_arguments} ${arg}) + endif() endif() endforeach() endmacro() # Helper macro to parse TEST_NAMED instructions -macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type) +macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler) set(${_target}) set(${_arguments} " ") set(${_exclude_platforms}) - set(${_exclude_runtime}) - set(${_exclude_compiler}) - set(${_exclude_lib_type}) - set(_target_found FALSE) set(_testname_found FALSE) - set(_flag "") - + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) foreach(arg ${ARGN}) if(NOT _target_found) set(_target_found TRUE) @@ -203,21 +257,28 @@ macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _ elseif(NOT _testname_found) set(_testname_found TRUE) set(${_testname} ${arg}) - elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER" - OR "x${arg}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - set(_flag ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_PLATFORM") - list(APPEND ${_exclude_platforms} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_RUNTIME") - list(APPEND ${_exclude_runtime} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_COMPILER") - list(APPEND ${_exclude_compiler} ${arg}) - elseif("x${_flag}" STREQUAL "xEXCLUDE_HIP_LIB_TYPE") - list(APPEND ${_exclude_lib_type} ${arg}) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM") + set(_exclude_platforms_found TRUE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found TRUE) + set(_exclude_compiler_found FALSE) + elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER") + set(_exclude_platforms_found FALSE) + set(_exclude_runtime_found FALSE) + set(_exclude_compiler_found TRUE) else() - list(APPEND ${_arguments} ${arg}) # always before exclude lists + if(_exclude_platforms_found) + list(APPEND ${_exclude_platforms} ${arg}) + elseif(_exclude_runtime_found) + list(APPEND ${_exclude_runtime} ${arg}) + elseif(_exclude_compiler_found) + list(APPEND ${_exclude_compiler} ${arg}) + else() + list(APPEND ${_arguments} ${arg}) + endif() endif() endforeach() endmacro() @@ -268,7 +329,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 _hcc_options _clang_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _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) @@ -276,9 +337,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent) insert_into_map("_exclude" "${target}" TRUE) elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime) insert_into_map("_exclude" "${target}" TRUE) - elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) - insert_into_map("_exclude" "${target}" TRUE) - elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type) + elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND ${HIP_COMPILER} IN_LIST _exclude_compiler) insert_into_map("_exclude" "${target}" TRUE) else() set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) @@ -309,7 +368,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent) string(REGEX REPLACE "%T" ${_label} _contents "${_contents}") foreach(_cmd ${_contents}) string(REGEX REPLACE " " ";" _cmd "${_cmd}") - parse_custombuild_command(_target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type _depends ${_cmd}) + parse_custombuild_command(_target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends ${_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) @@ -317,33 +376,14 @@ macro(HIT_ADD_FILES _config _dir _label _parent) insert_into_map("_exclude" "${target}" TRUE) elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime) insert_into_map("_exclude" "${target}" TRUE) - elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) - insert_into_map("_exclude" "${target}" TRUE) - elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type) + elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND ${HIP_COMPILER} IN_LIST _exclude_compiler) insert_into_map("_exclude" "${target}" TRUE) else() - parse_custombuild_command_part(_compiler _target_r _target_type _sources _options ${_buildcmd}) string(REGEX REPLACE ";" " " _buildcmd "${_buildcmd}") - string(REGEX REPLACE ";" " " _options "${_options}") - - set(CHOICE_FLAG "${HIP_LIB_TYPE}" STREQUAL "static" AND "${_compiler}" MATCHES "hipcc$" - AND "${HIP_RUNTIME}" STREQUAL "ROCclr" AND "${HIP_COMPILER}" STREQUAL "clang") - if (${CHOICE_FLAG} AND "${_target_type}" STREQUAL "EXECUTABLE") - # message(STATUS "hip_add_executable*:_target_r= ${_target_r} --- target= ${target} --- _sources=${_sources} --- _options=${_options}") - set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) - hip_reset_flags() - hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_options} EXCLUDE_FROM_ALL) - set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target_r} RUNTIME_OUTPUT_DIRECTORY "." LINK_DEPENDS "${HIP_LIB_FILES}") - elseif(${CHOICE_FLAG} AND "${_target_type}" STREQUAL "SHARED") - # message(STATUS "hip_add_library*:_target_r= ${_target_r} --- target= ${target} --- _sources=${_sources} --- _options=${_options}") - set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) - hip_reset_flags() - hip_add_library(${target} ${_sources} HIPCC_OPTIONS ${_options} EXCLUDE_FROM_ALL ${_target_type}) - set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target_r} RUNTIME_OUTPUT_DIRECTORY "." LINK_DEPENDS "${HIP_LIB_FILES}" PREFIX "" SUFFIX "") - else() - # message(STATUS "add_custom_target*: target= ${target} _buildcmd= ${_buildcmd}") - add_custom_target(${target} COMMAND sh -c "${_buildcmd}") - endif() + #string(CONCAT buildscript ${CMAKE_CURRENT_BINARY_DIR}/${target} ".sh") + #file(WRITE ${buildscript} ${_buildcmd}) + #add_custom_target(${target} COMMAND ${buildscript}) + add_custom_target(${target} COMMAND sh -c "${_buildcmd}") add_dependencies(${_parent} ${target}) foreach(_dependency ${_depends}) string(REGEX REPLACE "/" "." _dependency ${_label}/${_dependency}) @@ -361,14 +401,13 @@ macro(HIT_ADD_FILES _config _dir _label _parent) string(REGEX REPLACE "\n" ";" _contents "${_contents}") foreach(_cmd ${_contents}) string(REGEX REPLACE " " ";" _cmd "${_cmd}") - parse_test_command(_target _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type ${_cmd}) + parse_test_command(_target _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd}) string(REGEX REPLACE "/" "." target ${_label}/${_target}) read_from_map("_exclude" "${target}" _exclude_test_from_build) if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms) elseif(NOT _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime) elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) - elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type) elseif(_exclude_test_from_build STREQUAL TRUE) else() make_test(${_config} ${_label}/${_target} ${_arguments}) @@ -384,14 +423,13 @@ macro(HIT_ADD_FILES _config _dir _label _parent) string(REGEX REPLACE "\n" ";" _contents "${_contents}") foreach(_cmd ${_contents}) string(REGEX REPLACE " " ";" _cmd "${_cmd}") - parse_test_named_command(_target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler _exclude_lib_type ${_cmd}) + parse_test_named_command(_target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd}) string(REGEX REPLACE "/" "." target ${_label}/${_target}) read_from_map("_exclude" "${target}" _exclude_test_from_build) if("all" IN_LIST _exclude_platforms OR ${HIP_PLATFORM} IN_LIST _exclude_platforms) elseif(NOT _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) elseif(NOT _exclude_compiler AND ${HIP_RUNTIME} IN_LIST _exclude_runtime) elseif(${HIP_RUNTIME} IN_LIST _exclude_runtime AND ${HIP_COMPILER} IN_LIST _exclude_compiler) - elseif(${HIP_LIB_TYPE} IN_LIST _exclude_lib_type) elseif(_exclude_test_from_build STREQUAL TRUE) else() make_named_test(${_config} ${_label}/${_target} ${_label}/${_testname}.tst ${_arguments}) diff --git a/tests/src/dynamicLoading/complex_loading_behavior.cpp b/tests/src/dynamicLoading/complex_loading_behavior.cpp index bb75bd0147..8288e15723 100644 --- a/tests/src/dynamicLoading/complex_loading_behavior.cpp +++ b/tests/src/dynamicLoading/complex_loading_behavior.cpp @@ -21,9 +21,9 @@ THE SOFTWARE. */ /* HIT_START - * BUILD_CMD: libfoo_amd %hc %S/%s -o libfoo.so -Xcompiler -fPIC -lpthread -shared -DTEST_SHARED_LIBRARY EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static + * BUILD_CMD: libfoo_amd %hc %S/%s -o libfoo.so -Xcompiler -fPIC -lpthread -shared -DTEST_SHARED_LIBRARY EXCLUDE_HIP_PLATFORM nvcc * BUILD_CMD: libfoo_nvidia %hc %S/%s -o libfoo.so -Xcompiler -fPIC -lpthread -shared -DTEST_SHARED_LIBRARY EXCLUDE_HIP_PLATFORM hcc rocclr - * BUILD_CMD: %t %hc %S/%s -o %T/%t -ldl EXCLUDE_HIP_LIB_TYPE static + * BUILD_CMD: %t %hc %S/%s -o %T/%t -ldl * TEST: %t * HIT_END */ diff --git a/tests/src/g++/hipMalloc.cpp b/tests/src/g++/hipMalloc.cpp index a45c40695e..d527db3570 100644 --- a/tests/src/g++/hipMalloc.cpp +++ b/tests/src/g++/hipMalloc.cpp @@ -18,8 +18,8 @@ * */ /* HIT_START - * BUILD_CMD: hipMalloc %cxx -D__HIP_PLATFORM_HCC__ -I%hip-path/include -I/opt/rocm/include %S/%s -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/%t -std=c++11 EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static - * TEST: %t EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static + * BUILD_CMD: hipMalloc %cxx -D__HIP_PLATFORM_HCC__ -I%hip-path/include -I/opt/rocm/include %S/%s -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/%t -std=c++11 EXCLUDE_HIP_PLATFORM nvcc + * TEST: %t EXCLUDE_HIP_PLATFORM nvcc * HIT_END */ diff --git a/tests/src/gcc/LaunchKernel.c b/tests/src/gcc/LaunchKernel.c index dc3c20920b..08aca3e2fe 100644 --- a/tests/src/gcc/LaunchKernel.c +++ b/tests/src/gcc/LaunchKernel.c @@ -21,8 +21,8 @@ /* HIT_START * BUILD_CMD: gpu.o %hc -I%hip-path/include -g -c %S/gpu.cpp -o %T/gpu.o EXCLUDE_HIP_PLATFORM nvcc rocclr * BUILD_CMD: launchkernel.o %hc -D__HIP_PLATFORM_HCC__ -g -I%hip-path/include -c %S/LaunchKernel.c -o %T/launchkernel.o EXCLUDE_HIP_PLATFORM nvcc rocclr - * BUILD_CMD: LaunchKernel %hc %T/launchkernel.o %T/gpu.o -g -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/%t DEPENDS gpu.o launchkernel.o EXCLUDE_HIP_PLATFORM nvcc rocclr EXCLUDE_HIP_LIB_TYPE static - * TEST: %t EXCLUDE_HIP_PLATFORM nvcc rocclr EXCLUDE_HIP_LIB_TYPE static + * BUILD_CMD: LaunchKernel %hc %T/launchkernel.o %T/gpu.o -g -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/%t DEPENDS gpu.o launchkernel.o EXCLUDE_HIP_PLATFORM nvcc rocclr + * TEST: %t EXCLUDE_HIP_PLATFORM nvcc rocclr * HIT_END */ diff --git a/tests/src/gcc/hipMalloc.c b/tests/src/gcc/hipMalloc.c index 537a7b5b9e..2e5deb2a16 100644 --- a/tests/src/gcc/hipMalloc.c +++ b/tests/src/gcc/hipMalloc.c @@ -19,9 +19,9 @@ /* HIT_START * BUILD_CMD: hipMalloc %cc -D__HIP_PLATFORM_NVCC__ -I%hip-path/include -I/usr/local/cuda/include %S/%s -o %T/hipMalloc_nv -L/usr/local/cuda/lib64 -lcudart EXCLUDE_HIP_PLATFORM hcc rocclr - * BUILD_CMD: hipMalloc %cc -D__HIP_PLATFORM_HCC__ -I%hip-path/include %S/%s -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/hipMalloc_hcc EXCLUDE_HIP_PLATFORM nvcc rocclr EXCLUDE_HIP_LIB_TYPE static + * BUILD_CMD: hipMalloc %cc -D__HIP_PLATFORM_HCC__ -I%hip-path/include %S/%s -Wl,--rpath=%hip-path/lib %hip-path/lib/libamdhip64.so -o %T/hipMalloc_hcc EXCLUDE_HIP_PLATFORM nvcc rocclr * TEST: hipMalloc_nv EXCLUDE_HIP_PLATFORM hcc rocclr - * TEST: hipMalloc_hcc EXCLUDE_HIP_PLATFORM nvcc rocclr EXCLUDE_HIP_LIB_TYPE static + * TEST: hipMalloc_hcc EXCLUDE_HIP_PLATFORM nvcc rocclr * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp b/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp index ebea6a05ed..6bad4c054c 100644 --- a/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp +++ b/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp @@ -24,7 +24,7 @@ // /* HIT_START - * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static + * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemsetAsyncAndKernel.cpp b/tests/src/runtimeApi/memory/hipMemsetAsyncAndKernel.cpp index 028d4b9b81..564b804a9f 100644 --- a/tests/src/runtimeApi/memory/hipMemsetAsyncAndKernel.cpp +++ b/tests/src/runtimeApi/memory/hipMemsetAsyncAndKernel.cpp @@ -23,7 +23,7 @@ */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static + * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp b/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp index 201d221392..b4ae8658f7 100644 --- a/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp +++ b/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp @@ -22,7 +22,7 @@ */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc EXCLUDE_HIP_LIB_TYPE static + * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc * TEST: %t * HIT_END */