Esempio n. 1
0
        internal IComputeKernel CreateKernel(CLKernelHandle handle)
        {
            var kernel = new ComputeKernel110();

            kernel.Handle = handle;
            kernel.SetID(kernel.Handle.Value);
            kernel.FunctionName = kernel.GetStringInfo(kernel.Handle, ComputeKernelInfo.FunctionName, OpenCL110.GetKernelInfoWrapper);
            logger.Info("Create " + this + " in Thread(" + Thread.CurrentThread.ManagedThreadId + ").", "Information");
            return(kernel);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a kernel for a kernel function of a specified name.
        /// </summary>
        /// <returns> The created kernel. </returns>
        public IComputeKernel CreateKernel(IComputeProgram program, string functionName)
        {
            var kernel = new ComputeKernel110();

            kernel.Handle = OpenCL110.CreateKernel(
                program.Handle,
                functionName,
                out ComputeErrorCode error);
            ComputeException.ThrowOnError(error);

            kernel.SetID(kernel.Handle.Value);
            kernel.FunctionName = functionName;
            logger.Info("Create " + this + " in Thread(" + Thread.CurrentThread.ManagedThreadId + ").", "Information");
            return(kernel);
        }