public JitContext(CudaConfig cfg, Type t_kernel) { Current.AssertNull(); Current = this; Cfg = cfg; Kernel = t_kernel.GetMethod("RunKernel", BF.All); Kernel.AssertNotNull(); Kernel.IsInstance().AssertTrue(); Kernel.Params().AssertEmpty(); (Kernel.Ret() == typeof(void)).AssertTrue(); Hir = Kernel.Decompile().Body; AllocationScheme = null; Allocator = new Allocator(); Generator = new Generator(); Module = new PtxModule(Cfg.Target, Cfg.Version); Entry = Module.AddEntry(Kernel.Name); Params = Entry.Params; }