Skip to main content

class queue

Declaration

class queue { /* full declaration omitted */ };

Declared at: include/queue.h:28

Member Variables

std::shared_ptr<tracker> m_tracker

Member Function Overview

  • template <typename T>
    fence(const experimental::host_object<T> & obj) → [[nodiscard]] std::future<T>
  • template <typename DataT, int Dims>
    fence(const buffer<DataT, Dims> & buf, const subrange<Dims> & sr) → [[nodiscard]] std::future<buffer_snapshot<DataT, Dims>>
  • template <typename DataT, int Dims>
    fence(const buffer<DataT, Dims> & buf) → [[nodiscard]] std::future<buffer_snapshot<DataT, Dims>>
  • queue()
  • template <typename CGF>
    submit(CGF && cgf) → void
  • wait() → void
  • wait(detail::barrier_tag) → void

Member Functions

template <typename T>
[[nodiscard]] std::future<T> fence(
    const experimental::host_object<T>& obj)

Description

Asynchronously captures the value of a host object by copy, introducing the same dependencies as a side-effect would. Waiting on the returned future in the application thread can stall scheduling of more work. To hide latency, either submit more command groups between fence and wait operations or ensure that other independent command groups are eligible to run while the fence is executed.

Declared at: include/queue.h:71

Template Parameters

T

Parameters

const experimental::host_object<T>& obj

template <typename DataT, int Dims>
[[nodiscard]] std::future<
    buffer_snapshot<DataT, Dims>>
fence(const buffer<DataT, Dims>& buf,
      const subrange<Dims>& sr)

Description

Asynchronously captures the contents of a buffer subrange, introducing the same dependencies as a read-accessor would. Waiting on the returned future in the application thread can stall scheduling of more work. To hide latency, either submit more command groups between fence and wait operations or ensure that other independent command groups are eligible to run while the fence is executed.

Declared at: include/queue.h:80

Template Parameters

DataT
int Dims

Parameters

const buffer<DataT, Dims>& buf
const subrange<Dims>& sr

template <typename DataT, int Dims>
[[nodiscard]] std::future<
    buffer_snapshot<DataT, Dims>>
fence(const buffer<DataT, Dims>& buf)

Description

Asynchronously captures the contents of an entire buffer, introducing the same dependencies as a read-accessor would. Waiting on the returned future in the application thread can stall scheduling of more work. To hide latency, either submit more command groups between fence and wait operations or ensure that other independent command groups are eligible to run while the fence is executed.

Declared at: include/queue.h:89

Template Parameters

DataT
int Dims

Parameters

const buffer<DataT, Dims>& buf

queue()

Description

Constructs a queue which distributes work across all devices associated with the runtime. To manually select a subset of devices in the system, call runtime::init with an appropriate selector before constructing the first Celerity object.

Declared at: include/queue.h:33


template <typename CGF>
void submit(CGF&& cgf)

Description

Submits a command group to the queue.

Declared at: include/queue.h:37

Template Parameters

CGF

Parameters

CGF&& cgf

void wait()

Description

Waits for all tasks submitted to the queue to complete. Since waiting will stall the scheduling of more work, this should be used sparingly - more so than on a single-node SYCL program. Note that this overload of wait does not issue a global barrier, so when using this for simple user-side benchmarking, cluster nodes might disagree on start time measurements. Use wait(experimental::barrier) instead for benchmarking purposes.

Declared at: include/queue.h:51


void wait(detail::barrier_tag)

Description

Waits for all tasks submitted to the queue to complete, then barrier-synchronizes across the entire cluster. This has an even higher latency than wait(), but may be useful for user-side performance measurements.

Declared at: include/queue.h:60

Parameters

detail::barrier_tag