pub struct Queue(/* private fields */);Expand description
The Queue connects a host program to a single device. Programs submit tasks to a device via the
Queue and may monitor the Queue for completion. A program initiates the task by submitting
a kernel.
Implementations§
Source§impl Queue
impl Queue
Sourcepub fn new_immediate() -> Self
pub fn new_immediate() -> Self
Construct an immediate Queue based on the device returned from the default selector.
Sourcepub fn get_context(&self) -> Context
pub fn get_context(&self) -> Context
Returns the SYCL queue’s context.
Sourcepub fn alloc_host<T: Pod>(&mut self, len: usize) -> EnqueuedHostBuffer<T>
pub fn alloc_host<T: Pod>(&mut self, len: usize) -> EnqueuedHostBuffer<T>
Allocates zeroed memory and creates a host-side Buffer that can store an array of T.
Allocates zeroed memory and creates a shared Buffer that can store an array of T.
Sourcepub fn alloc_device<T: Pod>(&mut self, len: usize) -> EnqueuedDeviceBuffer<T>
pub fn alloc_device<T: Pod>(&mut self, len: usize) -> EnqueuedDeviceBuffer<T>
Allocates zeroed memory and creates a device Buffer that can store an array of T.
Sourcepub unsafe fn alloc_uninit_host<T>(&self, len: usize) -> HostBuffer<T>
pub unsafe fn alloc_uninit_host<T>(&self, len: usize) -> HostBuffer<T>
Allocates memory and creates a host-side Buffer that can store an array of T.
Safety: the buffer contents are uninitialized.
Allocates memory and creates a shared Buffer that can store an array of T.
Safety: the buffer contents are uninitialized.
Sourcepub unsafe fn alloc_uninit_device<T>(&self, len: usize) -> DeviceBuffer<T>
pub unsafe fn alloc_uninit_device<T>(&self, len: usize) -> DeviceBuffer<T>
Allocates memory and creates a device-side Buffer that can store an array of T.
Safety: the buffer contents are uninitialized.
Sourcepub unsafe fn memset<T, A: UsmAlloc>(
&mut self,
buffer: &mut Buffer<T, A>,
value: i32,
) -> Event
pub unsafe fn memset<T, A: UsmAlloc>( &mut self, buffer: &mut Buffer<T, A>, value: i32, ) -> Event
Sets memory allocated with USM allocations. Safety: the caller must make sure the underlying memory isn’t being aliased somewhere else.
Sourcepub unsafe fn memset_with_deps<T, A: UsmAlloc>(
&mut self,
buffer: &mut Buffer<T, A>,
value: i32,
dep_events: &[&Event],
) -> Event
pub unsafe fn memset_with_deps<T, A: UsmAlloc>( &mut self, buffer: &mut Buffer<T, A>, value: i32, dep_events: &[&Event], ) -> Event
Sets memory allocated with USM allocations after all specified events finish. Safety: the caller must make sure the underlying memory isn’t being aliased somewhere else.
Sourcepub fn barrier_with_deps(&mut self, dep_events: &[&Event]) -> Event
pub fn barrier_with_deps(&mut self, dep_events: &[&Event]) -> Event
Submits a barrier to the queue after all specified events finish.
Sourcepub fn wait(&mut self)
pub fn wait(&mut self)
Performs a blocking wait for the completion of all enqueued tasks in the queue.
Sourcepub unsafe fn launch<const ARGC: usize, const DIMENSIONS: usize>(
&mut self,
nd_range: NdRange<DIMENSIONS>,
kernel: &Kernel,
args: impl KernelArgumentList<ARGC>,
) -> Eventwhere
NdRange<DIMENSIONS>: ValidDimension,
pub unsafe fn launch<const ARGC: usize, const DIMENSIONS: usize>(
&mut self,
nd_range: NdRange<DIMENSIONS>,
kernel: &Kernel,
args: impl KernelArgumentList<ARGC>,
) -> Eventwhere
NdRange<DIMENSIONS>: ValidDimension,
Enqueues a kernel object to the queue as an ND-range kernel, using the number of work-items
specified by the NdRange nd_range.
Sourcepub fn copy<T, A1, A2>(
&mut self,
src: &Buffer<T, A1>,
dst: &mut Buffer<T, A2>,
) -> Event
pub fn copy<T, A1, A2>( &mut self, src: &Buffer<T, A1>, dst: &mut Buffer<T, A2>, ) -> Event
Copies the contents of the source buffer to the destination buffer.
If the buffer sizes don’t match the destination buffer is filled with as many elements from source buffer as possible.
Sourcepub fn copy_with_deps<T, A1, A2>(
&mut self,
src: &Buffer<T, A1>,
dst: &mut Buffer<T, A2>,
dep_events: &[&Event],
) -> Event
pub fn copy_with_deps<T, A1, A2>( &mut self, src: &Buffer<T, A1>, dst: &mut Buffer<T, A2>, dep_events: &[&Event], ) -> Event
Copies the contents of the source buffer to the destination buffer after all specified events finish.
If the buffer sizes don’t match the destination buffer is filled with as many elements from source buffer as possible.