Expression Templates Library (ETL)
Macros | Functions | Variables
conv.hpp File Reference

Convolution implementations with NVidia cuDNN library. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 CUDNN implementation of a 2D 'valid' convolution C = I * K. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 CUDNN implementation of a 2D 'valid' convolution C = I * K. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_forward ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 cudnn implementation of a 4D 'valid' convolution C = I * K More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_forward_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 cudnn implementation of a 4D 'valid' convolution C = I * K, with flipped weights More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_filter ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 CUDNN implementation of a 4D 'valid' convolution C = I * K, where the output are considered to be kernels. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_filter_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 CUDNN implementation of a 4D 'valid' convolution C = I * K, where the output are considered to be kernels, with flipped weights. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_full ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv)
 cudnn implementation of a 2D 'full' convolution C = I * K More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_full_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv)
 cudnn implementation of a 2D 'full' convolution C = I * K More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_full ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv)
 cudnn implementation of a 4D 'full' convolution C = I * K More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_full_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv)
 cudnn implementation of a 2D 'valid' convolution C = I * K, with multiple kernels More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_multi ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 CUDNN implementation of a 2D 'valid' convolution C = I * K. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_multi_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 Standard implementation of a 2D 'valid' convolution C = I * K, with multiple flipped kernels. More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 cudnn implementation of a 4D 'valid' backward convolution C = I * K More...
 
template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_flipped ([[maybe_unused]] I &&input, [[maybe_unused]] K &&kernel, [[maybe_unused]] C &&conv, [[maybe_unused]] size_t s1, [[maybe_unused]] size_t s2, [[maybe_unused]] size_t p1, [[maybe_unused]] size_t p2)
 cudnn implementation of a 2D 'valid' backward convolution C = I * K More...
 

Variables

template<typename I , typename K , typename C >
constexpr bool etl::impl::cudnn::conv_possible = cudnn_enabled&& all_homogeneous<I, K, C>&& all_row_major<I, K, C>&& all_dma<I, K, C>
 Traits indicating if Convolution with CUDNN is possible for the given configuration. More...
 
template<typename I , typename K >
constexpr bool etl::impl::cudnn::conv_possible_ = cudnn_enabled&& all_homogeneous<I, K>&& all_row_major<I, K>&& all_dma<I, K>
 Traits indicating if Convolution with CUDNN is possible for the given configuration. More...
 

Detailed Description

Convolution implementations with NVidia cuDNN library.

Function Documentation

◆ conv2_full()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_full ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv 
)

cudnn implementation of a 2D 'full' convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv2_full_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_full_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv 
)

cudnn implementation of a 2D 'full' convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv2_valid()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

CUDNN implementation of a 2D 'valid' convolution C = I * K.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix
s1The first dimension stride
s2The second dimension stride
p1The first dimension padding (left and right)
p2The second dimension padding (top and bottom)

◆ conv2_valid_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

CUDNN implementation of a 2D 'valid' convolution C = I * K.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix
s1The first dimension stride
s2The second dimension stride
p1The first dimension padding (left and right)
p2The second dimension padding (top and bottom)

◆ conv2_valid_multi()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_multi ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

CUDNN implementation of a 2D 'valid' convolution C = I * K.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv2_valid_multi_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv2_valid_multi_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

Standard implementation of a 2D 'valid' convolution C = I * K, with multiple flipped kernels.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_data()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

cudnn implementation of a 4D 'valid' backward convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_data_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

cudnn implementation of a 2D 'valid' backward convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_data_full()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_full ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv 
)

cudnn implementation of a 4D 'full' convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_data_full_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_data_full_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv 
)

cudnn implementation of a 2D 'valid' convolution C = I * K, with multiple kernels

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_filter()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_filter ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

CUDNN implementation of a 4D 'valid' convolution C = I * K, where the output are considered to be kernels.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_backward_filter_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_backward_filter_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

CUDNN implementation of a 4D 'valid' convolution C = I * K, where the output are considered to be kernels, with flipped weights.

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_forward()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_forward ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

cudnn implementation of a 4D 'valid' convolution C = I * K

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

◆ conv4_forward_flipped()

template<typename I , typename K , typename C >
void etl::impl::cudnn::conv4_forward_flipped ( [[maybe_unused] ] I &&  input,
[[maybe_unused] ] K &&  kernel,
[[maybe_unused] ] C &&  conv,
[[maybe_unused] ] size_t  s1,
[[maybe_unused] ] size_t  s2,
[[maybe_unused] ] size_t  p1,
[[maybe_unused] ] size_t  p2 
)

cudnn implementation of a 4D 'valid' convolution C = I * K, with flipped weights

Parameters
inputThe input matrix
kernelThe kernel matrix
convThe output matrix

Variable Documentation

◆ conv_possible

template<typename I , typename K , typename C >
constexpr bool etl::impl::cudnn::conv_possible = cudnn_enabled&& all_homogeneous<I, K, C>&& all_row_major<I, K, C>&& all_dma<I, K, C>

Traits indicating if Convolution with CUDNN is possible for the given configuration.

Parameters
IThe type of the input matrix
KThe type of the kernel matrix
CThe type of the output matrix

◆ conv_possible_

template<typename I , typename K >
constexpr bool etl::impl::cudnn::conv_possible_ = cudnn_enabled&& all_homogeneous<I, K>&& all_row_major<I, K>&& all_dma<I, K>

Traits indicating if Convolution with CUDNN is possible for the given configuration.

Parameters
IThe type of the input matrix
KThe type of the kernel matrix