From 3550ecd7034ec702f744f2f721b9a90e88bd1db1 Mon Sep 17 00:00:00 2001 From: Xiaochun Tong Date: Tue, 3 Oct 2023 16:36:26 -0400 Subject: [PATCH] expose build_kernel --- luisa_compute/src/runtime/kernel.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/luisa_compute/src/runtime/kernel.rs b/luisa_compute/src/runtime/kernel.rs index a39d9f3..283180b 100644 --- a/luisa_compute/src/runtime/kernel.rs +++ b/luisa_compute/src/runtime/kernel.rs @@ -337,7 +337,15 @@ impl KernelBuilder { (resource_tracker, cpu_custom_ops, captured) }) } - fn build_callable(&mut self, body: impl FnOnce(&mut Self) -> R) -> RawCallable { + + + /// Don't use this directly + /// See [`Callable`] for how to create a callable + #[doc(hidden)] + pub fn build_callable( + &mut self, + body: impl FnOnce(&mut Self) -> R, + ) -> RawCallable { let ret = body(self); let ret_type = ret._return(); let (rt, cpu_custom_ops, captures) = self.collect_module_info(); @@ -381,7 +389,11 @@ impl KernelBuilder { } }) } - fn build_kernel( + + /// Don't use this directly + /// See [`Kernel`] for how to create a kernel + #[doc(hidden)] + pub fn build_kernel( &mut self, body: impl FnOnce(&mut Self), ) -> crate::runtime::KernelDef {