diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..0b93138d7ce3c33e879917ed936d155e93557249 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +stages: # List of stages for jobs, and their order of execution + - build + - test + + +build-job: # This job runs in the build stage, which runs first. + stage: build + before_script: + - module load spack + - module load cmake + tags: + - das6-gpu + script: + - cmake -B build . + - make -C build + +collect-performance: # This job runs in the test stage. + tags: + - das6-gpu + stage: test # It only starts when the job in the build stage completes successfully. + dependencies: + - build-job + before_script: + - module load spack + - module load cmake + script: + - cmake -B build . + - make -C build + - build/microbenchmarks --benchmark_out=results.json --benchmark_out_format=json + artifacts: + paths: + - ./results.json + untracked: false + when: on_success + access: all + expire_in: 1 days + diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b11e760680e564b17d8a5062ff8b9abae78420b..b7497cfcd561b71d23bb1c86549be6f4b7899a15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,19 @@ cmake_minimum_required(VERSION 3.14) project(microbenchmarks) -# Require C++11 +# Require C++17 set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) -set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE INTERNAL "Download GTest sources") +set(BENCHMARK_ENABLE_GTEST_TESTS + OFF + CACHE INTERNAL "Download GTest sources") include(FetchContent) FetchContent_Declare( googlebenchmark GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG v1.8.3 # Optionally specify the exact tag or commit to fetch - CMAKE_ARGS "-DBENCHMARK_DOWNLOAD_DEPENDENCIES=True" -) - + GIT_TAG v1.8.3 # Optionally specify the exact tag or commit to fetch + CMAKE_ARGS "-DBENCHMARK_DOWNLOAD_DEPENDENCIES=True") # Make the fetched content available. FetchContent_MakeAvailable(googlebenchmark) @@ -23,4 +23,4 @@ add_executable(microbenchmarks benchmarks/matrix_multiplication.cpp) # Link against Google Benchmark target_link_libraries(microbenchmarks benchmark::benchmark) -target_compile_options(microbenchmarks PUBLIC "-O3;-march=native;-ggdb;") \ No newline at end of file +target_compile_options(microbenchmarks PUBLIC "-O3;-march=native;-ggdb;")