Struct cudnn::Cudnn
[−]
[src]
pub struct Cudnn { /* fields omitted */ }
Provides a the high-level interface to CUDA's cuDNN.
Methods
impl Cudnn
[src]
fn new() -> Result<Cudnn, Error>
Initializes a new CUDA cuDNN context.
Make sure your current CUDA device is cuDNN enabled.
fn from_c(id: cudnnHandle_t) -> Cudnn
Initializes a new CUDA cuDNN Context from its C type.
fn id_c(&self) -> &cudnnHandle_t
Returns the CUDA cuDNN Context as its C type.
fn version() -> usize
Returns the version of the CUDA cuDNN library.
fn init_convolution(
&self,
src_desc: &TensorDescriptor,
conv_desc: ConvolutionDescriptor,
filter_desc: FilterDescriptor,
dest_desc: &TensorDescriptor
) -> Result<ConvolutionConfig, Error>
&self,
src_desc: &TensorDescriptor,
conv_desc: ConvolutionDescriptor,
filter_desc: FilterDescriptor,
dest_desc: &TensorDescriptor
) -> Result<ConvolutionConfig, Error>
Initializes the parameters and configurations for running CUDA cuDNN convolution operations.
This includes finding the right convolution algorithm, workspace size and allocating that workspace.
fn init_normalization(
&self,
lrn_n: u32,
lrn_alpha: f64,
lrn_beta: f64,
lrn_k: f64
) -> Result<NormalizationConfig, Error>
&self,
lrn_n: u32,
lrn_alpha: f64,
lrn_beta: f64,
lrn_k: f64
) -> Result<NormalizationConfig, Error>
Initializes the parameters and configurations for running CUDA cuDNN LRN operations.
fn init_pooling(
&self,
window: &[i32],
padding: &[i32],
stride: &[i32]
) -> Result<PoolingConfig, Error>
&self,
window: &[i32],
padding: &[i32],
stride: &[i32]
) -> Result<PoolingConfig, Error>
Initializes the parameters and configurations for running CUDA cuDNN Pooling operations.
fn sigmoid_forward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward Sigmoid Activation function.
Writes the result of the computation to dest_data
.
fn sigmoid_backward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Sigmoid Activation function.
Writes the result of the computation to dest_diff_data
.
fn relu_forward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward Rectified Linear Activation function.
Writes the result of the computation to dest_data
.
fn relu_backward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Rectified Linear Activation function.
Writes the result of the computation to dest_diff_data
.
fn tanh_forward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward Hyperbolic Tangent Activation function.
Writes the result of the computation to dest_data
.
fn tanh_backward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Hyperbolic Tangent Activation function.
Writes the result of the computation to dest_diff_data
.
fn convolution_forward<T>(
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
filter_data: *const c_void,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
filter_data: *const c_void,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward Convolution function.
Writes the result of the computation to dest_data
.
fn convolution_backward_bias<T>(
&self,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
bias_grad_desc: &TensorDescriptor,
bias_grad_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
bias_grad_desc: &TensorDescriptor,
bias_grad_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Convolution function w.r.t the bias.
Writes the result of the computation to bias_grad_data
.
fn convolution_backward_filter<T>(
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
filter_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
filter_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Convolution function w.r.t the filter.
Writes the result of the computation to filter_data
.
fn convolution_backward_data<T>(
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
filter_data: *const c_void,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
src_grad_desc: &TensorDescriptor,
src_grad_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
conv_config: &ConvolutionConfig,
workspace: *mut c_void,
filter_data: *const c_void,
dest_grad_desc: &TensorDescriptor,
dest_grad_data: *const c_void,
src_grad_desc: &TensorDescriptor,
src_grad_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward Convolution function w.r.t the data.
Writes the result of the computation to src_grad_data
.
fn softmax_forward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward softmax function.
Writes the result of the computation to dest_data
.
fn softmax_backward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward softmax function.
Writes the result of the computation to dest_diff_data
.
fn log_softmax_forward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward logarithmic softmax function.
Writes the result of the computation to dest_data
.
fn log_softmax_backward<T>(
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward logarithmic softmax function.
Writes the result of the computation to dest_diff_data
.
fn lrn_forward<T>(
&self,
normalization_conf: &NormalizationConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
normalization_conf: &NormalizationConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward local response normalization function.
Writes the result of the computation to dest_data
.
fn lrn_backward<T>(
&self,
normalization_conf: &NormalizationConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
normalization_conf: &NormalizationConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward local response normalization function.
Writes the result of the computation to dest_diff_data
.
fn pooling_avg_forward<T>(
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward average pooling function.
Writes the result of the computation to dest_data
.
fn pooling_avg_backward<T>(
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward average pooling function.
Writes the result of the computation to dest_diff_data
.
fn pooling_max_forward<T>(
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the forward max pooling function.
Writes the result of the computation to dest_data
.
fn pooling_max_backward<T>(
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
&self,
pooling_conf: &PoolingConfig,
src_desc: &TensorDescriptor,
src_data: *const c_void,
src_diff_desc: &TensorDescriptor,
src_diff_data: *const c_void,
dest_desc: &TensorDescriptor,
dest_data: *const c_void,
dest_diff_desc: &TensorDescriptor,
dest_diff_data: *mut c_void,
scale: ScalParams<T>
) -> Result<(), Error>
Computes the backward max pooling function.
Writes the result of the computation to dest_diff_data
.
Trait Implementations
impl Debug for Cudnn
[src]
impl Clone for Cudnn
[src]
fn clone(&self) -> Cudnn
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more