Skip to content

Commit c954cde

Browse files
committed
More robust error message on method compilation failure
1 parent 47da204 commit c954cde

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/jlgen.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,9 @@ function ci_cache_populate(interp, cache, mi, min_world, max_world)
614614

615615
# inference should have populated our cache
616616
wvc = WorldView(cache, min_world, max_world)
617-
@assert CC.haskey(wvc, mi)
617+
if !CC.haskey(wvc, mi)
618+
throw(AssertionError("GPUCompiler: Failed to compile method for $mi, between worlds $min_world and $max_world"))
619+
end
618620
ci = CC.getindex(wvc, mi)
619621

620622
# if ci is rettype_const, the inference result won't have been cached
@@ -629,7 +631,10 @@ function ci_cache_populate(interp, cache, mi, min_world, max_world)
629631

630632
# inference should have populated our cache
631633
wvc = WorldView(cache, min_world, max_world)
632-
@assert CC.haskey(wvc, mi)
634+
635+
if !CC.haskey(wvc, mi)
636+
throw(AssertionError("GPUCompiler: Failed to compile method for $mi, between worlds $min_world and $max_world"))
637+
end
633638
ci = CC.getindex(wvc, mi)
634639

635640
# if ci is rettype_const, the inference result won't have been cached

0 commit comments

Comments
 (0)