[LLVMdev] [cfe-dev] OpenCL SPIR/NVPTX code generation

Benyei, Guy guy.benyei at intel.com
Thu Jan 24 01:01:11 PST 2013


Hi Ankur,
If you took the 3.2 release, that doesn't contain SPIR target for Clang. The SPIR target was committed to Clang after the 3.2 branch was created, so 3.2 only has spir and spir64 triples defined in LLVM, but not in Clang.

Thanks
[email_signature_guy_new2]

From: ankur deshwal [mailto:a.s.deshwal at gmail.com]
Sent: Thursday, January 24, 2013 09:51
To: Benyei, Guy
Cc: Jordan Rose; cfe-dev at cs.uiuc.edu; llvmdev at cs.uiuc.edu
Subject: Re: [cfe-dev] OpenCL SPIR/NVPTX code generation

Hello everyone,

Thanks a lot for the help.

-target nvptx worked great with llvm-3.2. However it gives error with -target spir.

LLVM/Clang trunk although works good for both options ( probably because spir is still work in progress ).


Thanks again.
- Ankur



On Thu, Jan 24, 2013 at 12:43 PM, Benyei, Guy <guy.benyei at intel.com<mailto:guy.benyei at intel.com>> wrote:
Hi Jordan,
You're right, and the driver -target option works perfectly with the SPIR triples.

Thanks
   Guy Benyei
[email_signature_guy_new2]

From: Jordan Rose [mailto:jordan_rose at apple.com<mailto:jordan_rose at apple.com>]
Sent: Wednesday, January 23, 2013 19:47
To: Benyei, Guy
Cc: ankur deshwal; cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>; llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>
Subject: Re: [cfe-dev] OpenCL SPIR/NVPTX code generation


On Jan 23, 2013, at 4:04 , "Benyei, Guy" <guy.benyei at intel.com<mailto:guy.benyei at intel.com>> wrote:

Hi Ankur,
Since you use -Xclang, the clang executable passes multiple triples to "clang -cc1". You can see that if you add the -v option. I'm sure there is someone here who can explain it better than I...
Anyhow, I think you better use clang -cc1. Make sure -cc1 is the first command line option you use.

$ clang -cc1 -fno-builtin -emit-llvm-bc -triple spir-unknown-unknown Simple_Kernel.cl -o Simple_Kernel.bc

should work for you.

clang -cc1 shouldn't ever be necessary for end users of clang, particularly because cc1 options are not guaranteed to be stable. You also lose all the default options that the driver normally passes down. It's possible this doesn't matter much for SPIR, at least not right now, but it's not something we should be recommending or supporting.

-target is the driver version of -triple. This "worked" for me, where by "worked" I mean "generated some output but I don't know enough about SPIR to validate it".

% clang -x cl -fno-builtin -target spir -c -emit-llvm

Jordan


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130124/c6fefcce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24800 bytes
Desc: image001.png
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130124/c6fefcce/attachment.png>


More information about the llvm-dev mailing list