Ejemplo n.º 1
0
        public Error Create(GlobalContext globalContext, bool useOpenCL, ComputeDeviceType deviceType, int numComputeUnits)
        {
            var error = Error.None;

            if (useOpenCL)
            {
                error = PhononCore.iplCreateComputeDevice(globalContext, deviceType, numComputeUnits, ref device);
                if (error != Error.None)
                {
                    throw new Exception("Unable to create OpenCL compute device (" + deviceType.ToString() + ", " +
                                        numComputeUnits.ToString() + " CUs): [" + error.ToString() + "]");
                }
            }

            return(error);
        }