Page 1 of 1

Using a coprthr_event_t to coordinate host with epiphany

PostPosted: Thu Oct 20, 2016 5:57 am
by nickoppen
Hi,

Is it possible to use a variable of type coprthr_event_t to coordinate the ARM with the epiphany?

I've seen lots of examples of using an event to wait on coprthr_dwrites and as a return value from coprthr_dexec but the signal that unblocks the wait is called internally.

I'd like to set the kernel off producing results and when done, signal the ARM copy them back and prepare the next batch of data.

A variable of type coprthr_event_t seems to be a good choice or is there some other way of doing it?

nick

Re: Using a coprthr_event_t to coordinate host with epiphany

PostPosted: Thu Oct 20, 2016 7:12 pm
by jar
Nick,

If I understand you correctly...last time I tried this, the solution was...unrefined. This is something you should email the developer about for better support.

One thing to think about, though, is that it's probably faster for the Epiphany core to write the results to DRAM and signal the ARM host that the results arrived. I believe it is slower for the ARM core to read the data. Rule of thumb: writes are almost always faster than reads.

Re: Using a coprthr_event_t to coordinate host with epiphany

PostPosted: Fri Oct 21, 2016 6:53 am
by nickoppen
Thanks Jar,

Maybe I'll have to wait for the next release.

The basic structure that I was thinking of was on the ARM:

dwrite data to shared mem (batch = 1)
dexec kernels
repeat
dwrite data to shared mem (batch = 2..n)
wait_on_event()
dread from shared mem
do something with the results
until(1)

And on the epiphany

while(1)
memcpy data from shared mem
process data
write date to shared mem
signal event

Obviously there would have to be some sort of stopping criteria.

Maybe I'll just call the kernel with a number of batches prepared, prepare the next lot and then wait on the event that I get back from the dexec. When they return I can recall the kernels.

nick