From 74c8c921503f2de0ec7deb8a6e6df1cc70e7ba7d Mon Sep 17 00:00:00 2001 From: ReversedGravity Date: Sat, 16 Sep 2023 16:51:22 +0100 Subject: [PATCH] Fixed macros for out of crate uses without `use luisa_compute::*;` --- luisa_compute/src/lang/mod.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/luisa_compute/src/lang/mod.rs b/luisa_compute/src/lang/mod.rs index dd85ab2..4b87f51 100644 --- a/luisa_compute/src/lang/mod.rs +++ b/luisa_compute/src/lang/mod.rs @@ -488,19 +488,19 @@ pub struct CpuFn { #[macro_export] macro_rules! cpu_dbg { ($arg:expr) => {{ - __cpu_dbg($arg, file!(), line!()) + $crate::lang::__cpu_dbg($arg, file!(), line!()) }}; } #[macro_export] macro_rules! lc_dbg { ($arg:expr) => {{ - __cpu_dbg($arg, file!(), line!()) + $crate::lang::__cpu_dbg($arg, file!(), line!()) }}; } #[macro_export] macro_rules! lc_unreachable { () => { - __unreachable(file!(), line!(), column!()) + $crate::lang::__unreachable(file!(), line!(), column!()) }; } #[macro_export] @@ -812,16 +812,16 @@ macro_rules! struct_ { #[macro_export] macro_rules! var { ($t:ty) => { - local_zeroed::<$t>() + $crate::lang::local_zeroed::<$t>() }; ($t:ty, 0) => { - local_zeroed::<$t>() + $crate::lang::local_zeroed::<$t>() }; ($t:ty, $init:expr) => { - local::<$t>($init.into()) + $crate::lang::local::<$t>($init.into()) }; ($e:expr) => { - def($e) + $crate::lang::def($e) }; } pub fn def, T: Value>(init: E) -> Var { @@ -2593,28 +2593,28 @@ impl SwitchBuilder { */ macro_rules! if_ { ($cond:expr, $then:block, else $else_:block) => { - if_then_else($cond, || $then, || $else_) + $crate::lang::if_then_else($cond, || $then, || $else_) }; ($cond:expr, $then:block, else, $else_:block) => { - if_then_else($cond, || $then, || $else_) + $crate::lang::if_then_else($cond, || $then, || $else_) }; ($cond:expr, $then:block, $else_:block) => { - if_then_else($cond, || $then, || $else_) + $crate::lang::if_then_else($cond, || $then, || $else_) }; ($cond:expr, $then:block) => { - if_then_else($cond, || $then, || {}) + $crate::lang::if_then_else($cond, || $then, || {}) }; } #[macro_export] macro_rules! while_ { ($cond:expr,$body:block) => { - generic_loop(|| $cond, || $body, || {}) + $crate::lang::generic_loop(|| $cond, || $body, || {}) }; } #[macro_export] macro_rules! loop_ { ($body:block) => { - while_!(const_(true), $body) + $crate::lang::while_!(const_(true), $body) }; } pub trait ForLoopRange {