cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

CraigL
Journeyman III

CPU/SSE focused docs/tutorials

are there any?

I can find many things providing help and/or examples about writing and tuning kernel code for GPUs, but I've not really been able to find much to help with some of the performance tweaking with respect to writing kernels for CPU utilization, in particular, structuring code/logic to maximize SSE usage/benefit.  How can one structure loops/code etc. to maximize the likelihood that SSE can/will be used?

Also, seems to me that writing and tuning a kernel for GPU usage would not be optimal for CPU.  Clearly if one has normal multi-threaded programming experience, then the basic concepts for structuring the kernel are fairly easy.  I'm not looking for something that basic.  More something tying in how the kernel code is compiled and how to leverage that.

Thanks,

     CraigL

 

Tags (1)
0 Likes
4 Replies
nou
Exemplar

CPU/SSE focused docs/tutorials

i can say that using barrier() on CPU is slow.

to utilize SSE instructons use float4/int4 data types.

0 Likes
CraigL
Journeyman III

CPU/SSE focused docs/tutorials

4 element arrays help?  Curious, I hadn't thought that would be the case.

But there are no actual documents or tutorials anyone knows about?

Thanks,

CraigL

 

0 Likes
d_a_a_
Adept II

CPU/SSE focused docs/tutorials

Please check the "Parallel Min() function" example in the "ATI Stream Computing OpenCL Programming Guide". That example is optimized for both CPU and GPU.

0 Likes
CraigL
Journeyman III

CPU/SSE focused docs/tutorials

Using float4/int4 definitely seems to be a huge part of it, for SSE anyway which is all I think OpenCL supports.  But it seems like only single line ops on 4x arrays are converted.  I suppose that makes sense, but gonna be hard for me to figure out how to do that successfully with image data.

I also found these presentations by Intel.  If one ignores the AVX stuff, the SSE and surrounding information is still valuable:

http://www.khronos.org/developers/library/2010_siggraph_bof_opencl/OpenCL-BOF-Intel-SIGGRAPH-Jul10.pdf

http://www.khronos.org/developers/library/2009-hotchips/Intel_OpenCL-and-CPUs.pdf

Thanks for the pointer to the Parallel Min() doc, it does point out some interesting ways to calculate optimal accessing at runtime.

CraigL

 

0 Likes