diff --git a/projects/rocprofiler/CMakeLists.txt b/projects/rocprofiler/CMakeLists.txt index a8997eba01..5ad1196e67 100644 --- a/projects/rocprofiler/CMakeLists.txt +++ b/projects/rocprofiler/CMakeLists.txt @@ -176,7 +176,7 @@ if(${LIBRARY_TYPE} STREQUAL SHARED) add_subdirectory(samples) # Build tests - add_subdirectory(tests) + add_subdirectory(tests-v2) endif() # Build Plugins diff --git a/projects/rocprofiler/build.sh b/projects/rocprofiler/build.sh index 8d0a74fbdb..c87638ed58 100755 --- a/projects/rocprofiler/build.sh +++ b/projects/rocprofiler/build.sh @@ -71,7 +71,7 @@ if [ -n "$ROCM_RPATH" ] ; then LD_RUNPATH_FLAG=" -Wl,--enable-new-dtags -Wl,--rp if [ -z "$TO_CLEAN" ] ; then TO_CLEAN=yes; fi if [ -z "$RUN_TEST" ] ; then RUN_TEST=no; fi if [ -z "$ASAN" ] ; then ASAN=False; fi -if [ -z "$GPU_LIST" ] ; then GPU_LIST='gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100'; fi +if [ -z "$GPU_LIST" ] ; then GPU_LIST="gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100"; fi ROCPROFILER_ROOT=$(cd $ROCPROFILER_ROOT && echo $PWD) diff --git a/projects/rocprofiler/test/CMakeLists.txt b/projects/rocprofiler/test/CMakeLists.txt index fd99d3fbcc..7aea337b21 100644 --- a/projects/rocprofiler/test/CMakeLists.txt +++ b/projects/rocprofiler/test/CMakeLists.txt @@ -48,6 +48,7 @@ include_directories(${HSA_RUNTIME_INC_PATH}) ## C test add_executable ( "c_test" ${TEST_DIR}/app/c_test.c ) target_include_directories ( "c_test" PRIVATE ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include $ ) +install(TARGETS "c_test" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Util sources file( GLOB UTIL_SRC "${TEST_DIR}/util/*.cpp" ) @@ -86,33 +87,73 @@ set ( TEST_NAME simple_convolution ) set ( KERN_SRC ${TEST_DIR}/${TEST_NAME}/${TEST_NAME}.cpp ) ## Building test kernels -add_custom_target( mytest - COMMAND sh -xc "${TEST_DIR}/../bin/build_kernel.sh ${TEST_DIR}/${DUMMY_NAME}/${DUMMY_NAME} ${PROJECT_BINARY_DIR} '${ROCM_ROOT_DIR}' '${GPU_TARGETS}'" - COMMAND sh -xc "${TEST_DIR}/../bin/build_kernel.sh ${TEST_DIR}/${TEST_NAME}/${TEST_NAME} ${PROJECT_BINARY_DIR} '${ROCM_ROOT_DIR}' '${GPU_TARGETS}'" -) +# add_custom_target( mytest +# COMMAND sh -xc "${TEST_DIR}/../bin/build_kernel.sh ${TEST_DIR}/${DUMMY_NAME}/${DUMMY_NAME} ${PROJECT_BINARY_DIR} '${ROCM_ROOT_DIR}' '${GPU_TARGETS}'" +# COMMAND sh -xc "${TEST_DIR}/../bin/build_kernel.sh ${TEST_DIR}/${TEST_NAME}/${TEST_NAME} ${PROJECT_BINARY_DIR} '${ROCM_ROOT_DIR}' '${GPU_TARGETS}'" +# ) + +find_package(Clang REQUIRED CONFIG + PATHS ${ROCM_ROOT_DIR} + PATH_SUFFIXES "llvm/lib/cmake/clang") + +## Build the hsa (standalone) simple_convolution test +function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE) + separate_arguments(CLANG_ARG_LIST UNIX_COMMAND + "-O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 --hip-device-lib-path=${ROCM_ROOT_DIR}/amdgcn/bitcode + -Wl,--build-id=sha1 -target amdgcn-amd-amdhsa -mcpu=${TARGET_ID} -mcode-object-version=4 -o ${OUTPUT_FILE} ${INPUT_FILE}") + add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} + COMMAND clang ${CLANG_ARG_LIST} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${INPUT_FILE} clang + COMMENT "Building ${OUTPUT_FILE}..." + VERBATIM) + install(FILES ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1 COMPONENT tests) + set(HSACO_TARGET_LIST ${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/${OUTPUT_FILE} PARENT_SCOPE) +endfunction(generate_hsaco) + +separate_arguments(GPU_TARGETS) +list(LENGTH GPU_TARGETS list_count) +if (${list_count} LESS_EQUAL 1) + string(REPLACE " " ";" GPU_LIST ${GPU_TARGETS}) + string(REPLACE "," ";" GPU_LIST ${GPU_TARGETS}) +else() + set(GPU_LIST ${GPU_TARGETS}) +endif() +foreach(target_id ${GPU_LIST}) + ## generate kernel bitcodes + generate_hsaco(${target_id} ${TEST_DIR}/${TEST_NAME}/${TEST_NAME}.cl ${target_id}_SimpleConvolution.hsaco) + generate_hsaco(${target_id} ${TEST_DIR}/${DUMMY_NAME}/${DUMMY_NAME}.cl ${target_id}_DummyKernel.hsaco) +endforeach(target_id) +add_custom_target(test DEPENDS ${HSACO_TARGET_LIST}) +add_custom_target(mytest DEPENDS ${HSACO_TARGET_LIST}) ## Building standalone test executable add_executable ( ${ST_EXE_NAME} ${ST_TST_SRC} ${UTIL_SRC} ${KERN_SRC} ) target_include_directories ( ${ST_EXE_NAME} PRIVATE ${TEST_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include ) -target_link_libraries ( ${ST_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads dl ) +target_link_libraries ( ${ST_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads stdc++fs dl ) +install(TARGETS ${ST_EXE_NAME} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Building standalone intercept test executable add_executable ( ${STIN_EXE_NAME} ${STIN_TST_SRC} ${UTIL_SRC} ${KERN_SRC} ) target_include_directories ( ${STIN_EXE_NAME} PRIVATE ${TEST_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include ) -target_link_libraries ( ${STIN_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads dl ) +target_link_libraries ( ${STIN_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads stdc++fs dl ) +install(TARGETS ${STIN_EXE_NAME} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Building intercept test executable add_library ( ${IN_EXE_NAME} SHARED ${IN_TST_SRC} ${UTIL_SRC} ${KERN_SRC} ) target_include_directories ( ${IN_EXE_NAME} PRIVATE ${TEST_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include ) -target_link_libraries ( ${IN_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads dl ) +target_link_libraries ( ${IN_EXE_NAME} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads stdc++fs dl ) +install(TARGETS ${IN_EXE_NAME} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Building ctrl test executable add_executable ( ${EXE_NAME} ${CTRL_SRC} ${UTIL_SRC} ${KERN_SRC} ) target_include_directories ( ${EXE_NAME} PRIVATE ${TEST_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include ) -target_link_libraries ( ${EXE_NAME} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads dl ) +target_link_libraries ( ${EXE_NAME} hsa-runtime64::hsa-runtime64 hsakmt::hsakmt Threads::Threads stdc++fs dl ) execute_process ( COMMAND sh -xc "cp ${TEST_DIR}/run.sh ${PROJECT_BINARY_DIR}" ) execute_process ( COMMAND sh -xc "cp ${TEST_DIR}/tool/*.xml ${PROJECT_BINARY_DIR}" ) execute_process ( COMMAND sh -xc "mkdir -p ${PROJECT_BINARY_DIR}/RESULTS" ) +## TODO(aelwazir): Should be replaced by the current location in the main CMakeLists.txt +install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Build test library set ( TEST_LIB "rocprof-tool" ) @@ -120,6 +161,8 @@ set ( TEST_LIB_SRC ${TEST_DIR}/tool/tool.cpp ${UTIL_SRC} ) add_library ( ${TEST_LIB} SHARED ${TEST_LIB_SRC} ) target_include_directories ( ${TEST_LIB} PRIVATE ${TEST_DIR} ${ROOT_DIR} ${PROJECT_SOURCE_DIR}/include ) target_link_libraries ( ${TEST_LIB} ${ROCPROFILER_TARGET} hsa-runtime64::hsa-runtime64 Threads::Threads dl ) +## TODO(aelwazir): Should be replaced by the current location in the main CMakeLists.txt +install(TARGETS ${TEST_LIB} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) ## Build memory test bench add_custom_target( mbench @@ -129,3 +172,23 @@ add_custom_target( mbench ## Copy OCL test execute_process ( COMMAND sh -xc "cp -r ${TEST_DIR}/ocl ${PROJECT_BINARY_DIR}/test/." ) +install(DIRECTORY ${TEST_DIR}/ocl DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1/test COMPONENT tests) + +file(GLOB TEST_XML_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tool/*.xml) +install( + FILES ${TEST_XML_FILES} + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1 + COMPONENT tests) + +install( + FILES ${PROJECT_BINARY_DIR}/run.sh + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests-v1 + PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE + COMPONENT tests) \ No newline at end of file diff --git a/projects/rocprofiler/test/ctrl/test_hsa.cpp b/projects/rocprofiler/test/ctrl/test_hsa.cpp index c84c3a2509..5958edf341 100644 --- a/projects/rocprofiler/test/ctrl/test_hsa.cpp +++ b/projects/rocprofiler/test/ctrl/test_hsa.cpp @@ -23,11 +23,16 @@ THE SOFTWARE. #include "ctrl/test_hsa.h" #include +#include + +#include // for dladdr #include "util/test_assert.h" #include "util/helper_funcs.h" #include "util/hsa_rsrc_factory.h" +namespace fs = std::experimental::filesystem; + HsaRsrcFactory* TestHsa::hsa_rsrc_ = NULL; HsaRsrcFactory* TestHsa::HsaInstantiate() { @@ -82,6 +87,9 @@ bool TestHsa::Initialize(int /*arg_cnt*/, char** /*arg_list*/) { // Obtain the code object file name std::string agentName(agent_info_->name); + Dl_info dl_info; + if (dladdr(reinterpret_cast(TestHsa::HsaShutdown), &dl_info) != 0) + brig_path_obj_.append(fs::path(dl_info.dli_fname).remove_filename().remove_filename()); brig_path_obj_.append(agentName); brig_path_obj_.append("_" + name_ + ".hsaco"); diff --git a/projects/rocprofiler/test/run.sh b/projects/rocprofiler/test/run.sh index 6fe934b15e..f1b331d9a5 100755 --- a/projects/rocprofiler/test/run.sh +++ b/projects/rocprofiler/test/run.sh @@ -22,6 +22,9 @@ # THE SOFTWARE. ################################################################################ +BIN_NAME=`basename $0` +BIN_DIR=`dirname $0` + # test filter input test_filter=-1 if [ -n "$1" ] ; then @@ -57,7 +60,7 @@ eval_test() { } # paths to ROC profiler and oher libraries -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD:$PWD/../../lib:/opt/rocm/lib:/opt/rocm/lib/rocprofiler +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD:$PWD/../../lib:$BIN_DIR/../../../lib:$BIN_DIR/../../../lib/rocprofiler:/opt/rocm/lib:/opt/rocm/lib/rocprofiler # enable tools load failure reporting export HSA_TOOLS_REPORT_LOAD_FAILURE=1 @@ -73,35 +76,39 @@ export ROCP_OBJ_TRACKING=1 # Disabple profiler own proxy queue unset ROCP_PROXY_QUEUE # ROC profiler metrics config file -export ROCP_METRICS=metrics.xml +export ROCP_METRICS=$BIN_DIR/metrics.xml ## C test -eval_test "C test" ./test/c_test +eval_test "C test" $BIN_DIR/test/c_test ## Standalone sampling usage model test unset HSA_TOOLS_LIB unset ROCP_TOOL_LIB -eval_test "Standalone sampling usage model test" ./test/standalone_test +eval_test "Standalone sampling usage model test" $BIN_DIR/test/standalone_test # Standalone intercepting test # ROC profiler library loaded by HSA runtime -export HSA_TOOLS_LIB=librocprofiler64.so.1 +if test -f "$BIN_DIR/../../../lib/librocprofiler64.so.1" ; then + export HSA_TOOLS_LIB="$BIN_DIR/../../../lib/librocprofiler64.so.1" +else + export HSA_TOOLS_LIB=librocprofiler64.so.1 +fi # enable intercepting mode in rocprofiler export ROCP_HSA_INTERCEPT=2 # test macro for kernel iterations number export ROCP_KITER=20 # test macro for per-kernel dispatching number export ROCP_DITER=10 -eval_test "Standalone intercepting test" ./test/stand_intercept_test +eval_test "Standalone intercepting test" $BIN_DIR/test/stand_intercept_test unset ROCP_HSA_INTERCEPT ## Intercepting usage model test # tool library loaded by ROC profiler -export ROCP_TOOL_LIB=./test/libintercept_test.so +export ROCP_TOOL_LIB=$BIN_DIR/test/libintercept_test.so export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=3 -eval_test "Intercepting usage model test" ./test/rocprof-ctrl +eval_test "Intercepting usage model test" $BIN_DIR/test/rocprof-ctrl ## Libtool test # tool library loaded by ROC profiler @@ -109,48 +116,49 @@ export ROCP_TOOL_LIB=librocprof-tool.so # ROC profiler kernels timing export ROCP_TIMESTAMP_ON=1 # output directory for the tool library, for metrics results file 'results.txt' -export ROCP_OUTPUT_DIR=./RESULTS +mkdir -p /tmp/rocprofiler/RESULTS +export ROCP_OUTPUT_DIR=/tmp/rocprofiler/RESULTS if [ ! -e $ROCP_TOOL_LIB ] ; then - export ROCP_TOOL_LIB=test/librocprof-tool.so + export ROCP_TOOL_LIB=$BIN_DIR/test/librocprof-tool.so fi export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=1 -export ROCP_INPUT=pmc_input.xml -eval_test "'rocprof' rocprof-tool PMC test" ./test/rocprof-ctrl +export ROCP_INPUT=$BIN_DIR/pmc_input.xml +eval_test "'rocprof' rocprof-tool PMC test" $BIN_DIR/test/rocprof-ctrl export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=10 -export ROCP_INPUT=pmc_input.xml -eval_test "'rocprof' rocprof-tool PMC n-thread test" ./test/rocprof-ctrl +export ROCP_INPUT=$BIN_DIR/pmc_input.xml +eval_test "'rocprof' rocprof-tool PMC n-thread test" $BIN_DIR/test/rocprof-ctrl export ROCP_OPT_MODE=1 export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=10 -export ROCP_INPUT=pmc_input.xml -eval_test "'rocprof' rocprof-tool PMC n-thread opt test" ./test/rocprof-ctrl +export ROCP_INPUT=$BIN_DIR/pmc_input.xml +eval_test "'rocprof' rocprof-tool PMC n-thread opt test" $BIN_DIR/test/rocprof-ctrl unset ROCP_OPT_MODE export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=1 -export ROCP_INPUT=pmc_input1.xml -eval_test "'rocprof' rocprof-tool PMC test1" ./test/rocprof-ctrl +export ROCP_INPUT=$BIN_DIR/pmc_input1.xml +eval_test "'rocprof' rocprof-tool PMC test1" $BIN_DIR/test/rocprof-ctrl export ROCP_KITER=20 export ROCP_DITER=20 export ROCP_AGENTS=1 export ROCP_THRS=10 -export ROCP_INPUT=pmc_input1.xml -eval_test "'rocprof' rocprof-tool PMC n-thread test1" ./test/rocprof-ctrl +export ROCP_INPUT=$BIN_DIR/pmc_input1.xml +eval_test "'rocprof' rocprof-tool PMC n-thread test1" $BIN_DIR/test/rocprof-ctrl unset ROCP_MCOPY_TRACKING # enable HSA intercepting @@ -158,7 +166,7 @@ export ROCP_HSA_INTERC=1 export ROCP_KITER=10 export ROCP_DITER=10 -eval_test "rocprof-tool test, counter sets" ./test/rocprof-ctrl +eval_test "rocprof-tool test, counter sets" $BIN_DIR/test/rocprof-ctrl ## OpenCL test #eval_test "libtool test, OpenCL sample" ./test/ocl/SimpleConvolution diff --git a/projects/rocprofiler/tests/CMakeLists.txt b/projects/rocprofiler/tests-v2/CMakeLists.txt similarity index 74% rename from projects/rocprofiler/tests/CMakeLists.txt rename to projects/rocprofiler/tests-v2/CMakeLists.txt index b1ed698377..46f4721728 100644 --- a/projects/rocprofiler/tests/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/CMakeLists.txt @@ -1,6 +1,5 @@ add_definitions(-DAMD_INTERNAL_BUILD=1) add_custom_target(tests) -add_dependencies(tests ${ROCPROFILER_TARGET}) add_dependencies(tests rocprofiler_tool) add_custom_target(check COMMAND ${PROJECT_BINARY_DIR}/run_tests.sh DEPENDS tests) add_subdirectory(unittests) diff --git a/projects/rocprofiler/tests/README.md b/projects/rocprofiler/tests-v2/README.md similarity index 100% rename from projects/rocprofiler/tests/README.md rename to projects/rocprofiler/tests-v2/README.md diff --git a/projects/rocprofiler/tests/featuretests/CMakeLists.txt b/projects/rocprofiler/tests-v2/featuretests/CMakeLists.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/CMakeLists.txt rename to projects/rocprofiler/tests-v2/featuretests/CMakeLists.txt diff --git a/projects/rocprofiler/tests/featuretests/gtests_main.cpp b/projects/rocprofiler/tests-v2/featuretests/gtests_main.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/gtests_main.cpp rename to projects/rocprofiler/tests-v2/featuretests/gtests_main.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/CMakeLists.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt similarity index 80% rename from projects/rocprofiler/tests/featuretests/profiler/CMakeLists.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt index c1010848ba..d170251dd6 100644 --- a/projects/rocprofiler/tests/featuretests/profiler/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/featuretests/profiler/CMakeLists.txt @@ -9,10 +9,10 @@ find_file(HSA_H hsa.h REQUIRED) get_filename_component(HSA_RUNTIME_INC_PATH ${HSA_H} DIRECTORY) -include_directories(${PROJECT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${HSA_RUNTIME_INC_PATH} - ${PROJECT_SOURCE_DIR}/tests/featuretests) +include_directories(${PROJECT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${HSA_RUNTIME_INC_PATH} + ${PROJECT_SOURCE_DIR}/tests-v2/featuretests) find_package(Clang REQUIRED CONFIG PATHS "${ROCM_PATH}" @@ -44,21 +44,21 @@ endif() # installing the golden traces file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "apps/goldentraces/*.txt") foreach(file ${files}) - configure_file(${file} ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${file} COPYONLY) + configure_file(${file} ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${file} COPYONLY) endforeach() # Compile Applications # hip_helloworld set_source_files_properties(apps/hello_world_hip.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(hip_helloworld apps/hello_world_hip.cpp) -set_target_properties(hip_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") +set_target_properties(hip_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") target_link_options(hip_helloworld PRIVATE "-Wl,--build-id=md5") install(TARGETS hip_helloworld RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) #hip_vectoradd set_source_files_properties(apps/vector_add_hip.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(hip_vectoradd apps/vector_add_hip.cpp) -set_target_properties(hip_vectoradd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") +set_target_properties(hip_vectoradd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") target_link_options(hip_vectoradd PRIVATE "-Wl,--build-id=md5") install(TARGETS hip_vectoradd RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) @@ -68,7 +68,7 @@ if (MPI_CXX_FOUND) include_directories(SYSTEM ${MPI_INCLUDE_PATH}) set_source_files_properties(apps/vector_add_mpi.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(mpi_vectoradd apps/vector_add_mpi.cpp) -set_target_properties(mpi_vectoradd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") +set_target_properties(mpi_vectoradd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") target_link_options(mpi_vectoradd PRIVATE "-Wl,--build-id=md5") install(TARGETS mpi_vectoradd RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) target_link_libraries(mpi_vectoradd ${MPI_C_LIBRARIES} stdc++fs) @@ -81,7 +81,7 @@ endif() # # Source files. # set_source_files_properties(gtests/apps/openmp/hello_world.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) # hip_add_executable(openmp_helloworld gtests/apps/openmp/hello_world.cpp) -# set_target_properties(openmp_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/gtests/apps") +# set_target_properties(openmp_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/gtests/apps") # # Link Libraries - HIP Device and OpenMP. # target_compile_options(openmp_helloworld PRIVATE ${OpenMP_CXX_FLAGS}) @@ -91,7 +91,7 @@ endif() #hsa-mem_async_copy -- Not Enabled for Now set_source_files_properties(apps/async_mem_copy.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(hsa_async_mem_copy apps/async_mem_copy.cpp) -set_target_properties(hsa_async_mem_copy PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") +set_target_properties(hsa_async_mem_copy PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") target_link_options(hsa_async_mem_copy PRIVATE "-Wl,--build-id=md5") install(TARGETS hsa_async_mem_copy RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) target_link_libraries(hsa_async_mem_copy hsa-runtime64::hsa-runtime64 Threads::Threads dl stdc++fs) @@ -107,16 +107,16 @@ set(CORE_HW_DIR ${PROJECT_SOURCE_DIR}/src/core/hardware) file(GLOB CORE_HW_SRC_FILES ${CORE_HW_DIR}/hsa_info.cpp) set(CORE_UTILS_DIR ${PROJECT_SOURCE_DIR}/src/utils) file(GLOB CORE_UTILS_SRC_FILES ${CORE_UTILS_DIR}/helper.cpp) -set(TEST_UTILS_DIR ${PROJECT_SOURCE_DIR}/tests/featuretests/utils) +set(TEST_UTILS_DIR ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/utils) file(GLOB TEST_UTILS_SRC_FILES ${TEST_UTILS_DIR}/*.cpp) -set(GTEST_MAIN_DIR ${PROJECT_SOURCE_DIR}/tests/featuretests) +set(GTEST_MAIN_DIR ${PROJECT_SOURCE_DIR}/tests-v2/featuretests) file(GLOB GTEST_MAIN_SRC_FILE ${GTEST_MAIN_DIR}/gtests_main.cpp) set_source_files_properties(apps/multithreaded_testapp.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(multithreaded_testapp apps/multithreaded_testapp.cpp ../utils/test_utils.cpp) -target_include_directories(multithreaded_testapp PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/featuretests/profiler/apps) +target_include_directories(multithreaded_testapp PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/profiler/apps) target_link_libraries(multithreaded_testapp hsa-runtime64::hsa-runtime64 Threads::Threads dl stdc++fs amd_comgr) -set_target_properties(multithreaded_testapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") +set_target_properties(multithreaded_testapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") target_link_options(multithreaded_testapp PRIVATE "-Wl,--build-id=md5") install(TARGETS multithreaded_testapp RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) add_dependencies(tests multithreaded_testapp) @@ -126,38 +126,38 @@ function(generate_hsaco TARGET_ID INPUT_FILE OUTPUT_FILE) separate_arguments(CLANG_ARG_LIST UNIX_COMMAND "-O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 -Wl,--build-id=sha1 -target amdgcn-amd-amdhsa -mcpu=${TARGET_ID} -o ${OUTPUT_FILE} ${INPUT_FILE}") - add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${OUTPUT_FILE} + add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${OUTPUT_FILE} COMMAND clang ${CLANG_ARG_LIST} - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/ + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/ DEPENDS ${INPUT_FILE} clang COMMENT "Building ${OUTPUT_FILE}..." - -E copy ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${OUTPUT_FILE} ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${target_id}_copy.hsaco + -E copy ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${OUTPUT_FILE} ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${target_id}_copy.hsaco VERBATIM) - set(HSACO_TARGET_LIST ${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${OUTPUT_FILE} PARENT_SCOPE) + set(HSACO_TARGET_LIST ${HSACO_TARGET_LIST} ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${OUTPUT_FILE} PARENT_SCOPE) endfunction(generate_hsaco) set(GPU_LIST "gfx900" "gfx906" "gfx908" "gfx90a" "gfx1030" "gfx1100") foreach(target_id ${GPU_LIST}) ## generate kernel bitcodes generate_hsaco(${target_id} ${CMAKE_CURRENT_SOURCE_DIR}/apps/copy.cl ${target_id}_copy.hsaco) -# install(FILES "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/${target_id}_copy.hsaco" -# DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests" -# COMPONENT tests) +install(FILES "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/${target_id}_copy.hsaco" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests" + COMPONENT tests) endforeach(target_id) add_custom_target(hsaco_targets DEPENDS ${HSACO_TARGET_LIST}) add_executable(multiqueue_testapp apps/multiqueue_testapp.cpp) - target_include_directories(multiqueue_testapp PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests/featuretests/profiler) + target_include_directories(multiqueue_testapp PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/profiler) # Link test executable against gtest & gtest_main target_link_libraries(multiqueue_testapp PRIVATE rocprofiler-v2 hsa-runtime64::hsa-runtime64 GTest::gtest GTest::gtest_main stdc++fs Threads::Threads amd_comgr dl) add_dependencies(multiqueue_testapp hsaco_targets) add_dependencies(tests multiqueue_testapp ) - set_target_properties(multiqueue_testapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps") + set_target_properties(multiqueue_testapp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps") install(TARGETS multiqueue_testapp RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/profiler/apps COMPONENT tests) # add_executable(profiler_multiqueue_test discretetests/binary/multiqueue_test.cpp utils/csv_parser.cpp utils/test_utils.cpp) -# target_include_directories(profiler_multiqueue_test PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests/featuretests/profiler) +# target_include_directories(profiler_multiqueue_test PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/profiler) # target_link_libraries(profiler_multiqueue_test PRIVATE hsa-runtime64::hsa-runtime64 Threads::Threads dl stdc++fs amd_comgr) # add_dependencies(tests profiler_multiqueue_test) @@ -171,15 +171,15 @@ hip_add_executable(runFeatureTests profiler_gtest.cpp ${TEST_UTILS_SRC_FILES} ) -target_include_directories(runFeatureTests PRIVATE ${TEST_DIR} - ${ROOT_DIR} - ${HSA_RUNTIME_INC_PATH} - ${PROJECT_SOURCE_DIR} - ${PROJECT_SOURCE_DIR}/tests/featuretests/profiler) +target_include_directories(runFeatureTests PRIVATE ${TEST_DIR} + ${ROOT_DIR} + ${HSA_RUNTIME_INC_PATH} + ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/profiler) # Link test executable against gtest & gtest_main target_link_libraries(runFeatureTests PRIVATE rocprofiler-v2 hsa-runtime64::hsa-runtime64 - GTest::gtest GTest::gtest_main + GTest::gtest GTest::gtest_main Threads::Threads dl stdc++fs amd_comgr) add_dependencies(tests runFeatureTests) target_link_options(runFeatureTests PRIVATE "-Wl,--build-id=md5") @@ -187,9 +187,9 @@ install(TARGETS runFeatureTests RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} add_test(AllTests runFeatureTests) # Copy scripts, input files to samples folder -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/basic_metrics.txt ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/input.txt ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/mpi_run.sh ${PROJECT_BINARY_DIR}/tests/featuretests/profiler/apps/ COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/basic_metrics.txt ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/input.txt ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/mpi_run.sh ${PROJECT_BINARY_DIR}/tests-v2/featuretests/profiler/apps/ COPYONLY) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/ diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/async_mem_copy.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/async_mem_copy.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/async_mem_copy.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/async_mem_copy.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/copy.cl b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/copy.cl similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/copy.cl rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/copy.cl diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/basic_metrics.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/basic_metrics.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/basic_metrics.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/basic_metrics.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hip_helloworld_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hip_helloworld_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hip_helloworld_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hip_helloworld_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hip_vectoradd_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hip_vectoradd_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hip_vectoradd_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hip_vectoradd_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hsa_async_mem_copy_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hsa_async_mem_copy_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/hsa_async_mem_copy_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/hsa_async_mem_copy_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/input.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/input.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/input.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/input.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/mpi_vectoradd_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/mpi_vectoradd_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/mpi_vectoradd_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/mpi_vectoradd_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/openmp_helloworld_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/openmp_helloworld_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/goldentraces/openmp_helloworld_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/goldentraces/openmp_helloworld_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/hello_world_hip.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/hello_world_hip.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/hello_world_hip.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/hello_world_hip.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/hello_world_omp.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/hello_world_omp.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/hello_world_omp.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/hello_world_omp.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/mpi_run.sh b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/mpi_run.sh similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/mpi_run.sh rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/mpi_run.sh diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/multiqueue_testapp.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/multiqueue_testapp.cpp similarity index 99% rename from projects/rocprofiler/tests/featuretests/profiler/apps/multiqueue_testapp.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/multiqueue_testapp.cpp index 53b7e3e197..63adb0cf53 100644 --- a/projects/rocprofiler/tests/featuretests/profiler/apps/multiqueue_testapp.cpp +++ b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/multiqueue_testapp.cpp @@ -336,7 +336,7 @@ static void init_test_path() { test_app_path = "share/rocprofiler/tests/featuretests/profiler/apps/"; hasco_path = "share/rocprofiler/tests/"; } else { - test_app_path = "tests/featuretests/profiler/apps/"; - hasco_path = "tests/featuretests/profiler/"; + test_app_path = "tests-v2/featuretests/profiler/apps/"; + hasco_path = "tests-v2/featuretests/profiler/"; } } diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/multiqueue_testapp.h b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/multiqueue_testapp.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/multiqueue_testapp.h rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/multiqueue_testapp.h diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/multithreaded_testapp.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/multithreaded_testapp.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/multithreaded_testapp.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/multithreaded_testapp.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/vector_add_hip.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/vector_add_hip.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/vector_add_hip.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/vector_add_hip.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/apps/vector_add_mpi.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/apps/vector_add_mpi.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/apps/vector_add_mpi.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/apps/vector_add_mpi.cpp diff --git a/projects/rocprofiler/tests/featuretests/profiler/profiler_gtest.cpp b/projects/rocprofiler/tests-v2/featuretests/profiler/profiler_gtest.cpp similarity index 99% rename from projects/rocprofiler/tests/featuretests/profiler/profiler_gtest.cpp rename to projects/rocprofiler/tests-v2/featuretests/profiler/profiler_gtest.cpp index baaba65571..0209eaa0a4 100644 --- a/projects/rocprofiler/tests/featuretests/profiler/profiler_gtest.cpp +++ b/projects/rocprofiler/tests-v2/featuretests/profiler/profiler_gtest.cpp @@ -53,10 +53,10 @@ static void init_test_path() { metrics_path = "lib/rocprofiler/gfx_metrics.xml"; binary_path = "bin/rocprofv2"; } else { - running_path = "tests/featuretests/profiler/runFeatureTests"; + running_path = "tests-v2/featuretests/profiler/runFeatureTests"; lib_path = "librocprofiler_tool.so"; - golden_trace_path = "tests/featuretests/profiler/apps/goldentraces/"; - test_app_path = "tests/featuretests/profiler/apps/"; + golden_trace_path = "tests-v2/featuretests/profiler/apps/goldentraces/"; + test_app_path = "tests-v2/featuretests/profiler/apps/"; metrics_path = "gfx_metrics.xml"; binary_path = "rocprofv2"; } diff --git a/projects/rocprofiler/tests/featuretests/profiler/profiler_gtest.h b/projects/rocprofiler/tests-v2/featuretests/profiler/profiler_gtest.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/profiler/profiler_gtest.h rename to projects/rocprofiler/tests-v2/featuretests/profiler/profiler_gtest.h diff --git a/projects/rocprofiler/tests/featuretests/tracer/CMakeLists.txt b/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt similarity index 82% rename from projects/rocprofiler/tests/featuretests/tracer/CMakeLists.txt rename to projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt index a61828e878..99c61a1e88 100644 --- a/projects/rocprofiler/tests/featuretests/tracer/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/featuretests/tracer/CMakeLists.txt @@ -15,24 +15,24 @@ find_package(GTest REQUIRED) # installing the golden traces file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "apps/goldentraces/*.txt") foreach(file ${files}) - configure_file(${file} ${PROJECT_BINARY_DIR}/tests/featuretests/tracer/${file} COPYONLY) + configure_file(${file} ${PROJECT_BINARY_DIR}/tests-v2/featuretests/tracer/${file} COPYONLY) endforeach() -set(TEST_UTILS_DIR ${PROJECT_SOURCE_DIR}/tests/featuretests/utils) +set(TEST_UTILS_DIR ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/utils) file(GLOB TEST_UTILS_SRC_FILES ${TEST_UTILS_DIR}/*.cpp) -set(GTEST_MAIN_DIR ${PROJECT_SOURCE_DIR}/tests/featuretests) +set(GTEST_MAIN_DIR ${PROJECT_SOURCE_DIR}/tests-v2/featuretests) file(GLOB GTEST_MAIN_SRC_FILE ${GTEST_MAIN_DIR}/*.cpp) # Compile Applications # hip_helloworld set_source_files_properties(apps/hello_world.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(tracer_hip_helloworld apps/hello_world.cpp) -set_target_properties(tracer_hip_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/tracer/apps") +set_target_properties(tracer_hip_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/tracer/apps") #hsa-mem_async_copy and async_copy_on_engine set_source_files_properties(apps/copy_on_engine.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_add_executable(copy_on_engine apps/copy_on_engine.cpp) -set_target_properties(copy_on_engine PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/featuretests/tracer/apps") +set_target_properties(copy_on_engine PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/tracer/apps") target_link_options(copy_on_engine PRIVATE "-Wl,--build-id=md5") install(TARGETS copy_on_engine RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/tracer/apps COMPONENT tests) target_link_libraries(copy_on_engine hsa-runtime64::hsa-runtime64 Threads::Threads dl stdc++fs) @@ -44,8 +44,8 @@ add_executable(runTracerFeatureTests tracer_gtest.cpp ) # Link test executable against gtest & gtest_main -target_include_directories(runTracerFeatureTests PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests/featuretests/tracer) +target_include_directories(runTracerFeatureTests PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/tests-v2/featuretests/tracer) target_link_libraries(runTracerFeatureTests PRIVATE hsa-runtime64::hsa-runtime64 - GTest::gtest GTest::gtest_main + GTest::gtest GTest::gtest_main Threads::Threads dl stdc++fs) add_dependencies(tests runTracerFeatureTests) diff --git a/projects/rocprofiler/tests/featuretests/tracer/apps/copy_on_engine.cpp b/projects/rocprofiler/tests-v2/featuretests/tracer/apps/copy_on_engine.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/tracer/apps/copy_on_engine.cpp rename to projects/rocprofiler/tests-v2/featuretests/tracer/apps/copy_on_engine.cpp diff --git a/projects/rocprofiler/tests/featuretests/tracer/apps/goldentraces/hip_helloworld_golden_traces.txt b/projects/rocprofiler/tests-v2/featuretests/tracer/apps/goldentraces/hip_helloworld_golden_traces.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/tracer/apps/goldentraces/hip_helloworld_golden_traces.txt rename to projects/rocprofiler/tests-v2/featuretests/tracer/apps/goldentraces/hip_helloworld_golden_traces.txt diff --git a/projects/rocprofiler/tests/featuretests/tracer/apps/goldentraces/hsa_api_async_trace.txt b/projects/rocprofiler/tests-v2/featuretests/tracer/apps/goldentraces/hsa_api_async_trace.txt similarity index 100% rename from projects/rocprofiler/tests/featuretests/tracer/apps/goldentraces/hsa_api_async_trace.txt rename to projects/rocprofiler/tests-v2/featuretests/tracer/apps/goldentraces/hsa_api_async_trace.txt diff --git a/projects/rocprofiler/tests/featuretests/tracer/apps/hello_world.cpp b/projects/rocprofiler/tests-v2/featuretests/tracer/apps/hello_world.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/tracer/apps/hello_world.cpp rename to projects/rocprofiler/tests-v2/featuretests/tracer/apps/hello_world.cpp diff --git a/projects/rocprofiler/tests/featuretests/tracer/tracer_gtest.cpp b/projects/rocprofiler/tests-v2/featuretests/tracer/tracer_gtest.cpp similarity index 98% rename from projects/rocprofiler/tests/featuretests/tracer/tracer_gtest.cpp rename to projects/rocprofiler/tests-v2/featuretests/tracer/tracer_gtest.cpp index f72937db46..1be79e6daf 100644 --- a/projects/rocprofiler/tests/featuretests/tracer/tracer_gtest.cpp +++ b/projects/rocprofiler/tests-v2/featuretests/tracer/tracer_gtest.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. * Sets application enviornment by seting HSA_TOOLS_LIB. */ void ApplicationParser::SetApplicationEnv(const char* app_name, const char* trace_option) { - std::string app_path = GetRunningPath("tests/featuretests/tracer/runTracerFeatureTests"); + std::string app_path = GetRunningPath("tests-v2/featuretests/tracer/runTracerFeatureTests"); std::stringstream hsa_tools_lib_path; hsa_tools_lib_path << app_path << "librocprofiler_tool.so"; @@ -50,7 +50,7 @@ void ApplicationParser::SetApplicationEnv(const char* app_name, const char* trac std::stringstream os; - os << app_path << "tests/featuretests/tracer/apps/" << app_name; + os << app_path << "tests-v2/featuretests/tracer/apps/" << app_name; ProcessApplication(os); } diff --git a/projects/rocprofiler/tests/featuretests/tracer/tracer_gtest.h b/projects/rocprofiler/tests-v2/featuretests/tracer/tracer_gtest.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/tracer/tracer_gtest.h rename to projects/rocprofiler/tests-v2/featuretests/tracer/tracer_gtest.h diff --git a/projects/rocprofiler/tests/featuretests/utils/csv_parser.cpp b/projects/rocprofiler/tests-v2/featuretests/utils/csv_parser.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/utils/csv_parser.cpp rename to projects/rocprofiler/tests-v2/featuretests/utils/csv_parser.cpp diff --git a/projects/rocprofiler/tests/featuretests/utils/csv_parser.h b/projects/rocprofiler/tests-v2/featuretests/utils/csv_parser.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/utils/csv_parser.h rename to projects/rocprofiler/tests-v2/featuretests/utils/csv_parser.h diff --git a/projects/rocprofiler/tests/featuretests/utils/test_helper.h b/projects/rocprofiler/tests-v2/featuretests/utils/test_helper.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/utils/test_helper.h rename to projects/rocprofiler/tests-v2/featuretests/utils/test_helper.h diff --git a/projects/rocprofiler/tests/featuretests/utils/test_utils.cpp b/projects/rocprofiler/tests-v2/featuretests/utils/test_utils.cpp similarity index 100% rename from projects/rocprofiler/tests/featuretests/utils/test_utils.cpp rename to projects/rocprofiler/tests-v2/featuretests/utils/test_utils.cpp diff --git a/projects/rocprofiler/tests/featuretests/utils/test_utils.h b/projects/rocprofiler/tests-v2/featuretests/utils/test_utils.h similarity index 100% rename from projects/rocprofiler/tests/featuretests/utils/test_utils.h rename to projects/rocprofiler/tests-v2/featuretests/utils/test_utils.h diff --git a/projects/rocprofiler/tests-v2/memorytests/CMakeLists.txt b/projects/rocprofiler/tests-v2/memorytests/CMakeLists.txt new file mode 100644 index 0000000000..6732321763 --- /dev/null +++ b/projects/rocprofiler/tests-v2/memorytests/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file(run_asan_tests.sh ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY) +configure_file(suppr.txt ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY) +configure_file(test_mem.py ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY) +configure_file(input.txt ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY) \ No newline at end of file diff --git a/projects/rocprofiler/tests/memorytests/input.txt b/projects/rocprofiler/tests-v2/memorytests/input.txt similarity index 100% rename from projects/rocprofiler/tests/memorytests/input.txt rename to projects/rocprofiler/tests-v2/memorytests/input.txt diff --git a/projects/rocprofiler/tests/memorytests/run_asan_tests.sh b/projects/rocprofiler/tests-v2/memorytests/run_asan_tests.sh similarity index 100% rename from projects/rocprofiler/tests/memorytests/run_asan_tests.sh rename to projects/rocprofiler/tests-v2/memorytests/run_asan_tests.sh diff --git a/projects/rocprofiler/tests/memorytests/suppr.txt b/projects/rocprofiler/tests-v2/memorytests/suppr.txt similarity index 100% rename from projects/rocprofiler/tests/memorytests/suppr.txt rename to projects/rocprofiler/tests-v2/memorytests/suppr.txt diff --git a/projects/rocprofiler/tests/memorytests/test_mem.py b/projects/rocprofiler/tests-v2/memorytests/test_mem.py similarity index 100% rename from projects/rocprofiler/tests/memorytests/test_mem.py rename to projects/rocprofiler/tests-v2/memorytests/test_mem.py diff --git a/projects/rocprofiler/tests/microbenchmarks/CMakeLists.txt b/projects/rocprofiler/tests-v2/microbenchmarks/CMakeLists.txt similarity index 89% rename from projects/rocprofiler/tests/microbenchmarks/CMakeLists.txt rename to projects/rocprofiler/tests-v2/microbenchmarks/CMakeLists.txt index 524b4f8b46..c97dbd4958 100644 --- a/projects/rocprofiler/tests/microbenchmarks/CMakeLists.txt +++ b/projects/rocprofiler/tests-v2/microbenchmarks/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROCM_PATH}/lib/cmake/hip") set(CMAKE_HIP_ARCHITECTURES OFF) find_package(HIP REQUIRED MODULE) -set(TEST_DIR ${PROJECT_SOURCE_DIR}/tests/microbenchmarks) +set(TEST_DIR ${PROJECT_SOURCE_DIR}/tests-v2/microbenchmarks) file(GLOB TEST_SRC_FILE ${TEST_DIR}/*.cpp) set_source_files_properties(${TEST_SRC_FILE} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) @@ -16,5 +16,5 @@ hip_add_executable(pcie_bw_test ${TEST_SRC_FILE}) target_link_libraries(pcie_bw_test PRIVATE rocm_smi64) target_link_options(pcie_bw_test PRIVATE "-Wl,--build-id=md5") -set_target_properties(pcie_bw_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/microbenchmarks") +set_target_properties(pcie_bw_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/microbenchmarks") install(TARGETS pcie_bw_test RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/microbenchmarks COMPONENT tests) \ No newline at end of file diff --git a/projects/rocprofiler/tests/microbenchmarks/pcie_bw_test.cpp b/projects/rocprofiler/tests-v2/microbenchmarks/pcie_bw_test.cpp similarity index 100% rename from projects/rocprofiler/tests/microbenchmarks/pcie_bw_test.cpp rename to projects/rocprofiler/tests-v2/microbenchmarks/pcie_bw_test.cpp diff --git a/projects/rocprofiler/tests/run_tests.sh b/projects/rocprofiler/tests-v2/run_tests.sh similarity index 52% rename from projects/rocprofiler/tests/run_tests.sh rename to projects/rocprofiler/tests-v2/run_tests.sh index d120fef0d7..9d860271d9 100755 --- a/projects/rocprofiler/tests/run_tests.sh +++ b/projects/rocprofiler/tests-v2/run_tests.sh @@ -5,10 +5,10 @@ CURRENT_DIR="$( dirname -- "$0"; )"; echo -e "Running Profiler Tests" echo -e "running unit tests for rocprofiler" -eval ${CURRENT_DIR}/tests/unittests/runUnitTests +eval ${CURRENT_DIR}/tests-v2/unittests/runUnitTests echo -e "running feature tests for rocprofiler" -eval ${CURRENT_DIR}/tests/featuretests/profiler/runFeatureTests +eval ${CURRENT_DIR}/tests-v2/featuretests/profiler/runFeatureTests echo -e "Running Tracer Tests" -eval ${CURRENT_DIR}/tests/featuretests/tracer/runTracerFeatureTests \ No newline at end of file +eval ${CURRENT_DIR}/tests-v2/featuretests/tracer/runTracerFeatureTests \ No newline at end of file diff --git a/projects/rocprofiler/tests/unittests/CMakeLists.txt b/projects/rocprofiler/tests-v2/unittests/CMakeLists.txt similarity index 100% rename from projects/rocprofiler/tests/unittests/CMakeLists.txt rename to projects/rocprofiler/tests-v2/unittests/CMakeLists.txt diff --git a/projects/rocprofiler/tests/unittests/profiler_gtest.cpp b/projects/rocprofiler/tests-v2/unittests/profiler_gtest.cpp similarity index 100% rename from projects/rocprofiler/tests/unittests/profiler_gtest.cpp rename to projects/rocprofiler/tests-v2/unittests/profiler_gtest.cpp diff --git a/projects/rocprofiler/tests/memorytests/CMakeLists.txt b/projects/rocprofiler/tests/memorytests/CMakeLists.txt deleted file mode 100644 index 64058fd880..0000000000 --- a/projects/rocprofiler/tests/memorytests/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -configure_file(run_asan_tests.sh ${PROJECT_BINARY_DIR}/tests/memorytests COPYONLY) -configure_file(suppr.txt ${PROJECT_BINARY_DIR}/tests/memorytests COPYONLY) -configure_file(test_mem.py ${PROJECT_BINARY_DIR}/tests/memorytests COPYONLY) -configure_file(input.txt ${PROJECT_BINARY_DIR}/tests/memorytests COPYONLY) \ No newline at end of file