cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

zhuzxy
Journeyman III

Does AMD app SDK OpenCL on CPU compiler optimized for the X64 platform?

Hi,

    I have a question regarding on the OpenCL on CPU for AMD APP.

    I have made a simple test OpenCL code, which just did a lot of add in a loop to test the OpenCL performance. The CL code only include 1 work group and 1 work item, and I also made an C reference code on CPU doing the same thing. I assume the performance should be similar, but what I found is when using reference code on CPU and select the platform to be X64 , the reference code result is much faster( about 50%) than OpenCL on CPU. And if I select the reference code to run on win32 platform, the result is some similar with OpenCL on CPU.

  My question is does the AMD APP OpenCL compiler optimized for the X64 platform or only for W32 platform? And how can I verify it. Can anyone give me some instructions or suggestions?

I used AMD kernel analyzer to analysis my CL code and generate the X86 assembly instructions as below.

// only paste the vector add part of the code.

// the CL source code is vec = vec + vec

// where vec is char16 data type

 movdqa (%ebx), %xmm0
 addl $16, %ebx
 paddb (%esi), %xmm0
 addl $16, %esi
 movdqa %xmm0, (%ebp)
 addl $16, %ebp
 decl %edx
 jne LBB0_5
 jmp LBB0_3

 

 

 

0 Likes
3 Replies

The OpenCL compiler uses LLVM code generation for the x86[_64] architectures. You can verify the optimizations done by looking at the LLVM project.
0 Likes

Could you please give some more suggestions?

I am using windows7 & Visual studio, and when I build the CL program, I did not pass in any parameters from the CL API, just use the default ones. Will the AMD APP driver automatically make the LLVM compiler generate the X64 optimize results? How do I know the generated CL program/kernel is optimized for X86 or X64.

 

Thanks

Xiaoyi

0 Likes

More information can be found here:
http://llvm.org/

We only compile for your host, so if your host is a x86_64, it will be compiled for x64, if your CPU only supports x86, it will be compiled for x86.
0 Likes