Пример #1
0
 public static Func <T1, T2, T3, T4, T5, T6, TRes> Function <T1, T2, T3, T4, T5, T6, TRes> (
     Expression <Func <Func <T1, T2, T3, T4, T5, T6, TRes> > > member,
     Expression <Func <T1, T2, T3, T4, T5, T6, TRes> > func)
 {
     ClcParser.CreateFunction((member.Body as MemberExpression).Member, func);
     return(func.Compile());
 }
Пример #2
0
 public static Macro <T1, T2, T3, T4, T5, T6, TRes> Macro <T1, T2, T3, T4, T5, T6, TRes> (
     Expression <Func <Macro <T1, T2, T3, T4, T5, T6, TRes> > > member,
     Expression <Macro <T1, T2, T3, T4, T5, T6, TRes> > macro)
 {
     ClcParser.CreateMacro((member.Body as MemberExpression).Member, macro);
     return(macro.Compile());
 }
Пример #3
0
        public CLProgram(CLContext context, params CLKernel[] kernels)
        {
            var source = ClcParser.CompileKernels(kernels);

            Console.WriteLine(source);
            _comProgram = new ComputeProgram(context._comContext, source);
            try
            {
                _comProgram.Build(null, null, null, IntPtr.Zero);
            }
            catch (BuildProgramFailureComputeException)
            {
                throw new CLError("Error building program. Build log:\n" +
                                  _comProgram.GetBuildLog(_comProgram.Devices.First()));
            }
            foreach (var kernel in kernels)
            {
                kernel._comKernel = _comProgram.CreateKernel(kernel.Name);
            }
        }