Skip to main content

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.

Inherits from: backend

Member Variables

std::unique_ptr<impl> m_impl

Member Function Overview

Inherited from backend:

Member Functions

void check_async_errors()

Description

Check internal queues and panic if any asynchronous errors occurred.


void* debug_alloc(size_t size)

Description

Synchronously allocates device-accessible host memory. This is slow and meant for debugging purposes only.

Parameters

size_t size

void debug_free(void* ptr)

Description

Synchronously frees device-accessible host memory. This is slow and meant for debugging purposes only.

Parameters

void* ptr

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.

Parameters

device_id device
size_t size
size_t alignment

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.

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)

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.

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)

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.

Parameters

size_t size
size_t alignment

async_event enqueue_host_copy(
    size_t host_lane,
    const void* source_base,
    void* dest_base,
    const box<3>& source_box,
    const box<3>& dest_box,
    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.

Parameters

size_t host_lane
const void* source_base
void* dest_base
const box<3>& source_box
const box<3>& dest_box
const region<3>& copy_region
size_t elem_size

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.

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 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.

Parameters

size_t host_lane
const host_task_launcher& launcher
std::vector<closure_hydrator::accessor_info> accessor_infos
const box<3>& execution_range
const communicator* collective_comm

const system_info& get_system_info() const

Description

Returns metadata about the system as it appears to the backend implementation.


void init()

Description

Performs (possibly latency-intensive) backend initialization. Separate from the constructor to allow this function to be called from a different thread.


sycl_backend& operator=(const sycl_backend&)

Parameters

const sycl_backend&

sycl_backend& operator=(sycl_backend&&)

Parameters

sycl_backend&&

sycl_backend(const sycl_backend&)

Parameters

const sycl_backend&

sycl_backend(sycl_backend&&)

Parameters

sycl_backend&&

explicit sycl_backend(
    const std::vector<sycl::device>& devices,
    bool enable_profiling)

Parameters

const std::vector<sycl::device>& devices
bool enable_profiling

~sycl_backend()


sycl::queue& get_device_queue(device_id device,
                              size_t lane)

Parameters

device_id device
size_t lane

system_info& get_system_info()


bool is_profiling_enabled() const