pub struct ScaleSet {
pub a: Option<*const f32>,
pub b: Option<*const f32>,
pub c: Option<*const f32>,
pub d: Option<*const f32>,
}Expand description
Bundle of optional scale pointers for cuBLASLt fp8 matmul.
Each pointer is either:
None(omit the attribute — cuBLASLt assumes scale1.0),Some(ptr)whereptris a device pointer to one or moref32scale values. For per-tensor scale supply a single f32; for per-row scale supplym(orn) f32s in row-major layout.
Fields§
§a: Option<*const f32>§b: Option<*const f32>§c: Option<*const f32>§d: Option<*const f32>Implementations§
Source§impl ScaleSet
impl ScaleSet
pub const fn empty() -> Self
pub fn with_a(self, ptr: *const f32) -> Self
pub fn with_b(self, ptr: *const f32) -> Self
pub fn with_c(self, ptr: *const f32) -> Self
pub fn with_d(self, ptr: *const f32) -> Self
pub fn is_empty(&self) -> bool
Sourcepub unsafe fn apply(&self, desc: cublasLtMatmulDesc_t) -> Result<(), String>
pub unsafe fn apply(&self, desc: cublasLtMatmulDesc_t) -> Result<(), String>
Write each Some(ptr) onto the descriptor. Returns the first error encountered, if any.
§Safety
desc must be a live cublasLtMatmulDesc_t. The scale
pointers must remain valid for the entire lifetime of any
matmul call that uses desc.
Trait Implementations§
impl Copy for ScaleSet
impl Send for ScaleSet
impl Sync for ScaleSet
Auto Trait Implementations§
impl Freeze for ScaleSet
impl RefUnwindSafe for ScaleSet
impl Unpin for ScaleSet
impl UnsafeUnpin for ScaleSet
impl UnwindSafe for ScaleSet
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