示例#1
0
 /// <summary>
 /// Release OpenCL objects (final)
 /// </summary>
 internal static void Release()
 {
     try
     {
         CLError err;
         // ADD YOUR CODE HERE
         err = OpenCLDriver.clReleaseCommandQueue(comQ);
         if (err != CLError.Success)
         {
             throw new Exception(err.ToString());
         }
         err = OpenCLDriver.clReleaseKernel(kernel_mult);
         if (err != CLError.Success)
         {
             throw new Exception(err.ToString());
         }
         err = OpenCLDriver.clReleaseContext(ctx);
         if (err != CLError.Success)
         {
             throw new Exception(err.ToString());
         }
         err = OpenCLDriver.clUnloadCompiler();
         if (err != CLError.Success)
         {
             throw new Exception(err.ToString());
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.ToString());
     }
 }