Skip to content

Commit

Permalink
Merge pull request #6 from iMplode-nZ/main
Browse files Browse the repository at this point in the history
Fixed macros for out of crate uses without `use luisa_compute::*;`
  • Loading branch information
Mike-Leo-Smith authored Sep 16, 2023
2 parents 2ab1a4c + 74c8c92 commit 3601801
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions luisa_compute/src/lang/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,19 +488,19 @@ pub struct CpuFn<T: Value> {
#[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]
Expand Down Expand Up @@ -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<E: ExprProxy<Value = T>, T: Value>(init: E) -> Var<T> {
Expand Down Expand Up @@ -2593,28 +2593,28 @@ impl<R: Aggregate> SwitchBuilder<R> {
*/
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 {
Expand Down

0 comments on commit 3601801

Please sign in to comment.