Skip to content

Commit 743b807

Browse files
committed
cleanup some debugging
1 parent 7d65cae commit 743b807

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

src/runtime.jl

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,6 @@ module Runtime
1212
using ..GPUCompiler
1313
using LLVM
1414
using LLVM.Interop
15-
using ExprTools: splitdef, combinedef
16-
17-
18-
macro device_function(ex)
19-
ex = macroexpand(__module__, ex)
20-
def = splitdef(ex)
21-
22-
# generate a function that errors
23-
def[:body] = quote
24-
error("This function is not intended for use on the CPU")
25-
end
26-
27-
esc(quote
28-
$(combinedef(def))
29-
30-
# NOTE: no use of `@consistent_overlay` here because the regular function errors
31-
Base.Experimental.@overlay($(GPUCompiler).GLOBAL_METHOD_TABLE, $ex)
32-
end)
33-
end
34-
3515

3616

3717
## representation of a runtime method instance
@@ -91,7 +71,6 @@ function compile(def, return_type, types, llvm_return_type=nothing, llvm_types=n
9171
meth = RuntimeMethodInstance(def,
9272
return_type, types, name,
9373
llvm_return_type, llvm_types, llvm_name)
94-
println("Compile called for def $(def)")
9574

9675
if haskey(methods, name)
9776
error("Runtime function $name has already been registered!")
@@ -103,7 +82,6 @@ function compile(def, return_type, types, llvm_return_type=nothing, llvm_types=n
10382
# work around that by generating an llvmcall stub. can we do better by
10483
# using the new nonrecursive codegen to handle function lookup ourselves?
10584
if def isa Symbol
106-
println("Symbol passed to compile: $(def)")
10785
args = [gensym() for typ in types]
10886
@eval @device_function @inline $def($(args...)) =
10987
ccall($("extern $llvm_name"), llvmcall, $return_type, ($(types...),), $(args...))

src/utils.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,22 @@ end
186186
## method overrides
187187

188188
Base.Experimental.@MethodTable(GLOBAL_METHOD_TABLE)
189+
using ExprTools: splitdef, combinedef
190+
macro device_function(ex)
191+
ex = macroexpand(__module__, ex)
192+
def = splitdef(ex)
193+
194+
# generate a function that errors
195+
def[:body] = quote
196+
error("This function is not intended for use on the CPU")
197+
end
198+
199+
esc(quote
200+
$(combinedef(def))
201+
202+
# NOTE: no use of `@consistent_overlay` here because the regular function errors
203+
Base.Experimental.@overlay($(GPUCompiler).GLOBAL_METHOD_TABLE, $ex)
204+
end)
205+
end
206+
207+

0 commit comments

Comments
 (0)