Skip to content

Commit 68e5519

Browse files
committed
fix: release compiler flags
1 parent d473151 commit 68e5519

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

CMakePresets.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@
2929
"CMAKE_BUILD_TYPE": "Release",
3030
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
3131
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/build/Release/generators/conan_toolchain.cmake",
32-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO"
32+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -O3 -flto -march=native -ffast-math -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO"
33+
}
34+
},
35+
{
36+
"name": "superfast",
37+
"description": "-Ofast removes some IEEE compliance rules, -fomit-frame-pointer hurts profiling, -fno-exceptions and -fno-rtti need more consideration, -funsafe-math-optimizations speaks for itself",
38+
"inherits": "release",
39+
"cacheVariables": {
40+
"CMAKE_BUILD_TYPE": "Release",
41+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
42+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/build/Release/generators/conan_toolchain.cmake",
43+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Ofast -flto -march=native -ffast-math -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO"
3344
}
3445
}
3546
],
@@ -43,6 +54,11 @@
4354
"name": "release",
4455
"configurePreset": "release",
4556
"jobs": 0
57+
},
58+
{
59+
"name": "superfast",
60+
"configurePreset": "superfast",
61+
"jobs": 0
4662
}
4763
],
4864
"testPresets": [
@@ -59,6 +75,13 @@
5975
"output": {
6076
"outputOnFailure": true
6177
}
78+
},
79+
{
80+
"name": "superfast",
81+
"configurePreset": "superfast",
82+
"output": {
83+
"outputOnFailure": true
84+
}
6285
}
6386
]
6487
}

scripts/pin_cpus.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ if [[ ! -d "$GROUP_PATH" ]]; then
8787
echo "created cpuset directory. path [$GROUP_PATH]"
8888
fi
8989

90+
if [[ $CGROUP_VERSION -eq 2 ]]; then
91+
echo "+cpuset" > "$BASE_CGROUP/cgroup.subtree_control" 2>/dev/null || true
92+
echo "+cpuset" > "$GROUP_PATH/cgroup.subtree_control"
93+
fi
94+
9095
# write CPUs
9196
CPU_FILE="$GROUP_PATH/cpuset.cpus"
9297
echo "$CPU_SET_RANGE" > "$CPU_FILE"

0 commit comments

Comments
 (0)