diff --git a/luisa_compute/src/runtime/kernel.rs b/luisa_compute/src/runtime/kernel.rs index ad6226e..3748879 100644 --- a/luisa_compute/src/runtime/kernel.rs +++ b/luisa_compute/src/runtime/kernel.rs @@ -1,4 +1,4 @@ -use crate::lang::{pop_recorder, push_recorder, soa::SoaMetadata}; +use crate::lang::{pop_recorder, push_recorder, soa::SoaMetadata, KERNEL_ID}; use super::*; @@ -191,6 +191,7 @@ impl KernelBuilder { let r = r.borrow(); if is_kernel { assert!(r.is_none(), "Cannot record a kernel inside another kernel"); + KERNEL_ID.fetch_add(1, std::sync::atomic::Ordering::Relaxed); } }); push_recorder(); diff --git a/luisa_compute/tests/misc.rs b/luisa_compute/tests/misc.rs index 9ec6297..459fecb 100644 --- a/luisa_compute/tests/misc.rs +++ b/luisa_compute/tests/misc.rs @@ -178,7 +178,7 @@ fn callable_return_void_mismatch() { } #[test] #[should_panic] -fn callable_illegall_sharing() { +fn callable_illegal_sharing() { let device = get_device(); let tid = RefCell::new(None); Kernel::::new(&device, &|| {