Files
rocm-systems/catch/CMakeLists.txt
T
sumanthtg 9798817ca0 SWDEV-238517 - [dtest] Catch2 multiprocess tests for device files.
Changes contain Catch2 device multiprocess tests which were covered under "hip/tests/src/runtimeApi/device" and some additional tests. These test files makes use of fork call or sets visible devices env variable and validates various device aspects.

Change-Id: Iaaca37598d386104da9e5f37f92ab176bc8a2845
2021-07-13 08:42:41 -04:00

78 lines
1.8 KiB
CMake

# Set HIP Path
if(NOT DEFINED HIP_PATH)
if(DEFINED ENV{HIP_PATH})
set(HIP_PATH $ENV{HIP_PATH} CACHE STRING "HIP Path")
else()
set(HIP_PATH "${PROJECT_BINARY_DIR}")
endif()
endif()
message(STATUS "HIP Path: ${HIP_PATH}")
set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc")
if(NOT DEFINED CATCH2_PATH)
if(DEFINED ENV{CATCH2_PATH})
set(CATCH2_PATH $ENV{CATCH2_PATH} CACHE STRING "Catch2 Path")
else()
set(CATCH2_PATH "${CMAKE_CURRENT_LIST_DIR}/external/Catch2")
endif()
endif()
message(STATUS "Catch2 Path: ${CATCH2_PATH}")
# Set JSON Parser path
if(NOT DEFINED JSON_PARSER)
if(DEFINED ENV{JSON_PARSER})
set(JSON_PARSER $ENV{JSON_PARSER} CACHE STRING "JSON Parser Path")
else()
set(JSON_PARSER "${CMAKE_CURRENT_LIST_DIR}/external/picojson")
endif()
endif()
message(STATUS "Searching Catch2 in: ${CMAKE_CURRENT_LIST_DIR}/external")
find_package(Catch2 REQUIRED
PATHS
${CMAKE_CURRENT_LIST_DIR}/external
PATH_SUFFIXES
Catch2/cmake/Catch2
)
include(Catch)
include(CTest)
include_directories(
${CATCH2_PATH}
"./include"
${HIP_PATH}/include
${JSON_PARSER}
)
if(HIP_PLATFORM MATCHES "amd" AND HIP_COMPILER MATCHES "clang")
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()
cmake_policy(PUSH)
if(POLICY CMP0037)
cmake_policy(SET CMP0037 OLD)
endif()
# Use clang as host compiler with nvcc
if(HIP_COMPILER MATCHES "nvcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ccbin clang")
endif()
# Disable CXX extensions (gnu++11 etc)
set(CMAKE_CXX_EXTENSIONS OFF)
add_custom_target(build_tests)
# Tests folder
add_subdirectory(unit)
add_subdirectory(ABM)
add_subdirectory(hipTestMain)
add_subdirectory(stress)
if(UNIX)
add_subdirectory(multiproc)
endif()
cmake_policy(POP)