diff --git a/lib/pls/include/pls/internal/base/spin_lock.h b/lib/pls/include/pls/internal/base/spin_lock.h index 5acaf0a..cb87811 100644 --- a/lib/pls/include/pls/internal/base/spin_lock.h +++ b/lib/pls/include/pls/internal/base/spin_lock.h @@ -18,7 +18,7 @@ namespace pls { */ class spin_lock { std::atomic_flag flag_; - int yield_at_tries_; + unsigned int yield_at_tries_; public: diff --git a/lib/pls/include/pls/internal/helpers/mini_benchmark.h b/lib/pls/include/pls/internal/helpers/mini_benchmark.h index d153a32..dac7237 100644 --- a/lib/pls/include/pls/internal/helpers/mini_benchmark.h +++ b/lib/pls/include/pls/internal/helpers/mini_benchmark.h @@ -13,7 +13,7 @@ namespace pls { namespace helpers { // TODO: Clean up (separate into small functions and .cpp file) template - void run_mini_benchmark(const Function& lambda, size_t max_threads, long max_runtime_ms=1000) { + void run_mini_benchmark(const Function& lambda, size_t max_threads, unsigned long max_runtime_ms=1000) { using namespace std; using namespace pls::internal::scheduling; diff --git a/lib/pls/include/pls/internal/scheduling/abstract_task.h b/lib/pls/include/pls/internal/scheduling/abstract_task.h index 2531a1c..c239811 100644 --- a/lib/pls/include/pls/internal/scheduling/abstract_task.h +++ b/lib/pls/include/pls/internal/scheduling/abstract_task.h @@ -13,12 +13,12 @@ namespace pls { using id = helpers::unique_id; private: - int depth_; + unsigned int depth_; abstract_task::id unique_id_; abstract_task* child_task_; public: - abstract_task(const int depth, const abstract_task::id& unique_id): + abstract_task(const unsigned int depth, const abstract_task::id& unique_id): depth_{depth}, unique_id_{unique_id}, child_task_{nullptr} {} @@ -27,8 +27,8 @@ namespace pls { void set_child(abstract_task* child_task) { child_task_ = child_task; } abstract_task* child() { return child_task_; } - void set_depth(int depth) { depth_ = depth; } - int depth() const { return depth_; } + void set_depth(unsigned int depth) { depth_ = depth; } + unsigned int depth() const { return depth_; } id unique_id() const { return unique_id_; } protected: virtual bool internal_stealing(abstract_task* other_task) = 0; diff --git a/lib/pls/src/internal/scheduling/abstract_task.cpp b/lib/pls/src/internal/scheduling/abstract_task.cpp index bfca31f..1b6a21f 100644 --- a/lib/pls/src/internal/scheduling/abstract_task.cpp +++ b/lib/pls/src/internal/scheduling/abstract_task.cpp @@ -33,6 +33,7 @@ namespace pls { } PROFILE_END_BLOCK + // Try to steal 'internal', e.g. for_join_sub_tasks in a fork_join_task constellation PROFILE_STEALING("Internal Steal") if (current_task != nullptr) { // See if it equals our type and depth of task @@ -52,7 +53,7 @@ namespace pls { // Execute 'top level task steal' if possible - // (only try deeper tasks to keep depth restricted stealing) + // (only try deeper tasks to keep depth restricted stealing). PROFILE_STEALING("Top Level Steal") while (current_task != nullptr) { auto lock = &target_state->lock_;