File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 15
15
16
16
macro device_override (ex)
17
17
ex = macroexpand (__module__, ex)
18
- esc (quote
19
- Base. Experimental. @overlay (CUDA. method_table, $ ex)
20
- end )
18
+ if VERSION >= v " 1.12.0-DEV.745" || v " 1.11-rc1" <= VERSION < v " 1.12-"
19
+ # this requires that the overlay method f′ is consistent with f, i.e.,
20
+ # - if f(x) returns a value, f′(x) must return the identical value.
21
+ # - if f(x) throws an exception, f′(x) must also throw an exception
22
+ # (although the exceptions do not need to be identical).
23
+ esc (quote
24
+ Base. Experimental. @consistent_overlay (CUDA. method_table, $ ex)
25
+ end )
26
+ else
27
+ esc (quote
28
+ Base. Experimental. @overlay (CUDA. method_table, $ ex)
29
+ end )
30
+ end
21
31
end
22
32
23
33
macro device_function (ex)
@@ -31,7 +41,9 @@ macro device_function(ex)
31
41
32
42
esc (quote
33
43
$ (combinedef (def))
34
- @device_override $ ex
44
+
45
+ # NOTE: no use of `@consistent_overlay` here because the regular function errors
46
+ Base. Experimental. @overlay (CUDA. method_table, $ ex)
35
47
end )
36
48
end
37
49
You can’t perform that action at this time.
0 commit comments