/// <summary> /// Retrieves the values stored in a previously initialized tensor transform descriptor. /// </summary> public void GetTensorTransformDescriptor(uint nbDims, cudnnTensorFormat destFormat, int[] padBeforeA, int[] padAfterA, uint[] foldA, cudnnFoldingDirection direction) { res = CudaDNNNativeMethods.cudnnGetTensorTransformDescriptor(_desc, nbDims, ref destFormat, padBeforeA, padAfterA, foldA, ref direction); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetTensorTransformDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created filter descriptor object. Filters layout must /// be contiguous in memory. /// </summary> /// <param name="dataType">Data type.</param> /// <param name="format">Enumerant holding the layout format.</param> /// <param name="nbDims">Dimension of the filter.</param> /// <param name="filterDimA">Array of dimension nbDims containing the size of the filter for each dimension.</param> public void SetFilterNdDescriptor(cudnnDataType dataType, // image data type cudnnTensorFormat format, int nbDims, int[] filterDimA ) { res = CudaDNNNativeMethods.cudnnSetFilterNdDescriptor(_desc, dataType, format, nbDims, filterDimA); Debug.Write(""); //Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetFilterNdDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created generic Tensor descriptor object. /// </summary> /// <param name="tensorDesc">Handle to a previously created tensor descriptor.</param> /// <param name="format"></param> /// <param name="dataType">Data type.</param> /// <param name="nbDims">Dimension of the tensor.</param> /// <param name="dimA">Array of dimension nbDims that contain the size of the tensor for every dimension.</param> public void SetTensorNdDescriptorEx( cudnnTensorDescriptor tensorDesc, cudnnTensorFormat format, cudnnDataType dataType, int nbDims, int[] dimA) { res = CudaDNNNativeMethods.cudnnSetTensorNdDescriptorEx(_desc, format, dataType, nbDims, dimA); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetTensorNdDescriptorEx", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function queries a previously initialized filter descriptor object. /// </summary> /// <param name="nbDimsRequested">Dimension of the expected filter descriptor. It is also the minimum size of /// the arrays filterDimA in order to be able to hold the results</param> /// <param name="dataType">Data type.</param> /// <param name="format">Enumerant holding the layout format.</param> /// <param name="nbDims">Actual dimension of the filter.</param> /// <param name="filterDimA">Array of dimension of at least nbDimsRequested that will be filled with /// the filter parameters from the provided filter descriptor.</param> public void GetFilterNdDescriptor(int nbDimsRequested, ref cudnnDataType dataType, // image data type ref cudnnTensorFormat format, ref int nbDims, int[] filterDimA ) { res = CudaDNNNativeMethods.cudnnGetFilterNdDescriptor(_desc, nbDimsRequested, ref dataType, ref format, ref nbDims, filterDimA); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetFilterNdDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created generic Tensor descriptor object into a /// 4D tensor. The strides of the four dimensions are inferred from the format parameter /// and set in such a way that the data is contiguous in memory with no padding between /// dimensions. /// </summary> /// <param name="format">Type of format.</param> /// <param name="dataType">Data type.</param> /// <param name="n">Number of images.</param> /// <param name="c">Number of feature maps per image.</param> /// <param name="h">Height of each feature map.</param> /// <param name="w">Width of each feature map.</param> public void SetTensor4dDescriptor(cudnnTensorFormat format, cudnnDataType dataType, // image data type int n, // number of inputs (batch size) int c, // number of input feature maps int h, // height of input section int w // width of input section ) { res = CudaDNNNativeMethods.cudnnSetTensor4dDescriptor(_desc, format, dataType, n, c, h, w); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetTensor4dDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function queries the parameters of the previouly initialized filter descriptor object. /// </summary> /// <param name="dataType">Data type.</param> /// <param name="format">Enumerant holding the layout format.</param> /// <param name="k">Number of output feature maps.</param> /// <param name="c">Number of input feature maps.</param> /// <param name="h">Height of each filter.</param> /// <param name="w">Width of each filter.</param> public void GetFilter4dDescriptor(ref cudnnDataType dataType, // image data type ref cudnnTensorFormat format, ref int k, // number of output feature maps ref int c, // number of input feature maps ref int h, // height of each input filter ref int w // width of each input fitler ) { res = CudaDNNNativeMethods.cudnnGetFilter4dDescriptor(_desc, ref dataType, ref format, ref k, ref c, ref h, ref w); Debug.Write(""); //Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetFilter4dDescriptor", res)); if (res != cudnnStatus.Success) { throw new CudaDNNException(res); } }
/// <summary> /// This function initializes a previously created generic Tensor descriptor object into a /// 4D tensor. The strides of the four dimensions are inferred from the format parameter /// and set in such a way that the data is contiguous in memory with no padding between /// dimensions. /// </summary> /// <param name="format">Type of format.</param> /// <param name="dataType">Data type.</param> /// <param name="n">Number of images.</param> /// <param name="c">Number of feature maps per image.</param> /// <param name="h">Height of each feature map.</param> /// <param name="w">Width of each feature map.</param> public void SetTensor4dDescriptor(cudnnTensorFormat format, cudnnDataType dataType, // image data type int n, // number of inputs (batch size) int c, // number of input feature maps int h, // height of input section int w // width of input section ) { res = CudaDNNNativeMethods.cudnnSetTensor4dDescriptor(_desc, format, dataType, n, c, h, w); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetTensor4dDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
/// <summary> /// This function initializes a previously created filter descriptor object. Filters layout must /// be contiguous in memory. /// </summary> /// <param name="dataType">Data type.</param> /// <param name="format">Enumerant holding the layout format.</param> /// <param name="nbDims">Dimension of the filter.</param> /// <param name="filterDimA">Array of dimension nbDims containing the size of the filter for each dimension.</param> public void SetFilterNdDescriptor(cudnnDataType dataType, // image data type cudnnTensorFormat format, int nbDims, int[] filterDimA ) { res = CudaDNNNativeMethods.cudnnSetFilterNdDescriptor(_desc, dataType, format, nbDims, filterDimA); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetFilterNdDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
/// <summary> /// This function initializes a previously created filter descriptor object into a 4D filter. /// Filters layout must be contiguous in memory. /// </summary> /// <param name="dataType">Data type.</param> /// <param name="format">Enumerant holding the layout format.</param> /// <param name="k">Number of output feature maps.</param> /// <param name="c">Number of input feature maps.</param> /// <param name="h">Height of each filter.</param> /// <param name="w">Width of each filter.</param> public void SetFilter4dDescriptor(cudnnDataType dataType, // image data type cudnnTensorFormat format, int k, // number of output feature maps int c, // number of input feature maps int h, // height of each input filter int w // width of each input fitler ) { res = CudaDNNNativeMethods.cudnnSetFilter4dDescriptor(_desc, dataType, format, k, c, h, w); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSetFilter4dDescriptor", res)); if (res != cudnnStatus.Success) throw new CudaDNNException(res); }
public static extern cudnnStatus cudnnSetTensor4dDescriptor(cudnnTensorDescriptor tensorDesc, cudnnTensorFormat format, cudnnDataType dataType, // image data type int n, // number of inputs (batch size) int c, // number of input feature maps int h, // height of input section int w // width of input section );
public static extern cudnnStatus cudnnSetFilterNdDescriptor(cudnnFilterDescriptor filterDesc, cudnnDataType dataType, // image data type cudnnTensorFormat format, // layout format int nbDims, int[] filterDimA );
public static extern cudnnStatus cudnnSetFilter4dDescriptor(cudnnFilterDescriptor filterDesc, cudnnDataType dataType, // image data type cudnnTensorFormat format, // layout format int k, // number of output feature maps int c, // number of input feature maps int h, // height of each input filter int w // width of each input fitler );
public static extern cudnnStatus cudnnGetFilterNdDescriptor(cudnnFilterDescriptor filterDesc, int nbDimsRequested, ref cudnnDataType dataType, // image data type ref cudnnTensorFormat format, // layout format ref int nbDims, int[] filterDimA );