From 731a9776679b491cae234890cec8cd1d7499415e Mon Sep 17 00:00:00 2001 From: Xiaochun Tong Date: Fri, 10 Nov 2023 04:22:40 -0500 Subject: [PATCH] should fix aligned memory access --- luisa_compute/src/lang.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/luisa_compute/src/lang.rs b/luisa_compute/src/lang.rs index 6632226..ea82a49 100644 --- a/luisa_compute/src/lang.rs +++ b/luisa_compute/src/lang.rs @@ -543,16 +543,15 @@ fn make_safe_node(node: NodeRef) -> SafeNodeRef { /// check if the node belongs to the current kernel/callable /// if not, capture the node recursively fn process_potential_capture(node: SafeNodeRef) -> SafeNodeRef { - if node.node.is_user_data() { - return node; - } - with_recorder(|r| { let cur_kernel_id = r.kernel_id; assert_eq!( cur_kernel_id, node.kernel_id, "Referencing node from another kernel!" ); + if node.node.is_user_data() { + return node; + } if r.inaccessible.borrow().contains(&node.node) { panic!( r#"Detected using node outside of its scope. It is possible that you use `RefCell` or `Cell` to store an `Expr` or `Var`