File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,15 @@ struct CPUEvent <: Event
2
2
task:: Core.Task
3
3
end
4
4
5
- function wait (ev:: CPUEvent )
6
- wait (ev. task)
5
+ function wait (ev:: CPUEvent , progress= nothing )
6
+ if progress === nothing
7
+ wait (ev. task)
8
+ else
9
+ while ! Base. istaskdone (ev. task)
10
+ progress ()
11
+ yield () # yield to the scheduler
12
+ end
13
+ end
7
14
end
8
15
9
16
function (obj:: Kernel{CPU} )(args... ; ndrange= nothing , workgroupsize= nothing , dependencies= nothing )
Original file line number Diff line number Diff line change 19
19
struct CudaEvent <: Event
20
20
event:: CuEvent
21
21
end
22
- function wait (ev:: CudaEvent )
23
- # TODO : MPI/libuv progress
24
- CUDAdrv. wait (ev. event)
22
+ function wait (ev:: CudaEvent , progress= nothing )
23
+ if progress === nothing
24
+ CUDAdrv. wait (ev. event)
25
+ else
26
+ while ! CUDAdrv. query (ev. event)
27
+ progress ()
28
+ # do we need to `yield` here?
29
+ end
30
+ end
25
31
end
26
32
27
33
@init begin
You can’t perform that action at this time.
0 commit comments