An Encog CL platform.
상속: EncogCLItem
예제 #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);
        }
예제 #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);
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
            }
        }