///<summary> /// This function initializes then previously created activation descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the activation mode.</param> /// <param name="reluNanOpt">Nan propagation option for the relu.</param> /// <param name="coef">floating point number to specify the clipping threashold when the activation /// mode is set to CUDNN_ACTIVATION_CLIPPED_RELU or to specify the alpha /// coefficient when the activation mode is set to CUDNN_ACTIVATION_ELU.</param> public void SetActivationDescriptor(cudnnActivationMode mode, cudnnNanPropagation reluNanOpt, double coef) { res = CudaDNNNativeMethods.cudnnSetActivationDescriptor(_desc, mode, reluNanOpt, coef); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetActivationDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function queries the parameters of the previouly initialized activation descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the activation mode.</param> /// <param name="reluNanOpt">Nan propagation option for the relu.</param> /// <param name="reluCeiling">The ceiling for the clipped relu.</param> public void GetActivationDescriptor(ref cudnnActivationMode mode, ref cudnnNanPropagation reluNanOpt, ref double reluCeiling) { res = CudaDNNNativeMethods.cudnnGetActivationDescriptor(_desc, ref mode, ref reluNanOpt, ref reluCeiling); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetActivationDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// /// </summary> /// <param name="opTensorOp"></param> /// <param name="opTensorCompType"></param> /// <param name="opTensorNanOpt"></param> public void GetOpTensorDescriptor( ref cudnnOpTensorOp opTensorOp, ref cudnnDataType opTensorCompType, ref cudnnNanPropagation opTensorNanOpt) { res = CudaDNNNativeMethods.cudnnGetOpTensorDescriptor(_desc, ref opTensorOp, ref opTensorCompType, ref opTensorNanOpt); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetOpTensorDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created generic pooling descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the pooling mode.</param> /// <param name="maxpoolingNanOpt">Nan propagation option for max pooling.</param> /// <param name="nbDims">Dimension of the pooling operation.</param> /// <param name="windowDimA">Array of dimension nbDims containing the window size for each dimension.</param> /// <param name="paddingA">Array of dimension nbDims containing the padding size for each dimension.</param> /// <param name="strideA">Array of dimension nbDims containing the striding size for each dimension.</param> public void SetPoolingNdDescriptor(cudnnPoolingMode mode, cudnnNanPropagation maxpoolingNanOpt, int nbDims, int[] windowDimA, int[] paddingA, int[] strideA ) { res = CudaDNNNativeMethods.cudnnSetPoolingNdDescriptor(_desc, mode, maxpoolingNanOpt, nbDims, windowDimA, paddingA, strideA); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetPoolingNdDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// /// </summary> /// <param name="reduceTensorOp"></param> /// <param name="reduceTensorCompType"></param> /// <param name="reduceTensorNanOpt"></param> /// <param name="reduceTensorIndices"></param> /// <param name="reduceTensorIndicesType"></param> public void GetReduceTensorDescriptor( ref cudnnReduceTensorOp reduceTensorOp, ref cudnnDataType reduceTensorCompType, ref cudnnNanPropagation reduceTensorNanOpt, ref cudnnReduceTensorIndices reduceTensorIndices, ref cudnnIndicesType reduceTensorIndicesType) { res = CudaDNNNativeMethods.cudnnGetReduceTensorDescriptor(_desc, ref reduceTensorOp, ref reduceTensorCompType, ref reduceTensorNanOpt, ref reduceTensorIndices, ref reduceTensorIndicesType); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetReduceTensorDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function queries a previously created 2D pooling descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the pooling mode.</param> /// <param name="maxpoolingNanOpt">Nan propagation option for max pooling.</param> /// <param name="windowHeight">Height of the pooling window.</param> /// <param name="windowWidth">Width of the pooling window.</param> /// <param name="verticalPadding">Size of vertical padding.</param> /// <param name="horizontalPadding">Size of horizontal padding.</param> /// <param name="verticalStride">Pooling vertical stride.</param> /// <param name="horizontalStride">Pooling horizontal stride.</param> public void GetPooling2dDescriptor(ref cudnnPoolingMode mode, ref cudnnNanPropagation maxpoolingNanOpt, ref int windowHeight, ref int windowWidth, ref int verticalPadding, ref int horizontalPadding, ref int verticalStride, ref int horizontalStride ) { res = CudaDNNNativeMethods.cudnnGetPooling2dDescriptor(_desc, ref mode, ref maxpoolingNanOpt, ref windowHeight, ref windowWidth, ref verticalPadding, ref horizontalPadding, ref verticalStride, ref horizontalStride); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetPooling2dDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// /// </summary> /// <param name="opTensorOp"></param> /// <param name="opTensorCompType"></param> /// <param name="opTensorNanOpt"></param> public void GetOpTensorDescriptor( ref cudnnOpTensorOp opTensorOp, ref cudnnDataType opTensorCompType, ref cudnnNanPropagation opTensorNanOpt) { res = CudaDNNNativeMethods.cudnnGetOpTensorDescriptor(_desc, ref opTensorOp, ref opTensorCompType, ref opTensorNanOpt); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetOpTensorDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
public static extern cudnnStatus cudnnSetPoolingNdDescriptor( cudnnPoolingDescriptor poolingDesc, cudnnPoolingMode mode, cudnnNanPropagation maxpoolingNanOpt, int nbDims, int[] windowDimA, int[] paddingA, int[] strideA );
public static extern cudnnStatus cudnnSetPooling2dDescriptor( cudnnPoolingDescriptor poolingDesc, cudnnPoolingMode mode, cudnnNanPropagation maxpoolingNanOpt, int windowHeight, int windowWidth, int verticalPadding, int horizontalPadding, int verticalStride, int horizontalStride );
public static extern cudnnStatus cudnnSetOpTensorDescriptor( cudnnOpTensorDescriptor opTensorDesc, cudnnOpTensorOp opTensorOp, cudnnDataType opTensorCompType, cudnnNanPropagation opTensorNanOpt);
public static extern cudnnStatus cudnnSetActivationDescriptor( cudnnActivationDescriptor activationDesc, cudnnActivationMode mode, cudnnNanPropagation reluNanOpt, double reluCeiling);
/// <summary> /// This function queries the parameters of the previouly initialized activation descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the activation mode.</param> /// <param name="reluNanOpt">Nan propagation option for the relu.</param> /// <param name="reluCeiling">The ceiling for the clipped relu.</param> public void GetActivationDescriptor( ref cudnnActivationMode mode, ref cudnnNanPropagation reluNanOpt, ref double reluCeiling) { res = CudaDNNNativeMethods.cudnnGetActivationDescriptor(_desc, ref mode, ref reluNanOpt, ref reluCeiling); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetActivationDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
/// <summary> /// This function initializes a previously created generic pooling descriptor object. /// </summary> /// <param name="mode">Enumerant to specify the pooling mode.</param> /// <param name="maxpoolingNanOpt">Nan propagation option for max pooling.</param> /// <param name="nbDims">Dimension of the pooling operation.</param> /// <param name="windowDimA">Array of dimension nbDims containing the window size for each dimension.</param> /// <param name="paddingA">Array of dimension nbDims containing the padding size for each dimension.</param> /// <param name="strideA">Array of dimension nbDims containing the striding size for each dimension.</param> public void SetPoolingNdDescriptor(cudnnPoolingMode mode, cudnnNanPropagation maxpoolingNanOpt, int nbDims, int[] windowDimA, int[] paddingA, int[] strideA ) { res = CudaDNNNativeMethods.cudnnSetPoolingNdDescriptor(_desc, mode, maxpoolingNanOpt, nbDims, windowDimA, paddingA, strideA); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetPoolingNdDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
/// <summary> /// This function initializes a previously created generic pooling descriptor object into a 2D description. /// </summary> /// <param name="mode">Enumerant to specify the pooling mode.</param> /// <param name="maxpoolingNanOpt">Nan propagation option for max pooling.</param> /// <param name="windowHeight">Height of the pooling window.</param> /// <param name="windowWidth">Width of the pooling window.</param> /// <param name="verticalPadding">Size of vertical padding.</param> /// <param name="horizontalPadding">Size of horizontal padding</param> /// <param name="verticalStride">Pooling vertical stride.</param> /// <param name="horizontalStride">Pooling horizontal stride.</param> public void SetPooling2dDescriptor(cudnnPoolingMode mode, cudnnNanPropagation maxpoolingNanOpt, int windowHeight, int windowWidth, int verticalPadding, int horizontalPadding, int verticalStride, int horizontalStride ) { res = CudaDNNNativeMethods.cudnnSetPooling2dDescriptor(_desc, mode, maxpoolingNanOpt, windowHeight, windowWidth, verticalPadding, horizontalPadding, verticalStride, horizontalStride); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetPooling2dDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
/// <summary> /// /// </summary> public void GetCTCLossDescriptorEx(ref cudnnDataType compType, ref cudnnLossNormalizationMode normMode, ref cudnnNanPropagation gradMode) { res = CudaDNNNativeMethods.cudnnGetCTCLossDescriptorEx(_desc, ref compType, ref normMode, ref gradMode); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetCTCLossDescriptorEx", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }