Using a coprthr_event_t to coordinate host with epiphany

Moderator: dar

Using a coprthr_event_t to coordinate host with epiphany

Postby nickoppen » Thu Oct 20, 2016 5:57 am

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
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: Using a coprthr_event_t to coordinate host with epiphany

Postby jar » Thu Oct 20, 2016 7:12 pm

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.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: Using a coprthr_event_t to coordinate host with epiphany

Postby nickoppen » Fri Oct 21, 2016 6:53 am

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
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia


Return to OpenCL

Who is online

Users browsing this forum: No registered users and 2 guests

cron