class sycl_backend
Declaration
class sycl_backend : public backend { /* full declaration omitted */ };
Description
Backend implementation which sources all allocations from SYCL and dispatches device kernels to SYCL in-order queues. This abstract class implements all backend
functions except copies, which not subject to platform-dependent specialization.
Declared at: include/backend/sycl_backend.h:79
Inherits from: backend
Member Variables
- std::unique_ptr<impl> m_impl
Member Function Overview
- check_async_errors() → void
- debug_alloc(size_t size) → void *
- debug_free(void * ptr) → void
- enqueue_device_alloc(device_id device, size_t size, size_t alignment) → async_event
- enqueue_device_free(device_id device, void * ptr) → async_event
- enqueue_device_kernel(device_id device, size_t device_lane, const device_kernel_launcher & launcher, std::vector<closure_hydrator::accessor_info> accessor_infos, const box<3> & execution_range, const std::vector<void *> & reduction_ptrs) → async_event
- enqueue_host_alloc(size_t size, size_t alignment) → async_event
- enqueue_host_copy(size_t host_lane, const void * source_base, void * dest_base, const region_layout & source_layout, const region_layout & dest_layout, const region<3> & copy_region, size_t elem_size) → async_event
- enqueue_host_free(void * ptr) → async_event
- enqueue_host_task(size_t host_lane, const host_task_launcher & launcher, std::vector<closure_hydrator::accessor_info> accessor_infos, const range<3> & global_range, const box<3> & execution_range, const communicator * collective_comm) → async_event
- get_system_info() const → const system_info &
- init() → void
- operator=(const sycl_backend &) → sycl_backend &
- operator=(sycl_backend &&) → sycl_backend &
- sycl_backend(const sycl_backend &)
- sycl_backend(sycl_backend &&)
- sycl_backend(const std::vector<sycl::device> & devices, const configuration & config) → explicit
- ~sycl_backend()
- enqueue_device_work(device_id device, size_t lane, const std::function<async_event (sycl::queue &)> & work) → async_event
- get_system_info() → system_info &
- is_profiling_enabled() const → bool
Inherited from backend:
- public check_async_errors
- public debug_alloc
- public debug_free
- public enqueue_device_alloc
- public enqueue_device_copy
- public enqueue_device_free
- public enqueue_device_kernel
- public enqueue_host_alloc
- public enqueue_host_copy
- public enqueue_host_free
- public enqueue_host_task
- public get_system_info
- public init
- public operator=
- public operator=
Member Functions
¶void check_async_errors()
void check_async_errors()
Description
Check internal queues and panic if any asynchronous errors occurred.
Declared at: include/backend/sycl_backend.h:121
¶void* debug_alloc(size_t size)
void* debug_alloc(size_t size)
Description
Synchronously allocates device-accessible host memory. This is slow and meant for debugging purposes only.
Declared at: include/backend/sycl_backend.h:100
Parameters
- size_t size
¶void debug_free(void* ptr)
void debug_free(void* ptr)
Description
Synchronously frees device-accessible host memory. This is slow and meant for debugging purposes only.
Declared at: include/backend/sycl_backend.h:102
Parameters
- void* ptr
¶async_event enqueue_device_alloc(device_id device,
size_t size,
size_t alignment)
async_event enqueue_device_alloc(device_id device,
size_t size,
size_t alignment)
Description
Schedules the allocation of device memory with the specified size and alignment. The operation will complete in-order with respect to any other asynchronous alloc
and free
operation on the same backend.
Declared at: include/backend/sycl_backend.h:106
Parameters
- device_id device
- size_t size
- size_t alignment
¶async_event enqueue_device_free(device_id device,
void* ptr)
async_event enqueue_device_free(device_id device,
void* ptr)
Description
Schedules the release of memory allocated via enqueue_device_alloc
. The operation will complete in-order with respect to any other asynchronous alloc
and free
operation on the same backend.
Declared at: include/backend/sycl_backend.h:110
Parameters
- device_id device
- void* ptr
¶async_event enqueue_device_kernel(
device_id device,
size_t device_lane,
const device_kernel_launcher& launcher,
std::vector<closure_hydrator::accessor_info>
accessor_infos,
const box<3>& execution_range,
const std::vector<void*>& reduction_ptrs)
async_event enqueue_device_kernel(
device_id device,
size_t device_lane,
const device_kernel_launcher& launcher,
std::vector<closure_hydrator::accessor_info>
accessor_infos,
const box<3>& execution_range,
const std::vector<void*>& reduction_ptrs)
Description
Enqueues the asynchronous execution of a kernel in an in-order device queue identified by device
and device_lane
. The operation will complete in-order with respect to any other asynchronous device operation on device
and device_lane
.
Declared at: include/backend/sycl_backend.h:115
Parameters
- device_id device
- size_t device_lane
- const device_kernel_launcher& launcher
- std::vector<closure_hydrator::accessor_info> accessor_infos
- const box<3>& execution_range
- const std::vector<void*>& reduction_ptrs
¶async_event enqueue_host_alloc(size_t size,
size_t alignment)
async_event enqueue_host_alloc(size_t size,
size_t alignment)
Description
Schedules the allocation of device-accessible host memory with the specified size and alignment. The operation will complete in-order with respect to any other asynchronous alloc
and free
operation on the same backend.
Declared at: include/backend/sycl_backend.h:104
Parameters
- size_t size
- size_t alignment
¶async_event enqueue_host_copy(
size_t host_lane,
const void* source_base,
void* dest_base,
const region_layout& source_layout,
const region_layout& dest_layout,
const region<3>& copy_region,
size_t elem_size)
async_event enqueue_host_copy(
size_t host_lane,
const void* source_base,
void* dest_base,
const region_layout& source_layout,
const region_layout& dest_layout,
const region<3>& copy_region,
size_t elem_size)
Description
Enqueues an n-dimensional copy between two host allocations (both either device-accessible or user-allocated). The operation will complete in-order with respect to any other asynchronous host operation on host_lane
.
Declared at: include/backend/sycl_backend.h:118
Parameters
- size_t host_lane
- const void* source_base
- void* dest_base
- const region_layout& source_layout
- const region_layout& dest_layout
- const region<3>& copy_region
- size_t elem_size
¶async_event enqueue_host_free(void* ptr)
async_event enqueue_host_free(void* ptr)
Description
Schedules the release of memory allocated via enqueue_host_alloc
. The operation will complete in-order with respect to any other asynchronous alloc
and free
operation on the same backend.
Declared at: include/backend/sycl_backend.h:108
Parameters
- void* ptr
¶async_event enqueue_host_task(
size_t host_lane,
const host_task_launcher& launcher,
std::vector<closure_hydrator::accessor_info>
accessor_infos,
const range<3>& global_range,
const box<3>& execution_range,
const communicator* collective_comm)
async_event enqueue_host_task(
size_t host_lane,
const host_task_launcher& launcher,
std::vector<closure_hydrator::accessor_info>
accessor_infos,
const range<3>& global_range,
const box<3>& execution_range,
const communicator* collective_comm)
Description
Enqueues the asynchronous execution of a host task in a background thread identified by host_lane
. The operation will complete in-order with respect to any other asynchronous host operation on host_lane
.
Declared at: include/backend/sycl_backend.h:112
Parameters
- size_t host_lane
- const host_task_launcher& launcher
- std::vector<closure_hydrator::accessor_info> accessor_infos
- const range<3>& global_range
- const box<3>& execution_range
- const communicator* collective_comm
¶const system_info& get_system_info() const
const system_info& get_system_info() const
Description
Returns metadata about the system as it appears to the backend implementation.
Declared at: include/backend/sycl_backend.h:96
¶void init()
void init()
Description
Performs (possibly latency-intensive) backend initialization. Separate from the constructor to allow this function to be called from a different thread.
Declared at: include/backend/sycl_backend.h:98
¶sycl_backend& operator=(const sycl_backend&)
sycl_backend& operator=(const sycl_backend&)
Declared at: include/backend/sycl_backend.h:92
Parameters
- const sycl_backend&
¶sycl_backend& operator=(sycl_backend&&)
sycl_backend& operator=(sycl_backend&&)
Declared at: include/backend/sycl_backend.h:93
Parameters
¶sycl_backend(const sycl_backend&)
sycl_backend(const sycl_backend&)
Declared at: include/backend/sycl_backend.h:90
Parameters
- const sycl_backend&
¶sycl_backend(sycl_backend&&)
sycl_backend(sycl_backend&&)
Declared at: include/backend/sycl_backend.h:91
Parameters
¶explicit sycl_backend(
const std::vector<sycl::device>& devices,
const configuration& config)
explicit sycl_backend(
const std::vector<sycl::device>& devices,
const configuration& config)
Declared at: include/backend/sycl_backend.h:89
Parameters
- const std::vector<sycl::device>& devices
- const configuration& config
¶~sycl_backend()
~sycl_backend()
Declared at: include/backend/sycl_backend.h:94
¶async_event enqueue_device_work(
device_id device,
size_t lane,
const std::function<
async_event(sycl::queue&)>& work)
async_event enqueue_device_work(
device_id device,
size_t lane,
const std::function<
async_event(sycl::queue&)>& work)
Declared at: include/backend/sycl_backend.h:128
Parameters
- device_id device
- size_t lane
- const std::function<async_event(sycl::queue&)>& work
¶system_info& get_system_info()
system_info& get_system_info()
Declared at: include/backend/sycl_backend.h:124
¶bool is_profiling_enabled() const
bool is_profiling_enabled() const
Declared at: include/backend/sycl_backend.h:130