Skip to content

Commit

Permalink
expose build_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
shiinamiyuki committed Oct 3, 2023
1 parent 1c35b28 commit 3550ecd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions luisa_compute/src/runtime/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,15 @@ impl KernelBuilder {
(resource_tracker, cpu_custom_ops, captured)
})
}
fn build_callable<R: CallableRet>(&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<R: CallableRet>(
&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();
Expand Down Expand Up @@ -381,7 +389,11 @@ impl KernelBuilder {
}
})
}
fn build_kernel<S: KernelSignature>(

/// Don't use this directly
/// See [`Kernel`] for how to create a kernel
#[doc(hidden)]
pub fn build_kernel<S: KernelSignature>(
&mut self,
body: impl FnOnce(&mut Self),
) -> crate::runtime::KernelDef<S> {
Expand Down

0 comments on commit 3550ecd

Please sign in to comment.