Skip to content

Commit

Permalink
Add ROCm, create one github_runner-[device].yaml file per device; rem…
Browse files Browse the repository at this point in the history
…ove debugging info from CMakeLists.txt
  • Loading branch information
therault committed Jun 22, 2023
1 parent 8bf48e3 commit 1ffaec0
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 17 deletions.
27 changes: 27 additions & 0 deletions .github/CI/github_runner-cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
spack:
definitions:
- pkgs:
- gcc@12.1.0
- git
- patch
- flex
- bison
- hwloc
- unzip
- python@3
- py-pip
- py-pandas
- py-matplotlib
- py-tables
- py-networkx
- py-cython
- py-wheel
- cmake
- ninja
- otf2@2.3
- openmpi

view: true
specs:
- matrix:
- [$pkgs]
28 changes: 28 additions & 0 deletions .github/CI/github_runner-gpu_amd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
spack:
definitions:
- pkgs:
- gcc@11.3.0
- git
- rocm@5.4.3
- patch
- flex
- bison
- hwloc
- unzip
- python@3
- py-pip
- py-pandas
- py-matplotlib
- py-tables
- py-networkx
- py-cython
- py-wheel
- cmake
- ninja
- otf2@2.3
- openmpi

view: true
specs:
- matrix:
- [$pkgs]
File renamed without changes.
8 changes: 5 additions & 3 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ jobs:
build_type : [ Debug ]
shared_type : [ OFF, ON ]
profiling : [ ON ]
device : [cpu, gpu_nvidia]
device : [cpu, gpu_nvidia, gpu_amd]

runs-on: ${{matrix.device}}

name: "Type=${{ matrix.build_type }} device=${{matrix.device}} shared=${{ matrix.shared_type }} profiling=${{matrix.profiling}}"
env:
BUILD_DIRECTORY : "${{github.workspace}}/build/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
INSTALL_DIRECTORY : "${{github.workspace}}/install/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
RUNNER_ENV : github_runner
RUNNER_ENV : github_runner-${{matrix.device}}
DEVICE_ENV : ${{matrix.device}}
BUILD_CONFIG : >
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
Expand Down Expand Up @@ -116,7 +117,8 @@ jobs:
env:
BUILD_DIRECTORY : "${{github.workspace}}/build/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
INSTALL_DIRECTORY : "${{github.workspace}}/install/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
RUNNER_ENV : github_runner
RUNNER_ENV : github_runner-${{matrix.device}}
DEVICE_ENV : ${{matrix.device}}
BUILD_CONFIG : >
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
Expand Down
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ mark_as_advanced(BUILD_PARSEC)
### Misc options
option(BUILD_SHARED_LIBS
"Build shared libraries" ON)
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif(BUILD_SHARED_LIBS)
option(BUILD_64bits
"Build 64 bits mode" ON)
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -718,20 +721,6 @@ int main(int argc, char *argv[]) {
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
if(BUILD_SHARED_LIBS)
list(APPEND CUDA_NVCC_FLAGS "--compiler-options -fPIE")
endif()
else(CMAKE_CUDA_COMPILER)
file(GLOB CUDA_TK_BIN_LS RELATIVE ${CUDAToolkit_BIN_DIR} ${CUDAToolkit_BIN_DIR}/*)
message(WARNING "Was expecting to find nvcc in ${CUDAToolkit_BIN_DIR}. Here is the content of ${CUDAToolkit_BIN_DIR}: ${CUDA_TK_BIN_LS}.")
execute_process(COMMAND ${CUDAToolkit_BIN_DIR}/nvcc -c ${PROJECT_SOURCE_DIR}/tests/runtime/gpu/ping_kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/test.o
RESULT_VARIABLE _resvar
OUTPUT_VARIABLE _outvar
ECHO_OUTPUT_VARIABLE
COMMAND_ECHO STDOUT)
message(WARNING "Tried to call nvcc manually: result is '${_resvar}' and full output is above. Looking what log files are available with find ${CMAKE_BINAR_DIR}/CMakeFiles/ -type f:")
execute_process(COMMAND find ${CMAKE_BINARY_DIR}/CMakeFiles/ -print RESULT_VARIABLE _resvar OUTPUT_VARIABLE _outvar ECHO_OUTPUT_VARIABLE COMMAND_ECHO STDOUT)
message(FATAL_ERROR "Result of find command is ${_resvar}. Interrupting CMake.")
endif(CMAKE_CUDA_COMPILER)
cmake_pop_check_state()
endif (CUDAToolkit_FOUND)
Expand Down

0 comments on commit 1ffaec0

Please sign in to comment.