pub struct OneApiMemoryBackend { /* private fields */ }Expand description
OneAPI memory backend implementation
Implementations§
Source§impl OneApiMemoryBackend
impl OneApiMemoryBackend
Sourcepub fn new(config: OneApiConfig) -> Result<Self, OneApiError>
pub fn new(config: OneApiConfig) -> Result<Self, OneApiError>
Create new OneAPI backend
Sourcepub fn allocate(
&mut self,
size: usize,
memory_type: OneApiMemoryType,
) -> Result<*mut c_void, OneApiError>
pub fn allocate( &mut self, size: usize, memory_type: OneApiMemoryType, ) -> Result<*mut c_void, OneApiError>
Allocate memory
Sourcepub fn free(
&mut self,
ptr: *mut c_void,
memory_type: OneApiMemoryType,
) -> Result<(), OneApiError>
pub fn free( &mut self, ptr: *mut c_void, memory_type: OneApiMemoryType, ) -> Result<(), OneApiError>
Free memory
Sourcepub fn usm_memcpy(
&mut self,
dst: *mut c_void,
src: *const c_void,
size: usize,
queue_id: u32,
) -> Result<(), OneApiError>
pub fn usm_memcpy( &mut self, dst: *mut c_void, src: *const c_void, size: usize, queue_id: u32, ) -> Result<(), OneApiError>
USM memory copy
Sourcepub fn create_context(&mut self) -> Result<u32, OneApiError>
pub fn create_context(&mut self) -> Result<u32, OneApiError>
Create SYCL context
Sourcepub fn create_queue(
&mut self,
properties: Option<SyclQueueProperties>,
) -> Result<u32, OneApiError>
pub fn create_queue( &mut self, properties: Option<SyclQueueProperties>, ) -> Result<u32, OneApiError>
Create queue
Sourcepub fn destroy_queue(&mut self, queue_id: u32) -> Result<(), OneApiError>
pub fn destroy_queue(&mut self, queue_id: u32) -> Result<(), OneApiError>
Destroy queue
Sourcepub fn wait_all(&mut self) -> Result<(), OneApiError>
pub fn wait_all(&mut self) -> Result<(), OneApiError>
Wait for all queues
Sourcepub fn get_device_properties(&self) -> &SyclDeviceProperties
pub fn get_device_properties(&self) -> &SyclDeviceProperties
Get device properties
Sourcepub fn get_stats(&self) -> &OneApiStats
pub fn get_stats(&self) -> &OneApiStats
Get statistics
Sourcepub fn query_usm_ptr(
&self,
ptr: *mut c_void,
) -> Result<UsmAllocation, OneApiError>
pub fn query_usm_ptr( &self, ptr: *mut c_void, ) -> Result<UsmAllocation, OneApiError>
Query USM pointer information
Trait Implementations§
impl Send for OneApiMemoryBackend
impl Sync for OneApiMemoryBackend
Auto Trait Implementations§
impl Freeze for OneApiMemoryBackend
impl RefUnwindSafe for OneApiMemoryBackend
impl Unpin for OneApiMemoryBackend
impl UnsafeUnpin for OneApiMemoryBackend
impl UnwindSafe for OneApiMemoryBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more