/// <summary> /// Construct a device. /// </summary> /// /// <param name="device">The OpenCL device to base on.</param> public EncogCLQueue(EncogCLDevice device) { EncogCLPlatform platform = device.Platform; this.device = device; this.commands = this.commands = new ComputeCommandQueue(platform.Context, device.Device, ComputeCommandQueueFlags.None); }
/// <summary> /// Construct an Encog OpenCL object. /// </summary> /// public EncogCL() { this.platforms = new List <EncogCLPlatform>(); this.devices = new List <EncogCLDevice>(); try { if (ComputePlatform.Platforms.Count == 0) { throw new EncogEngineError("Can't find any OpenCL platforms"); } foreach (ComputePlatform platform in ComputePlatform.Platforms) { EncogCLPlatform encogPlatform = new EncogCLPlatform(platform); platforms.Add(encogPlatform); foreach (EncogCLDevice device in encogPlatform.Devices) { devices.Add(device); } } } catch (Exception ex) { throw new MissingOpenCLAdapterError(ex); } }
/// <summary> /// Construct an OpenCL device. /// </summary> /// /// <param name="platform">The platform.</param> /// <param name="device">The device.</param> public EncogCLDevice(EncogCLPlatform platform, ComputeDevice device) { this.platform = platform; Enabled = true; this.device = device; Name = this.device.Name; Vender = this.device.Vendor; this.cpu = (this.device.Type == ComputeDeviceTypes.Cpu); this.queue = new EncogCLQueue(this); }
/// <summary> /// Construct an Encog OpenCL object. /// </summary> /// public EncogCL() { this.platforms = new List<EncogCLPlatform>(); this.devices = new List<EncogCLDevice>(); try { if (ComputePlatform.Platforms.Count == 0) throw new EncogEngineError("Can't find any OpenCL platforms"); foreach (ComputePlatform platform in ComputePlatform.Platforms) { EncogCLPlatform encogPlatform = new EncogCLPlatform(platform); platforms.Add(encogPlatform); foreach (EncogCLDevice device in encogPlatform.Devices) { devices.Add(device); } } } catch (Exception ex) { throw new MissingOpenCLAdapterError(ex); } }