Files
triton/include/isaac/driver/backend.h

80 lines
1.7 KiB
C
Raw Normal View History

#ifndef ISAAC_CL_QUEUES_H
#define ISAAC_CL_QUEUES_H
#include <map>
#include <list>
#include <vector>
#include "isaac/driver/common.h"
#include "isaac/driver/program.h"
2015-07-21 22:02:36 -07:00
#include "isaac/defines.h"
2015-08-04 10:53:39 -07:00
#include "isaac/types.h"
namespace isaac
{
namespace driver
{
class CommandQueue;
2015-08-03 11:13:31 -07:00
class Context;
class Platform;
2015-07-30 21:02:30 -07:00
class ISAACAPI backend
{
private:
public:
class programs
{
friend class backend;
public:
static void release();
2015-08-04 10:53:39 -07:00
static ProgramCache & get(CommandQueue const & queue, expression_type expression, numeric_type dtype);
private:
2015-08-04 10:53:39 -07:00
static std::map<std::tuple<CommandQueue, expression_type, numeric_type>, ProgramCache * > cache_;
};
class contexts
{
friend class backend;
2015-08-03 20:20:27 -07:00
private:
static void init(std::vector<Platform> const &);
static void release();
public:
static Context const & get_default();
static Context const & import(cl_context context);
static void get(std::list<Context const *> &);
private:
2015-08-03 20:20:27 -07:00
static std::list<Context const *> cache_;
};
class queues
{
friend class backend;
2015-08-03 20:20:27 -07:00
private:
static void init(std::list<Context const *> const &);
static void release();
public:
2015-08-03 20:20:27 -07:00
static void get(Context const &, std::vector<CommandQueue *> &queues);
static CommandQueue & get(Context const &, unsigned int id);
private:
2015-08-03 20:20:27 -07:00
static std::map< Context, std::vector<CommandQueue*> > cache_;
};
2015-08-03 20:20:27 -07:00
static void init();
static void release();
2015-08-03 20:20:27 -07:00
static void platforms(std::vector<Platform> &);
static void synchronize(Context const &);
public:
2015-07-30 21:02:30 -07:00
static unsigned int default_device;
static cl_command_queue_properties queue_properties;
};
}
}
#endif