Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit 4a27b89

Browse files
authored
Merge pull request #465 from JuliaGPU/tb/cuprintln_interpolation
Fix cuprintln interpolation.
2 parents 1044666 + d453f50 commit 4a27b89

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/device/cuda/output.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ end
206206

207207
@doc (@doc @cuprint) ->
208208
macro cuprintln(parts...)
209-
parts = map(part -> isa(part, Expr) || isa(part, Symbol) ? esc(part) : part, parts)
210-
quote
211-
@cuprint($(parts...), "\n")
212-
end
209+
esc(quote
210+
CUDAnative.@cuprint($(parts...), "\n")
211+
end)
213212
end

test/device/cuda.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ end
230230
_, out = @grab_output @on_device @cuprint(4, 2)
231231
@test out == "42"
232232

233+
# bug: @cuprintln failed to invokce @cuprint with endline in the case of interpolation
234+
_, out = @grab_output @on_device @cuprintln("foobar $(42)")
235+
@test out == "foobar 42\n"
233236

234-
# arugment types
237+
238+
# argument types
235239

236240
# we're testing the generated functions now, so can't use literals
237241
function test_output(val, str)

0 commit comments

Comments
 (0)