Struct custos_math::custos::CUDA
source · pub struct CUDA {
pub cache: RefCell<Cache<CUDA>>,
pub kernel_cache: RefCell<KernelCacheCU>,
pub modules: RefCell<Vec<Module, Global>>,
pub graph: RefCell<Graph>,
/* private fields */
}Expand description
Used to perform calculations with a CUDA capable device. To make new calculations invocable, a trait providing new operations should be implemented for [CudaDevice].
Fields§
§cache: RefCell<Cache<CUDA>>§kernel_cache: RefCell<KernelCacheCU>§modules: RefCell<Vec<Module, Global>>§graph: RefCell<Graph>Implementations§
Trait Implementations§
source§impl<T: CDatatype> ActivationOps<T, (), CUDA> for CUDA
impl<T: CDatatype> ActivationOps<T, (), CUDA> for CUDA
fn sigmoid(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
fn sigmoid_grad(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
fn tanh(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
fn tanh_grad(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
fn relu(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
fn relu_grad(&self, x: &Matrix<'_, T, Self>) -> Matrix<'_, T, Self>
source§fn relu_grad_mut(&self, x: &mut Matrix<'_, T, Self, ()>)
fn relu_grad_mut(&self, x: &mut Matrix<'_, T, Self, ()>)
inplace
source§impl<T: CDatatype> AdditionalOps<T, (), CUDA> for CUDA
impl<T: CDatatype> AdditionalOps<T, (), CUDA> for CUDA
fn adds(&self, lhs: &Matrix<'_, T, CUDA>, rhs: T) -> Matrix<'_, T, CUDA>
fn muls(&self, lhs: &Matrix<'_, T, CUDA>, rhs: T) -> Matrix<'_, T, CUDA>
fn divs(&self, lhs: &Matrix<'_, T, CUDA>, rhs: T) -> Matrix<'_, T, CUDA>
fn subs(&self, lhs: &Matrix<'_, T, Self>, rhs: T) -> Matrix<'_, T, Self, ()>
source§impl<T: CDatatype> BaseOps<T, (), CUDA> for CUDA
impl<T: CDatatype> BaseOps<T, (), CUDA> for CUDA
source§fn add(
&self,
lhs: &Matrix<'_, T, Self>,
rhs: &Matrix<'_, T, Self>
) -> Matrix<'_, T, Self>
fn add( &self, lhs: &Matrix<'_, T, Self>, rhs: &Matrix<'_, T, Self> ) -> Matrix<'_, T, Self>
Element-wise addition Read more
source§fn sub(
&self,
lhs: &Matrix<'_, T, Self>,
rhs: &Matrix<'_, T, Self>
) -> Matrix<'_, T, Self>
fn sub( &self, lhs: &Matrix<'_, T, Self>, rhs: &Matrix<'_, T, Self> ) -> Matrix<'_, T, Self>
Element-wise subtraction Read more