Commit ae099e96 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

put unit_type outside of pool class

parent e413b9e5
......@@ -18,7 +18,7 @@ class my_unit {
tl::thread m_thread;
tl::task m_task;
tl::pool::unit_type m_type;
tl::unit_type m_type;
bool m_in_pool;
friend class my_pool;
......@@ -26,12 +26,12 @@ class my_unit {
public:
my_unit(const tl::thread& t)
: m_thread(t), m_type(tl::pool::unit_type::thread), m_in_pool(false) {}
: m_thread(t), m_type(tl::unit_type::thread), m_in_pool(false) {}
my_unit(const tl::task& t)
: m_task(t), m_type(tl::pool::unit_type::task), m_in_pool(false) {}
: m_task(t), m_type(tl::unit_type::task), m_in_pool(false) {}
tl::pool::unit_type get_type() const {
tl::unit_type get_type() const {
return m_type;
}
......
......@@ -16,6 +16,7 @@
#include <thallium/condition_variable.hpp>
#include <thallium/eventual.hpp>
#include <thallium/thread.hpp>
#include <thallium/unit_type.hpp>
#include <thallium/pool.hpp>
#include <thallium/scheduler.hpp>
#include <thallium/mutex.hpp>
......@@ -23,5 +24,6 @@
#include <thallium/exception.hpp>
#include <thallium/timer.hpp>
#include <thallium/future.hpp>
#include <thallium/xstream_barrier.hpp>
#endif
......@@ -14,6 +14,7 @@
#include <thallium/managed.hpp>
#include <thallium/exception.hpp>
#include <thallium/abt_errors.hpp>
#include <thallium/unit_type.hpp>
namespace thallium {
......@@ -68,17 +69,6 @@ class pool {
mpmc = ABT_POOL_ACCESS_MPMC
};
/**
* @brief Type of work units. Used when defining
* custom pools.
*/
enum class unit_type : std::uint8_t {
thread = ABT_UNIT_TYPE_THREAD,
task = ABT_UNIT_TYPE_TASK,
xstream = ABT_UNIT_TYPE_XSTREAM,
other = ABT_UNIT_TYPE_EXT
};
private:
template<typename P, typename U,
......
/*
* Copyright (c) 2017 UChicago Argonne, LLC
*
* See COPYRIGHT in top-level directory.
*/
#ifndef __THALLIUM_UNIT_TYPE_HPP
#define __THALLIUM_UNIT_TYPE_HPP
#include <abt.h>
namespace thallium {
/**
* @brief Type of work units. Used when defining
* custom pools.
*/
enum class unit_type : std::uint8_t {
thread = ABT_UNIT_TYPE_THREAD,
task = ABT_UNIT_TYPE_TASK,
xstream = ABT_UNIT_TYPE_XSTREAM,
other = ABT_UNIT_TYPE_EXT
};
}
#endif
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 to comment