public static extern cudnnStatus cudnnGetConvolutionBackwardFilterAlgorithm( cudnnHandle             handle,
                                                                      cudnnTensorDescriptor          srcDesc,
                                                                      cudnnTensorDescriptor          diffDesc,
                                                                      cudnnConvolutionDescriptor     convDesc, 
                                                                      cudnnFilterDescriptor          gradDesc,
                                                                      cudnnConvolutionBwdFilterPreference  preference,
                                                                      SizeT                                memoryLimitInbytes,
                                                                      ref cudnnConvolutionBwdFilterAlgo algo
                                                                     );
Example #2
0
		/// <summary>
		/// This function serves as a heuristic for obtaining the best suited algorithm for
		/// cudnnConvolutionBackwardFilter_v3 for the given layer specifications. Based
		/// on the input preference, this function will either return the fastest algorithm or the
		/// fastest algorithm within a given memory limit. For an exhaustive search for the fastest
		/// algorithm, please use cudnnFindConvolutionBackwardFilterAlgorithm.
		/// </summary>
		/// <param name="srcDesc">Handle to the previously initialized input tensor descriptor.</param>
		/// <param name="diffDesc">Handle to the previously initialized input differential tensor descriptor.</param>
		/// <param name="convDesc">Previously initialized convolution descriptor.</param>
		/// <param name="gradDesc">Handle to a previously initialized filter descriptor.</param>
		/// <param name="preference">Enumerant to express the preference criteria in terms of memory requirement and speed.</param>
		/// <param name="memoryLimitInbytes">It is to specify the maximum amount of GPU memory the user is willing to 
		/// use as a workspace. This is currently a placeholder and is not used.</param>
		/// <returns>Enumerant that specifies which convolution algorithm should be used to
		/// compute the results according to the specified preference</returns>
		public cudnnConvolutionBwdFilterAlgo GetConvolutionBackwardFilterAlgorithm(TensorDescriptor srcDesc,
															TensorDescriptor diffDesc,
															ConvolutionDescriptor convDesc,
															FilterDescriptor gradDesc,
															cudnnConvolutionBwdFilterPreference preference,
															SizeT memoryLimitInbytes
															)
		{
			cudnnConvolutionBwdFilterAlgo algo = new cudnnConvolutionBwdFilterAlgo();
			res = CudaDNNNativeMethods.cudnnGetConvolutionBackwardFilterAlgorithm(_handle, srcDesc.Desc, diffDesc.Desc, convDesc.Desc, gradDesc.Desc, preference, memoryLimitInbytes, ref algo);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetConvolutionBackwardFilterAlgorithm", res));
			if (res != cudnnStatus.Success) throw new CudaDNNException(res);
			return algo;
		}