Commit 3bbd8951 by FritzFlorian

Change some size types.

parent b7f42e2b
Pipeline #1150 passed with stages
in 3 minutes 31 seconds
...@@ -18,7 +18,7 @@ namespace pls { ...@@ -18,7 +18,7 @@ namespace pls {
*/ */
class spin_lock { class spin_lock {
std::atomic_flag flag_; std::atomic_flag flag_;
int yield_at_tries_; unsigned int yield_at_tries_;
public: public:
......
...@@ -13,7 +13,7 @@ namespace pls { ...@@ -13,7 +13,7 @@ namespace pls {
namespace helpers { namespace helpers {
// TODO: Clean up (separate into small functions and .cpp file) // TODO: Clean up (separate into small functions and .cpp file)
template<typename Function> template<typename Function>
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 std;
using namespace pls::internal::scheduling; using namespace pls::internal::scheduling;
......
...@@ -13,12 +13,12 @@ namespace pls { ...@@ -13,12 +13,12 @@ namespace pls {
using id = helpers::unique_id; using id = helpers::unique_id;
private: private:
int depth_; unsigned int depth_;
abstract_task::id unique_id_; abstract_task::id unique_id_;
abstract_task* child_task_; abstract_task* child_task_;
public: 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}, depth_{depth},
unique_id_{unique_id}, unique_id_{unique_id},
child_task_{nullptr} {} child_task_{nullptr} {}
...@@ -27,8 +27,8 @@ namespace pls { ...@@ -27,8 +27,8 @@ namespace pls {
void set_child(abstract_task* child_task) { child_task_ = child_task; } void set_child(abstract_task* child_task) { child_task_ = child_task; }
abstract_task* child() { return child_task_; } abstract_task* child() { return child_task_; }
void set_depth(int depth) { depth_ = depth; } void set_depth(unsigned int depth) { depth_ = depth; }
int depth() const { return depth_; } unsigned int depth() const { return depth_; }
id unique_id() const { return unique_id_; } id unique_id() const { return unique_id_; }
protected: protected:
virtual bool internal_stealing(abstract_task* other_task) = 0; virtual bool internal_stealing(abstract_task* other_task) = 0;
......
...@@ -33,6 +33,7 @@ namespace pls { ...@@ -33,6 +33,7 @@ namespace pls {
} }
PROFILE_END_BLOCK PROFILE_END_BLOCK
// Try to steal 'internal', e.g. for_join_sub_tasks in a fork_join_task constellation
PROFILE_STEALING("Internal Steal") PROFILE_STEALING("Internal Steal")
if (current_task != nullptr) { if (current_task != nullptr) {
// See if it equals our type and depth of task // See if it equals our type and depth of task
...@@ -52,7 +53,7 @@ namespace pls { ...@@ -52,7 +53,7 @@ namespace pls {
// Execute 'top level task steal' if possible // 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") PROFILE_STEALING("Top Level Steal")
while (current_task != nullptr) { while (current_task != nullptr) {
auto lock = &target_state->lock_; auto lock = &target_state->lock_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment