An Encog CL platform.
Inheritance: EncogCLItem
Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
            }
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
        /// <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);
            }
        }