Device Class Reference

HiCR: HiCR::backend::opencl::Device Class Reference
HiCR
HiCR::backend::opencl::Device Class Referencefinal

#include <device.hpp>

Inheritance diagram for HiCR::backend::opencl::Device:
HiCR::Device

Public Types

typedef uint64_t deviceIdentifier_t
 
- Public Types inherited from HiCR::Device
using computeResourceList_t = std::vector< std::shared_ptr< ComputeResource > >
 
using memorySpaceList_t = std::vector< std::shared_ptr< MemorySpace > >
 

Public Member Functions

 Device (const deviceIdentifier_t id, const std::string &type, const std::shared_ptr< cl::Device > &device, const computeResourceList_t &computeResources, const memorySpaceList_t &memorySpaces)
 
 Device ()
 
 Device (const nlohmann::json &input)
 
 ~Device ()
 
__INLINE__ deviceIdentifier_t getId () const
 
__INLINE__ std::string getType () const override
 
__INLINE__ const cl::Device & getOpenCLDevice () const
 
- Public Member Functions inherited from HiCR::Device
__INLINE__ const computeResourceList_tgetComputeResourceList ()
 
__INLINE__ const memorySpaceList_tgetMemorySpaceList ()
 
__INLINE__ void addComputeResource (const std::shared_ptr< HiCR::ComputeResource > &computeResource)
 
__INLINE__ void addMemorySpace (const std::shared_ptr< HiCR::MemorySpace > &memorySpace)
 
 Device (computeResourceList_t computeResources, memorySpaceList_t memorySpaces)
 
__INLINE__ nlohmann::json serialize () const
 
__INLINE__ void deserialize (const nlohmann::json &input)
 

Additional Inherited Members

- Protected Member Functions inherited from HiCR::Device
 Device ()=default
 

Detailed Description

This class represents a device, as visible by the OpenCL backend.

Member Typedef Documentation

◆ deviceIdentifier_t

Type definition for the OpenCL Device identifier

Constructor & Destructor Documentation

◆ Device() [1/3]

HiCR::backend::opencl::Device::Device ( const deviceIdentifier_t  id,
const std::string &  type,
const std::shared_ptr< cl::Device > &  device,
const computeResourceList_t computeResources,
const memorySpaceList_t memorySpaces 
)
inline

Constructor for an OpenCL device

Parameters
idInternal unique identifier for the device
typeDevice type
deviceOpenCL device class
computeResourcesThe compute resources associated to this device (typically just one, the main OpenCL processor)
memorySpacesThe memory spaces associated to this device (DRAM + other use-specific or high-bandwidth memories)

◆ Device() [2/3]

HiCR::backend::opencl::Device::Device ( )
inline

Default constructor for resource requesting

◆ Device() [3/3]

HiCR::backend::opencl::Device::Device ( const nlohmann::json &  input)
inline

Deserializing constructor

The instance created will contain all information, if successful in deserializing it, corresponding to the passed OpenCL device This instance should NOT be used for anything else than reporting/printing the contained resources

Parameters
[in]inputA JSON-encoded serialized OpenCL device information

◆ ~Device()

HiCR::backend::opencl::Device::~Device ( )
inlinevirtual

Device destructor

Reimplemented from HiCR::Device.

Member Function Documentation

◆ getId()

__INLINE__ deviceIdentifier_t HiCR::backend::opencl::Device::getId ( ) const
inline

Get device id

Returns
device id

◆ getOpenCLDevice()

__INLINE__ const cl::Device & HiCR::backend::opencl::Device::getOpenCLDevice ( ) const
inline

Get OpenCL Device

Returns
OpenCL Device

◆ getType()

__INLINE__ std::string HiCR::backend::opencl::Device::getType ( ) const
inlineoverridevirtual

Get device type

Returns
device type

Implements HiCR::Device.


The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/backends/opencl/device.hpp