diff --git a/src/compile.jl b/src/compile.jl index 699d7bd..87f1994 100644 --- a/src/compile.jl +++ b/src/compile.jl @@ -20,7 +20,8 @@ end function Espresso.to_expr(op::Call) arg_names = map(make_name, op.args) call = Expr(:call, op.fn, arg_names...) - assign = (op.val isa Array || is_cuarray(op.val)) ? :(.=) : :(=) + # assign = ((op.val isa Array || is_cuarray(op.val)) && op.fn == broadcast) ? :(.=) : :(=) + assign = :(=) return Expr(assign, make_name(op.id), call) end diff --git a/src/cuda.jl b/src/cuda.jl index 5372dae..41d9358 100644 --- a/src/cuda.jl +++ b/src/cuda.jl @@ -32,7 +32,7 @@ function to_device(device::GPU, x) flds = fieldnames(T) if is_cuarray(x) return x - elseif isa(x, Real) + elseif isa(x, AbstractFloat) return Float32(x) elseif isa(x, Tuple) return ((to_device(device, el) for el in x)...,)