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

Commit c89afec

Browse files
authored
Merge pull request #2 from JuliaGPU/sd/bool
compile error + char as bool
2 parents cb50cdf + 1160718 commit c89afec

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/compilation.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ function assemble_kernel(m::CLMethod)
210210
append!(body.args, real_body.args)
211211
body = rewrite_ast(m, body)
212212
io = Transpiler.CLIO(IOBuffer(), m)
213+
println(io, "// Inbuilds")
214+
println(io, "typedef char JLBool;")
213215
println(io, "// dependencies")
214216
visited = Set()
215217
for dep in Sugar.dependencies!(m)
@@ -252,10 +254,15 @@ function CLFunction(f::F, args::T, ctx = global_context()) where {T, F}
252254
if version > v"1.2"
253255
options *= " -cl-std=CL1.2"
254256
end
255-
p = cl.build!(
256-
cl.Program(ctx, source = source),
257-
options = options
258-
)
257+
p = try
258+
cl.build!(
259+
cl.Program(ctx, source = source),
260+
options = options
261+
)
262+
catch e
263+
println(source)
264+
rethrow(e)
265+
end
259266
kernel = cl.Kernel(p, fname)
260267
CLFunction{F, T, Tuple{ptr_extract...}}(kernel)
261268
end

0 commit comments

Comments
 (0)