Пример #1
0
 /// <summary>
 /// An opaque structure holding the description of an activation operation.
 /// </summary>
 public AlgorithmDescriptor()
 {
     _desc = new cudnnAlgorithmDescriptor();
     res   = CudaDNNNativeMethods.cudnnCreateAlgorithmDescriptor(ref _desc);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnCreateAlgorithmDescriptor", res));
     if (res != cudnnStatus.Success)
     {
         throw new CudaDNNException(res);
     }
 }
        public void GetAlgorithmPerformance(int index, ref AlgorithmDescriptor algoDesc, ref cudnnStatus status, ref float time, ref SizeT memory)
        {
            cudnnAlgorithmDescriptor descTemp = new cudnnAlgorithmDescriptor();

            res = CudaDNNNativeMethods.cudnnGetAlgorithmPerformance(_perfs[index], ref descTemp, ref status, ref time, ref memory);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetAlgorithmPerformance", res));
            if (res != cudnnStatus.Success)
            {
                throw new CudaDNNException(res);
            }
            algoDesc = new AlgorithmDescriptor(descTemp);
        }
Пример #3
0
 /// <summary>
 /// An opaque structure holding the description of an activation operation.
 /// </summary>
 public AlgorithmDescriptor(cudnnAlgorithmDescriptor desc)
 {
     _desc = desc;
 }