pub struct GpuDevice { /* private fields */ }Expand description
GPU device abstraction
Implementations§
Source§impl GpuDevice
impl GpuDevice
Sourcepub fn new(backend: GpuBackend, device_id: usize) -> GpuDevice
pub fn new(backend: GpuBackend, device_id: usize) -> GpuDevice
Create a new GPU device
Sourcepub fn backend(&self) -> GpuBackend
pub fn backend(&self) -> GpuBackend
Get the backend type
Sourcepub fn compile_kernel(
&self,
_source: &str,
entrypoint: &str,
) -> Result<GpuKernel, GpuError>
pub fn compile_kernel( &self, _source: &str, entrypoint: &str, ) -> Result<GpuKernel, GpuError>
Compile a kernel from source
Sourcepub fn get_info(&self) -> Result<GpuDeviceInfo, GpuError>
pub fn get_info(&self) -> Result<GpuDeviceInfo, GpuError>
Query the capabilities of this device.
Returns a GpuDeviceInfo describing the device name, type, memory,
work-group limits and supported floating-point precisions. The values are
derived deterministically from this device’s backend.
In the default Pure-Rust build no GPU SDK is linked, so the values for
hardware backends are conservative placeholders (see
GpuDeviceInfo); the method itself never fails in that configuration.
The Result return type reserves the ability to surface real adapter
query failures once live introspection is wired in.
§Errors
Currently always returns Ok. Reserved for future backends that perform
a fallible live adapter query.
Trait Implementations§
impl Copy for GpuDevice
impl Eq for GpuDevice
impl StructuralPartialEq for GpuDevice
Auto Trait Implementations§
impl Freeze for GpuDevice
impl RefUnwindSafe for GpuDevice
impl Send for GpuDevice
impl Sync for GpuDevice
impl Unpin for GpuDevice
impl UnsafeUnpin for GpuDevice
impl UnwindSafe for GpuDevice
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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