Skip to content

Commit

Permalink
remove ccall & struct, fix test GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
glou-nes committed Dec 10, 2024
1 parent ae1cd2e commit fe1c81c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/Compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ macro jit(args...)
end

is_a_module(s::Symbol)::Bool = begin
b = ccall(:jl_get_module_binding, Any, (Module, Symbol, Any), Main, s, 0)
isdefined(b, :value) && b.value isa Module
isdefined(@__MODULE__, s) && getproperty(@__MODULE__, s) isa Module
end

#create expression for more complex expression than a call
Expand All @@ -449,9 +448,7 @@ function wrapped_expression(expr::Expr)
return (
Expr(:tuple, args...),
quote
struct $fname
($fname)($(args...)) = $expr
end
($fname)($(args...)) = $expr
end,
quote
$(fname)
Expand Down
2 changes: 1 addition & 1 deletion test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end
x = Reactant.to_rarray(ones(3))
f(x) = x .+ 1
@test @jit(x + x - x + x * float(Base.pi) * 0) x
@test @jit(f(f(f(f(x))))) x .+ 4
@test @jit(f(f(f(f(x))))) @allowscalar x .+ 4
end

function sumcos(x)
Expand Down

0 comments on commit fe1c81c

Please sign in to comment.