Skip to content

Commit d10da6f

Browse files
Adapting to C++17
1 parent 36ef864 commit d10da6f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

examples/resourceList/cpp/pthreads.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ int main(int argc, char **argv)
6464
for (auto computeResource : computeResourceList)
6565
{
6666
// Interpreting compute resource as core
67-
auto core = dynamic_pointer_cast<HiCR::backend::hwloc::ComputeResource>(computeResource);
67+
auto core = std::dynamic_pointer_cast<HiCR::backend::hwloc::ComputeResource>(computeResource);
6868

6969
// If the core affinity is included in the list, Add it to the list
70-
if (coreSubset.contains(core->getProcessorId())) selectedComputeResources.push_back(computeResource);
70+
if (coreSubset.find(core->getProcessorId()) != coreSubset.end()) selectedComputeResources.push_back(computeResource);
7171
}
7272

7373
// Initializing Boost-based compute manager to instantiate suspendable coroutines

include/taskr/runtime.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ class Runtime
184184
if (config.contains("Service Worker Count")) _serviceWorkerCount = hicr::json::getNumber<size_t>(config, "Service Worker Count");
185185
if (config.contains("Make Task Workers Run Services")) _makeTaskWorkersRunServices = hicr::json::getBoolean(config, "Make Task Workers Run Services");
186186
if (config.contains("Finish on Last Task")) _finishOnLastTask = hicr::json::getBoolean(config, "Finish On Last Task");
187+
188+
// Initial state
189+
_activeTaskCount = 0;
187190
}
188191

189192
// Destructor
@@ -856,7 +859,7 @@ class Runtime
856859
/**
857860
* Counter for the current number of active tasks. Execution finishes when this counter reaches zero
858861
*/
859-
std::atomic<size_t> _activeTaskCount = 0;
862+
std::atomic<size_t> _activeTaskCount;
860863

861864
/**
862865
* Common lock-free queue for ready tasks.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project('TaskR', [ 'cpp', 'c'],
22
subproject_dir : 'extern',
33
default_options : [
4-
'cpp_std=c++20',
4+
'cpp_std=c++17',
55
'buildtype=release'
66
],
77
version: '1.0.0'

0 commit comments

Comments
 (0)