File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -698,7 +698,11 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
698
698
@assert our_proc in all_procs
699
699
our_space = only (memory_spaces (our_proc))
700
700
our_procs = filter (proc-> proc in all_procs, collect (processors (our_space)))
701
- our_scope = UnionScope (map (ExactScope, our_procs)... )
701
+ task_scope = get (spec. options, :scope , AnyScope ())
702
+ our_scope = constrain (UnionScope (map (ExactScope, our_procs)... ), task_scope)
703
+ if our_scope isa InvalidScope
704
+ throw (Sch. SchedulingException (" Scopes are not compatible: $(our_scope. x) , $(our_scope. y) " ))
705
+ end
702
706
703
707
spec. f = move (ThreadProc (myid (), 1 ), our_proc, spec. f)
704
708
@dagdebug nothing :spawn_datadeps " ($(repr (spec. f)) ) Scheduling: $our_proc ($our_space )"
Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ function test_datadeps(;args_chunks::Bool,
408
408
409
409
# FIXME : Deps
410
410
411
- # Scope
411
+ # Outer Scope
412
412
exec_procs = fetch .(Dagger. spawn_datadeps (;aliasing) do
413
413
[Dagger. @spawn Dagger. task_processor () for i in 1 : 10 ]
414
414
end )
@@ -424,6 +424,11 @@ function test_datadeps(;args_chunks::Bool,
424
424
@test proc in exec_procs
425
425
end
426
426
427
+ # Inner Scope
428
+ @test_throws Dagger. Sch. SchedulingException Dagger. spawn_datadeps () do
429
+ Dagger. @spawn scope= Dagger. ExactScope (Dagger. ThreadProc (1 , 5000 )) 1 + 1
430
+ end
431
+
427
432
# Add-to-copy
428
433
A = rand (1000 )
429
434
B = rand (1000 )
You can’t perform that action at this time.
0 commit comments