Class LibMatrixCuDNNConvolutionAlgorithm
- java.lang.Object
-
- org.apache.sysds.runtime.matrix.data.LibMatrixCuDNNConvolutionAlgorithm
-
- All Implemented Interfaces:
AutoCloseable
public class LibMatrixCuDNNConvolutionAlgorithm extends Object implements AutoCloseable
This class is a wrapper that contain necessary data structures to invoke a cudnn convolution* functions (such as cudnnConvolutionForward, etc) It implements autocloseable to simplify the LibMatrixCuDNN code and also avoids potential memory leaks. The caller has to use the factory methods: cudnnGetConvolutionForwardAlgorithm, cudnnGetConvolutionBackwardFilterAlgorithm and cudnnGetConvolutionBackwardDataAlgorithm to get the LibMatrixCuDNNConvolutionAlgorithm object. The naming of this methods is consistent with that of CuDNN library.
-
-
Field Summary
Fields Modifier and Type Field Description intalgolongsizeInBytesjcuda.PointerworkSpace
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Deallocates the tensor and filter descriptors as well as allocated workspacestatic LibMatrixCuDNNConvolutionAlgorithmcudnnGetConvolutionBackwardDataAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)Factory method to get the algorithm wrapper for convolution backward datastatic LibMatrixCuDNNConvolutionAlgorithmcudnnGetConvolutionBackwardFilterAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)Factory method to get the algorithm wrapper for convolution backward filterstatic LibMatrixCuDNNConvolutionAlgorithmcudnnGetConvolutionForwardAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)Factory method to get the algorithm wrapper for convolution forward
-
-
-
Method Detail
-
close
public void close()
Deallocates the tensor and filter descriptors as well as allocated workspace- Specified by:
closein interfaceAutoCloseable
-
cudnnGetConvolutionForwardAlgorithm
public static LibMatrixCuDNNConvolutionAlgorithm cudnnGetConvolutionForwardAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)
Factory method to get the algorithm wrapper for convolution forward- Parameters:
gCtx- a validGPUContextinstName- the invoking instruction's name for recordStatistics.N- number of input imagesC- number of channelsH- height of each imageW- width of each imageK- number of output "channels"R- height of filterS- width of filterpad_h- padding heightpad_w- padding widthstride_h- stride heightstride_w- string widthP- output heightQ- output widthworkspaceLimit- maximum intermediate memory to use- Returns:
- algorithm wrapper
-
cudnnGetConvolutionBackwardFilterAlgorithm
public static LibMatrixCuDNNConvolutionAlgorithm cudnnGetConvolutionBackwardFilterAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)
Factory method to get the algorithm wrapper for convolution backward filter- Parameters:
gCtx- a validGPUContextinstName- the invoking instruction's name for recordStatistics.N- number of input imagesC- number of channelsH- height of each imageW- width of each imageK- number of output "channels"R- height of filterS- width of filterpad_h- padding heightpad_w- padding widthstride_h- stride heightstride_w- string widthP- output heightQ- output widthworkspaceLimit- maximum intermediate memory to use- Returns:
- algorithm wrapper
-
cudnnGetConvolutionBackwardDataAlgorithm
public static LibMatrixCuDNNConvolutionAlgorithm cudnnGetConvolutionBackwardDataAlgorithm(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, long workspaceLimit)
Factory method to get the algorithm wrapper for convolution backward data- Parameters:
gCtx- a validGPUContextinstName- the invoking instruction's name for recordStatistics.N- number of input imagesC- number of channelsH- height of each imageW- width of each imageK- number of output "channels"R- height of filterS- width of filterpad_h- padding heightpad_w- padding widthstride_h- stride heightstride_w- string widthP- output heightQ- output widthworkspaceLimit- maximum intermediate memory to use- Returns:
- algorithm wrapper
-
-