OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

offline compiler llvm code problem

tseng00g
Beginner
652 Views
in openCL SDK 1.5
using offline compiler compile CL kernel with -llvm option to generate llvm IR
then use llvm-as convert llvm IR -> bitcode will pop error: (llvm version:3.1 svn)
llvm-as: hello.ll:39:9: error: expected type
define x86_ocl_kernelcc void @hello(i8 addrspace(1)* nocapture %string, i8 addrspace(3)* %pLocalMem, %struct.WorkDim* %pWorkDim, i64* %pWGId, %struct.PaddedDimId* %pBaseGlbId, %struct.PaddedDimId* %pLocalIds, i64* %contextpointer, i64 %iterCount, i8* %pSpecialBuf, i64* %pCurrWI) nounwind {
this kernel come from "The openCL programming book" sample code 3-1
i've tried some CL kernel, and this error always occurred
and their's a bug in offline compiler windows version ,the "save LLVM..." option default file
type should be "*.ll" not "*.bc" , the offline compiler generate human readable llvm code.
0 Kudos
5 Replies
Jim_Vaughn
Beginner
652 Views
I would imagine no one at intel has tested their code with version 3.1 as 3.0 was release in December which was after the latest release of Intel's OpenCL SDK and runtime.
0 Kudos
tseng00g
Beginner
652 Views
oh it also happend at llvm 3.0, so i upgraded llvm at once and thought it might fixed this at 3.1.
0 Kudos
Evgeny_F_Intel
Employee
653 Views
Please use llvm tools coming with Intel SDK.
0 Kudos
tseng00g
Beginner
653 Views
i found llvm tool (llc) in SDK windows version, linux version doesn't include that tool. thanks.
0 Kudos
Amjad_A_Intel
Employee
652 Views
-llvm flag generates a file with extension .bc, but it is a readable file just like the .ll
You may try open it in a text editor and you will get the textual llvm code.

We will consider your suggestion of changing the extension type to *.ll instead of *.bc.

Thanks,
Amjad
0 Kudos
Reply