Skip to content

Commit

Permalink
Reworking reduction (#551)
Browse files Browse the repository at this point in the history
* Reworking reduction

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.

Added unit test for future reduction cancelation.
  • Loading branch information
sean-parent authored Dec 3, 2024
1 parent 29a9216 commit 2821828
Show file tree
Hide file tree
Showing 3 changed files with 324 additions and 292 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;-header-filter=stlab/.*"
}
},
{
"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;-header-filter=stlab/.*"
}
}
],
"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 2821828

Please sign in to comment.