Page 1 of 1
read/write other core local memory from OpenCL kernel
Posted:
Fri Sep 19, 2014 7:45 pm
by djm
Are there any special functions I can use to read/write other core's local memory from OpenCL kernel code, or do I need to build the other core addresses manually? How can I determine the row/col id from the id returned by get_global_id()?
Re: read/write other core local memory from OpenCL kernel
Posted:
Fri Sep 19, 2014 8:24 pm
by dar
There are, or rather were, but I need to re-validate them. I am working on a project where I happen to need to
do this so I can get back to you with a more clear answer soon. FYI here is the API that once worked on an earlier prototype platform - I will just list the calls and maybe you can read between the lines since they are designed to support exactly what you are trying to do. I do not want to post the full API spec until I can re-validate since I do not want to post something that people cannot actually use.
typedef threadspec_t;
// get thread handle based on OpenCL local ID
threadspec_t get_thread( int dim, unsigned int* ltid );
// copy contents of array into same array of another thread
void* memsync( void* ptr, size_t n, threadspec_t thrs, int flags );
// copy contents of array to a different array of another thread
void* memsend( void* src, size_t n, threadspec_t thrs, int flags );
// receive contents of an array from another thread
void* memrecv( void* dst, size_t n, threadspec_t thrs, int flags );
memsend/memrecv must be paired.
Re: read/write other core local memory from OpenCL kernel
Posted:
Fri Sep 19, 2014 10:18 pm
by djm
Awesome! Thanks again for your quick, detailed response. Looking forward to this capability!
djm
Re: read/write other core local memory from OpenCL kernel
Posted:
Sun Sep 21, 2014 1:33 am
by djm
Re: read/write other core local memory from OpenCL kernel
Posted:
Sun Sep 21, 2014 3:34 am
by dar
Try adding a barrier after the loop that initializes the local memory but before you attempt to write into other core's memory.
See if you get same results.
Re: read/write other core local memory from OpenCL kernel
Posted:
Sun Sep 21, 2014 5:49 am
by djm
Yes, that works perfectly. I should have seen that. Thanks very much!
Re: read/write other core local memory from OpenCL kernel
Posted:
Wed Oct 15, 2014 12:18 pm
by nickoppen
Hi djm,
Could you post the working version of the code, please? I'm yet to get my head around this inter-core data passing.
nick
Re: read/write other core local memory from OpenCL kernel
Posted:
Thu Oct 16, 2014 12:39 am
by djm
Re: read/write other core local memory from OpenCL kernel
Posted:
Fri Oct 17, 2014 9:03 am
by nickoppen
Thanks.