File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -219,8 +219,10 @@ function gpu_aug_fwd(
219
219
220
220
# On the GPU: F is a per thread function
221
221
# On the GPU: subtape::Vector
222
- I = __index_Global_Linear (ctx)
223
- subtape[I] = forward (Const (f), Const (ctx), args... )[1 ]
222
+ if __validindex (ctx)
223
+ I = __index_Global_Linear (ctx)
224
+ subtape[I] = forward (Const (f), Const (ctx), args... )[1 ]
225
+ end
224
226
return nothing
225
227
end
226
228
@@ -241,9 +243,11 @@ function gpu_rev(
241
243
Const{Core. Typeof (ctx)},
242
244
map (Core. Typeof, args)... ,
243
245
)
244
- I = __index_Global_Linear (ctx)
245
- tp = subtape[I]
246
- reverse (Const (f), Const (ctx), args... , tp)
246
+ if __validindex (ctx)
247
+ I = __index_Global_Linear (ctx)
248
+ tp = subtape[I]
249
+ reverse (Const (f), Const (ctx), args... , tp)
250
+ end
247
251
return nothing
248
252
end
249
253
You can’t perform that action at this time.
0 commit comments