Files
leleka/crates/cuda-driver/src/ple_batch_ffi/impl_kernelarguments.rs
T

62 lines
2.1 KiB
Rust

//! Moved out of the parent module by STRA-338: impl KernelArguments, impl Blas, impl KernelModule.
#[allow(unused_imports)]
use super::*;
impl KernelArguments {
pub(crate) fn new(values: Vec<BatchArg>) -> Self {
Self { values: values.into_boxed_slice(), null: 0, pointers: Vec::new(), addresses: Vec::new() }
}
}
#[cfg(not(all(
feature = "cuda-driver",
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
)))]
impl Blas {
pub(crate) fn load(_: BufferHandle, _: usize) -> Result<Self> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn stream(&self) -> usize {
0
}
pub(crate) fn gemm_bf16(&self, _: GemmOperands, _: GemmDims, _: GemmScalars<'_>) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn gemm_f16(&self, _: GemmOperands, _: GemmDims, _: GemmScalars<'_>) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn gemm_bf16_interleaved_ab(&self, _: GemmOperands, _: i32, _: bool, _: GemmScalars<'_>) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn gemm_gdn(&self, _: GemmOperands, _: GemmDims, _: GdnGemmLayout, _: &f32) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn synchronize(&self) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn close(self) -> Result<()> {
Ok(())
}
}
#[cfg(not(all(
feature = "cuda-driver",
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
)))]
impl KernelModule {
pub(crate) fn load(_: &'static [u8], _: &'static [&'static CStr]) -> Result<Self> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn launch(&self, _: usize, _: LinearLaunch, args: &mut KernelArguments) -> Result<()> {
let _ = (&args.values, &args.null, &args.pointers, &args.addresses);
Err(Error::UnsupportedPlatform)
}
pub(crate) fn launch_cluster(&self, _: usize, _: ClusterShape, _: usize, _: &mut KernelArguments) -> Result<()> {
Err(Error::UnsupportedPlatform)
}
pub(crate) fn close(self) -> Result<()> {
Ok(())
}
}