Skip to content

Commit

Permalink
Merge pull request #54 from dfdx/fix-to-device-int
Browse files Browse the repository at this point in the history
Fix to device int
  • Loading branch information
dfdx authored Feb 10, 2020
2 parents 97e1aef + 1a25598 commit 8a6d72a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/compile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)...,)
Expand Down

0 comments on commit 8a6d72a

Please sign in to comment.