Skip to content

Commit

Permalink
Reworking reduction
Browse files Browse the repository at this point in the history
Reworked reduction to connect cancelation to the secondary task (it was detached in the prior version).
As a side benefit, I eliminated double type erasure on all packaged tasks, reducing the invocation overhead and eliminating a heap allocation for large tasks.

To-do before moving from draft PR - write unit tests to check cancelation points work correctly.
  • Loading branch information
sean-parent committed Nov 24, 2024
1 parent 1cd251b commit b5bec0b
Show file tree
Hide file tree
Showing 2 changed files with 305 additions and 283 deletions.
221 changes: 122 additions & 99 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,102 +1,125 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 12,
"patch": 0
},
"configurePresets": [
{
"name": "hyde-build-docs",
"description": "Build documentation",
"hidden": false,
"binaryDir": "${sourceDir}/../build/hyde",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"BUILD_TESTING": "OFF",
"STLAB_MAIN_EXECUTOR": "none",
"STLAB_NO_STD_COROUTINES": "ON",
"STLAB_TASK_SYSTEM": "portable",
"STLAB_THREAD_SYSTEM": "pthread",
"stlab.coverage": "OFF"
}
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 12,
"patch": 0
},
{
"name": "ninja-cpp20-debug-thread-undefined",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-thread-undefined",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=thread -fsanitize=undefined",
"CMAKE_LINKER_FLAGS": "-fsanitize=thread -fsanitize=undefined"
}
},
{
"name": "ninja-cpp17-debug",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp17-debug",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "ninja-cpp20-debug-address",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-address",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=address",
"CMAKE_LINKER_FLAGS": "-fsanitize=address",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "clang-tidy-fix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-fix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--fix"
}
},
{
"name": "clang-tidy-nofix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-nofix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy"
}
}
],
"buildPresets": [
{
"name": "clang-tidy-fix",
"configurePreset": "clang-tidy-fix",
"jobs": 1
},
{
"name": "clang-tidy-nofix",
"configurePreset": "clang-tidy-nofix"
}
]
"configurePresets": [
{
"name": "hyde-build-docs",
"description": "Build documentation",
"hidden": false,
"binaryDir": "${sourceDir}/../build/hyde",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"BUILD_TESTING": "OFF",
"STLAB_MAIN_EXECUTOR": "none",
"STLAB_NO_STD_COROUTINES": "ON",
"STLAB_TASK_SYSTEM": "portable",
"STLAB_THREAD_SYSTEM": "pthread",
"stlab.coverage": "OFF"
}
},
{
"name": "ninja-cpp20-debug-thread-undefined",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-thread-undefined",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=thread -fsanitize=undefined",
"CMAKE_LINKER_FLAGS": "-fsanitize=thread -fsanitize=undefined"
}
},
{
"name": "xcode-cpp20-debug",
"description": "",
"hidden": false,
"generator": "Xcode",
"binaryDir": "${sourceDir}/../build/xcode-cpp20-debug",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON"
}
},
{
"name": "ninja-cpp17-debug",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp17-debug",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "ninja-cpp20-debug-address",
"description": "Ninja Debug Build",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/ninja-cpp20-debug-address",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_FLAGS": "-fsanitize=address",
"CMAKE_LINKER_FLAGS": "-fsanitize=address",
"CMAKE_VERBOSE_MAKEFILE": "ON"
}
},
{
"name": "clang-tidy-fix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-fix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--fix"
}
},
{
"name": "clang-tidy-nofix",
"hidden": false,
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build/clang-tidy-nofix",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17",
"CMAKE_BUILD_TYPE": "DEBUG",
"BUILD_TESTING": "ON",
"CMAKE_CXX_CLANG_TIDY": "clang-tidy"
}
}
],
"buildPresets": [
{
"name": "clang-tidy-fix",
"configurePreset": "clang-tidy-fix",
"jobs": 1
},
{
"name": "clang-tidy-nofix",
"configurePreset": "clang-tidy-nofix"
}
],
"testPresets": [
{
"name": "c++20-debug-tsan-ubsan-verbose",
"description": "",
"displayName": "",
"configurePreset": "ninja-cpp20-debug-thread-undefined",
"output":{
"verbosity": "verbose"
}
}
]
}
Loading

0 comments on commit b5bec0b

Please sign in to comment.