File tree Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Benchmarks
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ ubuntu-build :
7
+ name : Build - Ubuntu
8
+
9
+ strategy :
10
+ matrix :
11
+ os : ['ubuntu-22.04']
12
+ build_type : [Release]
13
+ compiler : [{c: gcc, cxx: g++}]
14
+ runs-on : ${{matrix.os}}
15
+
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Install apt packages
21
+ run : |
22
+ sudo apt-get update
23
+ sudo apt-get install -y cmake libnuma-dev
24
+
25
+ - name : Configure build
26
+ run : >
27
+ cmake
28
+ -B ${{github.workspace}}/build
29
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
30
+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
31
+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
32
+ -DUMF_BUILD_BENCHMARKS=ON
33
+ -DUMF_BUILD_TESTS=OFF
34
+ -DUMF_FORMAT_CODE_STYLE=OFF
35
+ -DUMF_DEVELOPER_MODE=OFF
36
+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
37
+ -DUMF_ENABLE_POOL_TRACKING=OFF
38
+
39
+ - name : Build UMF
40
+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
41
+
42
+ - name : Run benchmarks
43
+ working-directory : ${{github.workspace}}/build
44
+ run : ./benchmark/ubench 2>/dev/null
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ include(helpers)
18
18
option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
19
19
option (UMF_BUILD_LIBUMF_POOL_JEMALLOC "Build the libumf_pool_jemalloc static library" OFF )
20
20
option (UMF_BUILD_TESTS "Build UMF tests" ON )
21
+ option (UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF )
21
22
option (UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" ON )
22
23
option (UMF_DEVELOPER_MODE "Enable developer checks, treats warnings as errors" OFF )
23
24
option (UMF_FORMAT_CODE_STYLE "Format UMF code with clang-format" OFF )
@@ -75,8 +76,12 @@ add_subdirectory(src)
75
76
if (UMF_BUILD_TESTS )
76
77
add_subdirectory (test )
77
78
endif ()
78
- if (LINUX )
79
- add_subdirectory (benchmark )
79
+ if (UMF_BUILD_BENCHMARKS )
80
+ if (LINUX )
81
+ add_subdirectory (benchmark )
82
+ else ()
83
+ message (FATAL_ERROR "benchmarks are supported on Linux only" )
84
+ endif ()
80
85
endif ()
81
86
82
87
# Check if clang-format (in correct version) is available for code formatting.
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ List of options provided by CMake:
89
89
| UMF_BUILD_SHARED_LIBRARY | Build UMF as shared library | ON/OFF | OFF |
90
90
| UMF_BUILD_LIBUMF_POOL_JEMALLOC | Build the libumf_pool_jemalloc static library | ON/OFF | OFF |
91
91
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
92
+ | UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
92
93
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
93
94
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
94
95
| UMF_FORMAT_CODE_STYLE | Add clang-format-check and clang-format-apply targets to make | ON/OFF | OFF |
You can’t perform that action at this time.
0 commit comments