DPC++ Runtime
Runtime libraries for oneAPI DPC++
syclcompat::device_ext Class Reference

device extension More...

#include <syclcompat/device.hpp>

Public Member Functions

 device_ext ()
 
 ~device_ext ()
 
 device_ext (const sycl::device &base, bool print_on_async_exceptions=false, bool in_order=true)
 
bool is_native_host_atomic_supported ()
 
int get_major_version () const
 
int get_minor_version () const
 
int get_max_compute_units () const
 
int get_max_clock_frequency () const
 Return the maximum clock frequency of this device in KHz. More...
 
int get_integrated () const
 
int get_max_sub_group_size () const
 
int get_max_register_size_per_work_group () const
 
int get_max_work_group_size () const
 
int get_mem_base_addr_align () const
 
size_t get_global_mem_size () const
 
void get_memory_info (size_t &free_memory, size_t &total_memory) const
 Get the number of bytes of free and total memory on the SYCL device. More...
 
void get_device_info (device_info &out) const
 
device_info get_device_info () const
 
void reset (bool print_on_async_exceptions=false, bool in_order=true)
 
void set_default_queue (const sycl::queue &q)
 
queue_ptr default_queue ()
 
void queues_wait_and_throw ()
 
queue_ptr create_queue (bool print_on_async_exceptions=false, bool in_order=true)
 
void destroy_queue (queue_ptr &queue)
 
void set_saved_queue (queue_ptr q)
 
queue_ptr get_saved_queue () const
 
sycl::context get_context () const
 
void has_capability_or_fail (const std::initializer_list< sycl::aspect > &props) const
 Util function to check whether a device supports some kinds of sycl::aspect. More...
 

Friends

sycl::event free_async (const std::vector< void * > &, const std::vector< sycl::event > &, sycl::queue)
 Free the device memory pointed by a batch of pointers in pointers which are related to q after events completed. More...
 

Detailed Description

device extension

Definition at line 265 of file device.hpp.

Constructor & Destructor Documentation

◆ device_ext() [1/2]

syclcompat::device_ext::device_ext ( )
inline

Definition at line 267 of file device.hpp.

◆ ~device_ext()

syclcompat::device_ext::~device_ext ( )
inline

Definition at line 268 of file device.hpp.

References syclcompat::wait().

◆ device_ext() [2/2]

syclcompat::device_ext::device_ext ( const sycl::device base,
bool  print_on_async_exceptions = false,
bool  in_order = true 
)
inline

Definition at line 273 of file device.hpp.

References create_queue().

Member Function Documentation

◆ create_queue()

queue_ptr syclcompat::device_ext::create_queue ( bool  print_on_async_exceptions = false,
bool  in_order = true 
)
inline

Definition at line 478 of file device.hpp.

Referenced by syclcompat::create_queue(), and device_ext().

◆ default_queue()

queue_ptr syclcompat::device_ext::default_queue ( )
inline

Definition at line 466 of file device.hpp.

Referenced by syclcompat::get_default_queue().

◆ destroy_queue()

void syclcompat::device_ext::destroy_queue ( queue_ptr queue)
inline

Definition at line 483 of file device.hpp.

◆ get_context()

sycl::context syclcompat::device_ext::get_context ( ) const
inline

Definition at line 501 of file device.hpp.

Referenced by syclcompat::get_default_context().

◆ get_device_info() [1/2]

◆ get_device_info() [2/2]

◆ get_global_mem_size()

size_t syclcompat::device_ext::get_global_mem_size ( ) const
inline

◆ get_integrated()

int syclcompat::device_ext::get_integrated ( ) const
inline

Definition at line 303 of file device.hpp.

References get_device_info(), and syclcompat::device_info::get_integrated().

◆ get_major_version()

int syclcompat::device_ext::get_major_version ( ) const
inline

Definition at line 286 of file device.hpp.

References get_device_info(), and syclcompat::device_info::get_major_version().

◆ get_max_clock_frequency()

int syclcompat::device_ext::get_max_clock_frequency ( ) const
inline

Return the maximum clock frequency of this device in KHz.

Definition at line 299 of file device.hpp.

References get_device_info(), and syclcompat::device_info::get_max_clock_frequency().

◆ get_max_compute_units()

int syclcompat::device_ext::get_max_compute_units ( ) const
inline

◆ get_max_register_size_per_work_group()

int syclcompat::device_ext::get_max_register_size_per_work_group ( ) const
inline

◆ get_max_sub_group_size()

int syclcompat::device_ext::get_max_sub_group_size ( ) const
inline

◆ get_max_work_group_size()

int syclcompat::device_ext::get_max_work_group_size ( ) const
inline

◆ get_mem_base_addr_align()

int syclcompat::device_ext::get_mem_base_addr_align ( ) const
inline

Definition at line 317 of file device.hpp.

◆ get_memory_info()

void syclcompat::device_ext::get_memory_info ( size_t &  free_memory,
size_t &  total_memory 
) const
inline

Get the number of bytes of free and total memory on the SYCL device.

Parameters
[out]free_memoryThe number of bytes of free memory on the SYCL device.
[out]total_memoryThe number of bytes of total memory on the SYCL device.

Definition at line 330 of file device.hpp.

References std::cerr, get_device_info(), and syclcompat::device_info::get_global_mem_size().

◆ get_minor_version()

int syclcompat::device_ext::get_minor_version ( ) const
inline

Definition at line 290 of file device.hpp.

References get_device_info(), and syclcompat::device_info::get_minor_version().

◆ get_saved_queue()

queue_ptr syclcompat::device_ext::get_saved_queue ( ) const
inline

Definition at line 497 of file device.hpp.

◆ has_capability_or_fail()

void syclcompat::device_ext::has_capability_or_fail ( const std::initializer_list< sycl::aspect > &  props) const
inline

Util function to check whether a device supports some kinds of sycl::aspect.

Definition at line 505 of file device.hpp.

References sycl::_V1::detail::getAspectNameStr().

◆ is_native_host_atomic_supported()

bool syclcompat::device_ext::is_native_host_atomic_supported ( )
inline

Definition at line 285 of file device.hpp.

◆ queues_wait_and_throw()

void syclcompat::device_ext::queues_wait_and_throw ( )
inline

Definition at line 468 of file device.hpp.

◆ reset()

void syclcompat::device_ext::reset ( bool  print_on_async_exceptions = false,
bool  in_order = true 
)
inline

Definition at line 443 of file device.hpp.

◆ set_default_queue()

void syclcompat::device_ext::set_default_queue ( const sycl::queue q)
inline

Definition at line 457 of file device.hpp.

Referenced by syclcompat::set_default_queue().

◆ set_saved_queue()

void syclcompat::device_ext::set_saved_queue ( queue_ptr  q)
inline

Definition at line 493 of file device.hpp.

Friends And Related Function Documentation

◆ free_async

sycl::event free_async ( const std::vector< void * > &  pointers,
const std::vector< sycl::event > &  events,
sycl::queue  q = get_default_queue() 
)
friend

Free the device memory pointed by a batch of pointers in pointers which are related to q after events completed.

Parameters
pointersThe pointers point to the device memory requested to be freed.
eventsThe events to be waited.
qThe sycl::queue the memory relates to.

Definition at line 549 of file memory.hpp.


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