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()); }
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()); }
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); } }