예제 #1
0
 private static void TestResult(CUresult r)
 {
     if (r != CUresult.CUDA_SUCCESS)
     {
         throw new ApplicationException("CUDA error: " + r.ToString());
     }
 }
예제 #2
0
 public static void Check(CUresult error, string message)
 {
     if (error != CUresult.CUDA_SUCCESS)
     {
         message = string.Format("{0}: {1}", error.ToString(), message);
         Exception exception = new CudaException(message);
         exception.Data.Add("CUresult", error);
         throw exception;
     }
 }
예제 #3
0
        private static void testResult(CUresult r)
        {
            //Console.WriteLine("thr = '" + Thread.CurrentThread.Priority + "'");
            //{
            //    StackFrame fr = new StackFrame(1, true);

            //    _MethodBase m = fr.GetMethod();
            //    string _name = m.DeclaringType.FullName + "." + m.Name;
            //    Console.WriteLine(_name);
            //}
            if (r != CUresult.CUDA_SUCCESS)
            {
                throw new ApplicationException("CUDA error: " + r.ToString());
            }
        }