Expression Templates Library (ETL)
Classes | Macros | Functions
cudnn.hpp File Reference

Utility functions for cudnn. More...

#include "cudnn.h"
Include dependency graph for cudnn.hpp:

Go to the source code of this file.

Classes

struct  etl::impl::cudnn::cudnn_handle
 RTTI helper to manage CUDNN handle. More...
 
struct  etl::impl::cudnn::cudnn_wrapper< T >
 Wrapper for CUDNN tensor. More...
 
struct  etl::impl::cudnn::cudnn_desc_cache_value< Value >
 
struct  etl::impl::cudnn::cudnn_desc_cache< Key, Value >
 

Macros

#define cudnn_check(call)
 

Functions

cudnn_handle & etl::impl::cudnn::start_cudnn ()
 Start cudnn and return a RTTI helper over a raw cudnn handle. More...
 
template<etl_1d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<typename I >
cudnn_wrapper< cudnnTensorDescriptor_t > etl::impl::cudnn::create_tensor_wrapper (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<etl_3d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_5d (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<typename I >
cudnn_wrapper< cudnnTensorDescriptor_t > etl::impl::cudnn::create_tensor_wrapper_5d (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<typename I >
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_flat (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<typename I >
cudnn_wrapper< cudnnTensorDescriptor_t > etl::impl::cudnn::create_tensor_flat_wrapper (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<etl_1d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_front (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<typename I >
cudnn_wrapper< cudnnTensorDescriptor_t > etl::impl::cudnn::create_tensor_front_wrapper (I &&input)
 Create a CUDNN tensor for the given input matrix. More...
 
template<etl_2d I>
cudnnFilterDescriptor_t etl::impl::cudnn::create_filter (I &&kernel)
 Create a CUDNN filter tensor for the given input matrix. More...
 
template<typename I >
cudnn_wrapper< cudnnFilterDescriptor_t > etl::impl::cudnn::create_filter_wrapper (I &&kernel)
 Create a CUDNN filter tensor for the given input matrix. More...
 
cudnnPoolingDescriptor_t etl::impl::cudnn::create_pooling_desc (cudnnPoolingMode_t mode, size_t c1, size_t c2, size_t s1, size_t s2, size_t p1, size_t p2)
 Create a CUDNN pooling descriptor for the given input matrix. More...
 
cudnn_wrapper< cudnnPoolingDescriptor_t > etl::impl::cudnn::create_pooling_desc_wrapper (cudnnPoolingMode_t mode, size_t c1, size_t c2, size_t s1, size_t s2, size_t p1, size_t p2)
 Create a CUDNN pooling descriptor for the given input matrix. More...
 
cudnnPoolingDescriptor_t etl::impl::cudnn::create_pooling_desc (cudnnPoolingMode_t mode, size_t c1, size_t c2, size_t c3, size_t s1, size_t s2, size_t s3, size_t p1, size_t p2, size_t p3)
 Create a CUDNN pooling descriptor for the given input matrix. More...
 
cudnn_wrapper< cudnnPoolingDescriptor_t > etl::impl::cudnn::create_pooling_desc_wrapper (cudnnPoolingMode_t mode, size_t c1, size_t c2, size_t c3, size_t s1, size_t s2, size_t s3, size_t p1, size_t p2, size_t p3)
 Create a CUDNN pooling descriptor for the given input matrix. More...
 

Detailed Description

Utility functions for cudnn.

Macro Definition Documentation

◆ cudnn_check

#define cudnn_check (   call)
Value:
{ \
cudnnStatus_t status = call; \
if (status != CUDNN_STATUS_SUCCESS) { \
std::cerr << "CUDNN error: " << cudnnGetErrorString(status) << " from " << #call << std::endl \
<< "from " << __FILE__ << ":" << __LINE__ << std::endl; \
} \
}

Function Documentation

◆ create_filter()

template<etl_2d I>
cudnnFilterDescriptor_t etl::impl::cudnn::create_filter ( I &&  kernel)

Create a CUDNN filter tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
the created CUDNN filter tensor

◆ create_filter_wrapper()

template<typename I >
cudnn_wrapper<cudnnFilterDescriptor_t> etl::impl::cudnn::create_filter_wrapper ( I &&  kernel)

Create a CUDNN filter tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
a cudnn_wrapper around a created CUDNN filter tensor

◆ create_pooling_desc() [1/2]

cudnnPoolingDescriptor_t etl::impl::cudnn::create_pooling_desc ( cudnnPoolingMode_t  mode,
size_t  c1,
size_t  c2,
size_t  s1,
size_t  s2,
size_t  p1,
size_t  p2 
)
inline

Create a CUDNN pooling descriptor for the given input matrix.

Returns
the created CUDNN filter tensor

◆ create_pooling_desc() [2/2]

cudnnPoolingDescriptor_t etl::impl::cudnn::create_pooling_desc ( cudnnPoolingMode_t  mode,
size_t  c1,
size_t  c2,
size_t  c3,
size_t  s1,
size_t  s2,
size_t  s3,
size_t  p1,
size_t  p2,
size_t  p3 
)
inline

Create a CUDNN pooling descriptor for the given input matrix.

Returns
the created CUDNN filter tensor

◆ create_pooling_desc_wrapper() [1/2]

cudnn_wrapper<cudnnPoolingDescriptor_t> etl::impl::cudnn::create_pooling_desc_wrapper ( cudnnPoolingMode_t  mode,
size_t  c1,
size_t  c2,
size_t  s1,
size_t  s2,
size_t  p1,
size_t  p2 
)
inline

Create a CUDNN pooling descriptor for the given input matrix.

Returns
a cudnn_wrapper around a created CUDNN filter tensor

◆ create_pooling_desc_wrapper() [2/2]

cudnn_wrapper<cudnnPoolingDescriptor_t> etl::impl::cudnn::create_pooling_desc_wrapper ( cudnnPoolingMode_t  mode,
size_t  c1,
size_t  c2,
size_t  c3,
size_t  s1,
size_t  s2,
size_t  s3,
size_t  p1,
size_t  p2,
size_t  p3 
)
inline

Create a CUDNN pooling descriptor for the given input matrix.

Returns
a cudnn_wrapper around a created CUDNN filter tensor

◆ create_tensor()

template<etl_1d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
the created CUDNN tensor

◆ create_tensor_5d()

template<etl_3d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_5d ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
the created CUDNN tensor

◆ create_tensor_flat()

template<typename I >
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_flat ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
the created CUDNN tensor

◆ create_tensor_flat_wrapper()

template<typename I >
cudnn_wrapper<cudnnTensorDescriptor_t> etl::impl::cudnn::create_tensor_flat_wrapper ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
a cudnn_wrapper around a created CUDNN tensor

◆ create_tensor_front()

template<etl_1d I>
cudnnTensorDescriptor_t etl::impl::cudnn::create_tensor_front ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
the created CUDNN tensor

◆ create_tensor_front_wrapper()

template<typename I >
cudnn_wrapper<cudnnTensorDescriptor_t> etl::impl::cudnn::create_tensor_front_wrapper ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
a cudnn_wrapper around a created CUDNN tensor

◆ create_tensor_wrapper()

template<typename I >
cudnn_wrapper<cudnnTensorDescriptor_t> etl::impl::cudnn::create_tensor_wrapper ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
a cudnn_wrapper around a created CUDNN tensor

◆ create_tensor_wrapper_5d()

template<typename I >
cudnn_wrapper<cudnnTensorDescriptor_t> etl::impl::cudnn::create_tensor_wrapper_5d ( I &&  input)

Create a CUDNN tensor for the given input matrix.

Parameters
inputThe input matrix
Returns
a cudnn_wrapper around a created CUDNN tensor

◆ start_cudnn()

cudnn_handle& etl::impl::cudnn::start_cudnn ( )
inline

Start cudnn and return a RTTI helper over a raw cudnn handle.

Returns
RTTI helper over a raw cudnn handle