2015-04-29 15:50:57 -04:00
|
|
|
#ifndef ISAAC_CL_QUEUES_H
|
|
|
|
#define ISAAC_CL_QUEUES_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <list>
|
2015-07-31 00:41:03 -07:00
|
|
|
#include <vector>
|
2015-04-29 15:50:57 -04:00
|
|
|
|
2015-07-31 00:41:03 -07:00
|
|
|
#include "isaac/driver/common.h"
|
2015-07-21 22:02:36 -07:00
|
|
|
#include "isaac/defines.h"
|
2015-04-29 15:50:57 -04:00
|
|
|
|
|
|
|
namespace isaac
|
|
|
|
{
|
|
|
|
namespace driver
|
|
|
|
{
|
|
|
|
|
2015-07-31 00:41:03 -07:00
|
|
|
class Context;
|
|
|
|
class CommandQueue;
|
|
|
|
|
2015-07-30 21:02:30 -07:00
|
|
|
class ISAACAPI backend
|
2015-04-29 15:50:57 -04:00
|
|
|
{
|
|
|
|
private:
|
2015-07-30 21:02:30 -07:00
|
|
|
static void cuinit();
|
|
|
|
static void clinit();
|
|
|
|
static void init();
|
2015-04-29 15:50:57 -04:00
|
|
|
public:
|
2015-07-31 00:41:03 -07:00
|
|
|
static std::list<Context> const & contexts();
|
|
|
|
static Context const & import(cl_context context);
|
|
|
|
static Context const & default_context();
|
2015-07-30 21:02:30 -07:00
|
|
|
static std::vector<CommandQueue> & queues(Context const &);
|
2015-04-29 15:50:57 -04:00
|
|
|
private:
|
2015-07-31 00:41:03 -07:00
|
|
|
static std::list<Context> contexts_;
|
|
|
|
static std::map<Context*, std::vector<CommandQueue>> queues_;
|
2015-04-29 15:50:57 -04:00
|
|
|
public:
|
2015-07-30 21:02:30 -07:00
|
|
|
static unsigned int default_device;
|
|
|
|
static cl_command_queue_properties queue_properties;
|
2015-04-29 15:50:57 -04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-07-21 23:48:50 -07:00
|
|
|
ISAACAPI void synchronize(std::vector<CommandQueue> const &);
|
|
|
|
ISAACAPI void synchronize(Context const &);
|
2015-04-29 15:50:57 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|