pub struct Device(/* private fields */);Expand description
The Device struct encapsulates a single SYCL device on which kernels can be executed.
The Device struct provides the common reference semantics.
Implementations§
Source§impl Device
impl Device
Sourcepub fn get_devices() -> Vec<Self>
pub fn get_devices() -> Vec<Self>
Returns a Vec containing all the root devices from all SYCL backends
available in the system which have the device type encapsulated by DeviceType.
Sourcepub fn get_platform(&self) -> Platform
pub fn get_platform(&self) -> Platform
Returns the associated SYCL platform.
Sourcepub fn has(&self, aspect: Aspect) -> bool
pub fn has(&self, aspect: Aspect) -> bool
Returns whether this device has the requested aspect.
Sourcepub fn can_access_peer(&mut self, peer: &Device, value: PeerAccess) -> bool
pub fn can_access_peer(&mut self, peer: &Device, value: PeerAccess) -> bool
Queries the peer access status between this device and peer according to the query
value.
PeerAccess::AccessSupported: Returns true only if it is possible for this device to
enable peer access to USM device memory allocations located on the peer device.
PeerAccess::AtomicsSupported: When this query returns true, it indicates that this
device may concurrently access and atomically modify USM device memory allocations located
on the peer device when peer access is enabled to that device.
Sourcepub fn enable_peer_access(&mut self, peer: &Device) -> Result<()>
pub fn enable_peer_access(&mut self, peer: &Device) -> Result<()>
Enables this device to access USM device allocations located on the peer device. This does not permit the peer device to access this device’s memory.
Once this access is enabled, SYCL kernel functions and the explicit memory functions may access USM device allocations on the peer device subject to the normal rules about context as described in the core SYCL specification.
Sourcepub fn disable_peer_access(&mut self, peer: &Device) -> Result<()>
pub fn disable_peer_access(&mut self, peer: &Device) -> Result<()>
Disables access to the peer device’s memory from this device.