-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from tud-zih-energy/marenz.test-payload-genera…
…tion Infrastructure for Reference Tests
- Loading branch information
Showing
38 changed files
with
2,182 additions
and
389 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: ctest | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PYTHONUNBUFFERED: 1 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
|
||
- name: Install python3 | ||
run: | | ||
sudo apt update | ||
sudo apt install python3 | ||
- name: Create build directory | ||
run: | | ||
mkdir build | ||
- name: Run CMake configure (default) | ||
run: | | ||
cd build | ||
cmake .. | ||
- name: Build | ||
run: | | ||
cd build | ||
make -j4 | ||
- name: Ctest | ||
run: | | ||
cd build | ||
ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
include(CMakeDependentOption) | ||
|
||
# Set the different available FIRESTARTER builds. | ||
set(FIRESTARTER_BUILD_TYPE "FIRESTARTER" CACHE STRING "FIRESTARTER_BUILD_TYPE can be any of FIRESTARTER, FIRESTARTER_CUDA, FIRESTARTER_ONEAPI, or FIRESTARTER_HIP.") | ||
set_property(CACHE FIRESTARTER_BUILD_TYPE PROPERTY STRINGS FIRESTARTER FIRESTARTER_CUDA FIRESTARTER_ONEAPI FIRESTARTER_HIP) | ||
|
||
# Static linking is not supported with GPU devices or MacOS. | ||
if(${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") | ||
set(FIRESTARTER_LINK_STATIC "Link FIRESTARTER as a static binary. Note, dlopen is not supported in static binaries. This option is not available on macOS or with CUDA, OneAPI or HIP enabled." ON) | ||
endif() | ||
|
||
|
||
# We vendor hwloc per default. | ||
option(FIRESTARTER_BUILD_HWLOC "Build hwloc dependency." ON) | ||
|
||
|
||
# Use of thread affinity is enabled on linux per default. | ||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
set(FIRESTARTER_THREAD_AFFINITY "Enable FIRESTARTER to set affinity to hardware threads." ON) | ||
endif() | ||
|
||
|
||
# Debug feature are enabled on linux per default. | ||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
set(FIRESTARTER_DEBUG_FEATURES "Enable debug features" ON) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Dependent Linux features | ||
if(FIRESTARTER_LINK_STATIC) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIRESTARTER_LINK_STATIC") | ||
endif() | ||
|
||
if (FIRESTARTER_DEBUG_FEATURES) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIRESTARTER_DEBUG_FEATURES") | ||
endif() | ||
|
||
if (FIRESTARTER_THREAD_AFFINITY) | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIRESTARTER_THREAD_AFFINITY") | ||
endif() | ||
|
||
|
||
# Not MSVC | ||
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2 -fdata-sections -ffunction-sections") | ||
endif() | ||
|
||
|
||
# Darwin | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip") | ||
endif() | ||
|
||
|
||
# Not (Darwin or MSVC) | ||
# equivalent to Linux and Windows with mingw | ||
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")) | ||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") | ||
endif() | ||
|
||
|
||
# Linux | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
# enable position independant code on linux | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") | ||
endif() | ||
|
||
|
||
# Find packages, set the compiler and compile flags specific to the selected FIRESTARTER build. | ||
if(${FIRESTARTER_BUILD_TYPE} STREQUAL "FIRESTARTER") | ||
# No specific compiler selected | ||
elseif ("${FIRESTARTER_BUILD_TYPE}" STREQUAL "FIRESTARTER_CUDA") | ||
find_package(CUDAToolkit REQUIRED) | ||
include_directories(${CUDAToolkit_INCLUDE_DIRS}) | ||
|
||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIRESTARTER_BUILD_CUDA") | ||
elseif ("${FIRESTARTER_BUILD_TYPE}" STREQUAL "FIRESTARTER_ONEAPI") | ||
find_program(ICX_PATH icx REQUIRED) | ||
|
||
message(STATUS "Path of icx executable is: ${ICX_PATH}") | ||
|
||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -DFIRESTARTER_BUILD_ONEAPI") | ||
elseif("${FIRESTARTER_BUILD_TYPE}" STREQUAL "FIRESTARTER_HIP") | ||
if (NOT DEFINED ROCM_PATH ) | ||
set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) | ||
endif () | ||
|
||
# Search for rocm in common locations | ||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}/lib ${ROCM_PATH}) | ||
find_package(HIP REQUIRED) | ||
find_package(rocblas REQUIRED) | ||
find_package(rocrand REQUIRED) | ||
find_package(hiprand REQUIRED) | ||
find_package(hipblas REQUIRED) | ||
|
||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFIRESTARTER_BUILD_HIP") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
find_library( COREFOUNDATION_LIBRARY CoreFoundation ) | ||
find_library( IOKIT_LIBRARY IOKit ) | ||
endif() | ||
|
||
# Function to link against the correct libraries on darwin | ||
function(target_link_libraries_darwin) | ||
set(oneValueArgs NAME) | ||
cmake_parse_arguments(TARGET "" "${oneValueArgs}" | ||
"" ${ARGN} ) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
target_link_libraries(${TARGET_NAME} | ||
${COREFOUNDATION_LIBRARY} | ||
${IOKIT_LIBRARY} | ||
) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.