rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::device Class Referenceabstract

Abstract representation of a hardware compute device. More...

#include <rexlib/core/hardware/device.hpp>

Inheritance diagram for rexlib::device:
rexlib::cpu::cpu_device

Public Member Functions

 device (const device &other)=delete
 
 device (device &&other)=delete
 
device & operator= (const device &other)=delete
 
device & operator= (device &&other)=delete
 
virtual const memory_resource & get_memory_resource (memory_resource_affinity affinity) const =0
 Retrieve a memory resource by its affinity.
 
virtual std::shared_ptr< command_queue > create_command_queue () const =0
 Create a new command queue on this device.
 

Detailed Description

Abstract representation of a hardware compute device.

A device is the entry point for interacting with a backend's compute resource: it advertises the memory resources reachable from the device and acts as a factory for the per-device objects used by the rest of the framework (queues, ...).

Member Function Documentation

◆ create_command_queue()

virtual std::shared_ptr< command_queue > rexlib::device::create_command_queue ( ) const
pure virtual

Create a new command queue on this device.

The returned queue is independent from any previously created queue on the same device, including the default queue and may execute its commands concurrently with them. A command of one queue is ordered after a command of another by depending on it.

Returns
Newly created queue. Never null.

Implemented in rexlib::cpu::cpu_device.

◆ get_memory_resource()

virtual const memory_resource & rexlib::device::get_memory_resource ( memory_resource_affinity  affinity) const
pure virtual

Retrieve a memory resource by its affinity.

Returns the memory_resource that is best suited for the access pattern described by affinity. The returned reference is valid for the lifetime of this device.

Note
Depending on the backend, two distinct affinity values may resolve to the same underlying memory_resource (i.e. the references may alias).
Parameters
affinityThe intended access pattern for which a resource is requested.
Returns
A reference to the matching memory_resource.
See also
memory_resource_affinity
memory_resource

Implemented in rexlib::cpu::cpu_device.


The documentation for this class was generated from the following file: