Class LibMatrixCuDNNConvolutionAlgorithm
java.lang.Object
org.apache.sysds.runtime.matrix.data.LibMatrixCuDNNConvolutionAlgorithm
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deallocates the tensor and filter descriptors as well as allocated workspacecudnnGetConvolutionBackwardDataAlgorithm(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 datacudnnGetConvolutionBackwardFilterAlgorithm(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 filtercudnnGetConvolutionForwardAlgorithm(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
-
Field Details
-
algo
public int algo -
workSpace
public jcuda.Pointer workSpace -
sizeInBytes
public long sizeInBytes
-
-
Method Details
-
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
-