Ejemplo n.º 1
0
 private static GPGPU DoCreateDevice(eGPUType target, int deviceId = 0)
 {
     try
     {
         if (target == eGPUType.Cuda)
         {
             return(new CudaGPU(deviceId));
         }
         else if (target == eGPUType.Emulator)
         {
             return(new EmulatedGPU(deviceId));
         }
         else if (target == eGPUType.OpenCL)
         {
             return(new OpenCLDevice(deviceId));
         }
         else
         {
             throw new CudafyHostException(CudafyHostException.csX_NOT_CURRENTLY_SUPPORTED, target);
         }
     }
     catch (Exception)
     {
         throw;
     }
     throw new NotSupportedException(target.ToString());
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates the specified gpu type.
 /// </summary>
 /// <param name="gpuType">Type of the gpu.</param>
 /// <returns></returns>
 public static GPGPUR Create(eGPUType gpuType)
 {
     if (gpuType == eGPUType.Cuda)
     {
         return(new CudaR());
     }
     else
     {
         throw new NotSupportedException(gpuType.ToString());
     }
 }
Ejemplo n.º 3
0
        private static string BuildGPUName(eGPUType type, int deviceId)
        {
            string name = type.ToString() + deviceId.ToString();

            return(name);
        }
Ejemplo n.º 4
0
 private static GPGPU DoCreateDevice(eGPUType target, int deviceId = 0)
 {
     try
     {
         if (target == eGPUType.Cuda)
             return new CudaGPU(deviceId);
         else if (target == eGPUType.Emulator)
             return new EmulatedGPU(deviceId);
         else if (target == eGPUType.OpenCL)
             return new OpenCLDevice(deviceId);
         else
             throw new CudafyHostException(CudafyHostException.csX_NOT_CURRENTLY_SUPPORTED, target);
     }
     catch (Exception)
     {
         throw;
     }
     throw new NotSupportedException(target.ToString());
 }
Ejemplo n.º 5
0
 private static string BuildGPUName(eGPUType type, int deviceId)
 {
     string name = type.ToString() + deviceId.ToString();
     return name;
 }