|
6 | 6 | @assert Dagger.Sch.unwrap_nested_exception(err) isa Dagger.Sch.SchedulingException
|
7 | 7 | return Dagger.InvalidScope
|
8 | 8 | end
|
9 |
| - get_compute_scope(x::DTask) = Dagger.Sch._find_thunk(x).compute_scope |
| 9 | + function get_compute_scope(x::DTask) |
| 10 | + thunk = Dagger.Sch._find_thunk(x) |
| 11 | + return @something(thunk.options.compute_scope, thunk.options.scope, Dagger.DefaultScope()) |
| 12 | + end |
10 | 13 |
|
11 |
| - get_result_scope(x::DTask) = Dagger.Sch._find_thunk(x).result_scope |
| 14 | + get_result_scope(x::DTask) = |
| 15 | + @something(Dagger.Sch._find_thunk(x).options.result_scope, Dagger.AnyScope()) |
12 | 16 |
|
13 | 17 | get_final_result_scope(x::DTask) = @something(fetch_or_invalidscope(x), fetch(x; raw=true).scope)
|
14 | 18 |
|
|
18 | 22 | return res
|
19 | 23 | end
|
20 | 24 | thunk = Dagger.Sch._find_thunk(x)
|
21 |
| - compute_scope = thunk.compute_scope |
22 |
| - result_scope = thunk.result_scope |
23 |
| - f_scope = thunk.f isa Dagger.Chunk ? thunk.f.scope : Dagger.AnyScope() |
| 25 | + compute_scope = @something(thunk.options.compute_scope, thunk.options.scope, Dagger.DefaultScope()) |
| 26 | + result_scope = @something(thunk.options.result_scope, Dagger.AnyScope()) |
24 | 27 | inputs_scopes = Dagger.AbstractScope[]
|
25 | 28 | for input in thunk.inputs
|
| 29 | + input = Dagger.unwrap_weak_checked(Dagger.value(input)) |
26 | 30 | if input isa Dagger.Chunk
|
27 | 31 | push!(inputs_scopes, input.scope)
|
28 | 32 | else
|
29 | 33 | push!(inputs_scopes, Dagger.AnyScope())
|
30 | 34 | end
|
31 | 35 | end
|
32 |
| - return Dagger.constrain(compute_scope, result_scope, f_scope, inputs_scopes...) |
| 36 | + return Dagger.constrain(compute_scope, result_scope, inputs_scopes...) |
33 | 37 | end
|
34 | 38 |
|
35 | 39 | availprocs = collect(Dagger.all_processors())
|
|
0 commit comments