Initial commit
This commit is contained in:
Executable
+59
@@ -0,0 +1,59 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#include <queue>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
|
||||
namespace wfr {
|
||||
namespace scheduling {
|
||||
class SchedulingDecision;
|
||||
class AbstractScheduler;
|
||||
class PThreadBackend;
|
||||
}
|
||||
namespace execution {
|
||||
class PThreadBackend;
|
||||
class CudaBackend;
|
||||
}
|
||||
|
||||
|
||||
namespace execution {
|
||||
|
||||
|
||||
class ExecutionHandle;
|
||||
|
||||
class ExecutionManager {
|
||||
private:
|
||||
ExecutionManager();
|
||||
static ExecutionManager singleton;
|
||||
|
||||
std::mutex managerMutex;
|
||||
|
||||
PThreadBackend* pThreadBackend = nullptr;
|
||||
CudaBackend* cudaBackend = nullptr;
|
||||
|
||||
std::map<ExecutionHandle*, scheduling::AbstractScheduler*> schedulerHandleMap;
|
||||
std::queue<ExecutionHandle*> updateQueue;
|
||||
|
||||
public:
|
||||
static void init(int argc, char** argv);
|
||||
|
||||
static void finish();
|
||||
|
||||
~ExecutionManager();
|
||||
|
||||
static ExecutionManager& getInstance() { return singleton; }
|
||||
|
||||
bool executeSchedulingDecision(std::shared_ptr<scheduling::SchedulingDecision> sd, scheduling::AbstractScheduler& scheduler);
|
||||
|
||||
void notifyExecutionHandleUpdate(ExecutionHandle& handle);
|
||||
};
|
||||
|
||||
} /* namespace execution */
|
||||
} /* namespace wfr */
|
||||
Reference in New Issue
Block a user