cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sir_um
Journeyman III

OpenCL Vector Types & SSE/AVX

A Definitive Answer

I have seen several posts where SSE support is mentioned with respect to AMD/Intel chips when using explicit OpenCL Vectors. Speed ups within my own code seem to agree.

Ex)
double2 d2 = (double2) (1.2, 3.4);
double2 d3 = 3.14*d2;

What I have read indicates that this code will be compiled into a single SSE instruction. I would assume that higher multiples of 128-bits would be broken up into multiple passes (I.e. double4, double8, float16, etc.)

SSE, however, is limited to 128-bits (float4/double2 in one clock cycle), while AVX can handle up to 256-bits (float8/double4 in one clock cycle). I have looked around the internet and seen that AMD is going to be adding support for Intel's AVX instructions to their CPU's. (I don't know if this has already been completed) When this happens, when will OpenCL add support for AVX accelerated Vector Instructions?

Also, Since OpenCL has already been ported to run on Intel CPU's does the Stream SDK 2.3 support AVX accelerated Vector Instructions on Intel (Sandy Bridge) Processors? If not, (given that Intel's Sandy Bridge CPU released relatively recently) is this something which is scheduled to be added in the next SDK release, or something which will only be added when AMD chips support it?

thank you,
-Chris

0 Likes
2 Replies

AMD uses LLVM for our code generation on x86, so when LLVM adds support for AVX, we will inherit it when we update to that version.
0 Likes

Thank you for your swift reply.

Just an update. I looked into LLVM's support for AVX and it seems that they have been working on it since 2009, but as of Nov 1, 2010, it's not yet ready for full scale use.

http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/035938.html
http://old.nabble.com/Moving-AVX-Upstream-td26169676.html

Also, after AVX they intend to add support for FMA4:
http://permalink.gmane.org/gmane.comp.compilers.llvm.devel/29744

Some AVX stuff has been added to the LLVM API: (Search for AVX)
http://llvm.org/docs/doxygen/html/namespacellvm_1_1X86II.html

Thanks again,
-Chris

0 Likes