2015-04-29 15:50:57 -04:00
|
|
|
#ifndef ISAAC_DRIVER_DEVICE_H
|
|
|
|
#define ISAAC_DRIVER_DEVICE_H
|
|
|
|
|
2015-07-21 22:02:36 -07:00
|
|
|
#include "isaac/defines.h"
|
2015-04-29 15:50:57 -04:00
|
|
|
#include "isaac/driver/common.h"
|
|
|
|
#include "isaac/driver/platform.h"
|
|
|
|
#include "isaac/driver/handle.h"
|
|
|
|
|
|
|
|
namespace isaac
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace driver
|
|
|
|
{
|
|
|
|
|
|
|
|
// Device
|
2015-07-21 22:02:36 -07:00
|
|
|
class ISAACAPI Device
|
2015-04-29 15:50:57 -04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class Context;
|
|
|
|
friend class CommandQueue;
|
|
|
|
|
|
|
|
public:
|
2015-08-06 17:53:20 -07:00
|
|
|
enum class Vendor
|
2015-04-29 15:50:57 -04:00
|
|
|
{
|
|
|
|
AMD,
|
|
|
|
INTEL,
|
|
|
|
NVIDIA,
|
|
|
|
UNKNOWN
|
|
|
|
};
|
|
|
|
|
2015-08-06 17:53:20 -07:00
|
|
|
enum class Architecture
|
2015-08-05 17:01:42 -07:00
|
|
|
{
|
|
|
|
HASWELL,
|
|
|
|
BROADWELL,
|
|
|
|
UNKNOWN
|
|
|
|
};
|
|
|
|
|
2015-04-29 15:50:57 -04:00
|
|
|
private:
|
|
|
|
#ifdef ISAAC_WITH_CUDA
|
|
|
|
template<CUdevice_attribute attr>
|
|
|
|
int cuGetInfo() const;
|
|
|
|
#endif
|
|
|
|
public:
|
|
|
|
#ifdef ISAAC_WITH_CUDA
|
|
|
|
Device(int ordinal);
|
|
|
|
#endif
|
2015-07-26 21:13:28 -07:00
|
|
|
Device(cl_device_id const & device, bool take_ownership = true);
|
2015-07-30 14:35:41 -07:00
|
|
|
|
|
|
|
bool operator==(Device const &) const;
|
|
|
|
bool operator<(Device const &) const;
|
|
|
|
|
2015-08-06 12:05:12 -07:00
|
|
|
Vendor vendor() const;
|
|
|
|
Architecture architecture() const;
|
2015-08-05 17:01:42 -07:00
|
|
|
|
2015-04-29 15:50:57 -04:00
|
|
|
backend_type backend() const;
|
|
|
|
size_t clock_rate() const;
|
|
|
|
unsigned int address_bits() const;
|
|
|
|
driver::Platform platform() const;
|
|
|
|
std::string name() const;
|
|
|
|
std::string vendor_str() const;
|
|
|
|
std::vector<size_t> max_work_item_sizes() const;
|
|
|
|
device_type type() const;
|
|
|
|
std::string extensions() const;
|
|
|
|
size_t max_work_group_size() const;
|
|
|
|
size_t local_mem_size() const;
|
|
|
|
size_t warp_wavefront_size() const;
|
2015-07-26 21:35:39 -07:00
|
|
|
bool fp64_support() const;
|
2015-04-29 15:50:57 -04:00
|
|
|
std::pair<unsigned int, unsigned int> nv_compute_capability() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
backend_type backend_;
|
2015-07-25 21:00:18 -07:00
|
|
|
HANDLE_TYPE(cl_device_id, CUdevice) h_;
|
2015-04-29 15:50:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|