コード例 #1
0
        private void SetupKernel(string programText)
        {
            //Abort if Command Queue is not ready
            if ((status & Status.CommandQueueNotReady) == Status.CommandQueueNotReady)
            {
                return;
            }

            //Load kernel
            using (Program program = ClContextManager.BuildProgram(context, device, programText, out error))
            {
                if (IsErrorOccurred())
                {
                    return;
                }

                AddKernel(program);
            }

            //Kernel is ready
            if (!IsErrorOccurred())
            {
                status ^= Status.KernelNotReady;
            }
        }
コード例 #2
0
        private void SetupContext()
        {
            //Abort if device is not ready
            if ((status & Status.DeviceNotReady) == Status.DeviceNotReady)
            {
                return;
            }

            //Create context
            context = ClContextManager.CreateContext(device, out error);

            //Context is ready
            if (!IsErrorOccurred())
            {
                status ^= Status.ContextNotReady;
            }
        }
コード例 #3
0
        private void SetupCommandQueue()
        {
            //Abort if context is not ready
            if ((status & Status.ContextNotReady) == Status.ContextNotReady)
            {
                return;
            }

            //Create Command Queue
            commandQueue = ClContextManager.CreateCommandQueue(context, device, out error);

            //Command Queue is ready
            if (!IsErrorOccurred())
            {
                status ^= Status.CommandQueueNotReady;
            }
        }