[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - hello_opencl.c

hello_opencl.c

Moderator: dar

hello_opencl.c

Postby djm » Mon Sep 15, 2014 8:28 pm

djm
 
Posts: 11
Joined: Mon Sep 15, 2014 5:08 am

Re: hello_opencl.c

Postby dar » Mon Sep 15, 2014 10:29 pm

Yes, that's a bug. Keep in mind hello_stdcl gets more attention from the developer than hello_opencl.

Its implied that all of the "hello" program are not efficient - they are tutorial in nature. If you really wanted to make this example as efficient as possible, you would start by changing the host program to use a global index of 16 and fold the remaining parallelism into the kernel. Next you would do something along the lines of what you suggest. You would want to have, perhaps, thread 0 read in a chunk of b, then write a copy to thread 1, then use that chunk of b. Then like a chain each thread would copy the chunk of b forward, then do the sub-calculation using it. In this way b is read once and recycled. This is what you are suggesting I believe. There is a tiling algorithm here to orchestrate.
dar
 
Posts: 90
Joined: Mon Dec 17, 2012 3:26 am

Re: hello_opencl.c

Postby djm » Mon Sep 15, 2014 11:22 pm

Thanks again for the info.

I see. IIUC you are saying it's better to launch the kernel once on each core and then have each kernel loop (in this case 64 times, i.e. 1024/16). Would that be more efficient?

I have been playing with the OpenCL API since I have bindings available from the language I'm using. I may switch over to stdcl at some point.

Thanks,
djm
djm
 
Posts: 11
Joined: Mon Sep 15, 2014 5:08 am


Return to OpenCL

Who is online

Users browsing this forum: No registered users and 9 guests