[LLVMdev] OpenCL SPIR/NVPTX code generation

ankur deshwal a.s.deshwal at gmail.com
Wed Jan 23 03:44:22 PST 2013


Hi Guy,

Thanks a lot for the clarification.

I tried using the triple for SPIR as

$ clang -x cl -fno-builtin -emit-llvm -c -Xclang -triple -Xclang
spir-unknown-unknown Simple_Kernel.cl

However I get the following error.
error: unknown target triple 'spir-unknown-unknown', please use -triple or
-arch

I also tried with triple nvptx-unknown-unknown
clang -x cl -fno-builtin -emit-llvm -S -Xclang -triple -Xclang
nvptx-unknown-unknown Simple_Kernel.cl

Then I get following error.
error: unknown target CPU 'pentium4'

If I dont specify the triple, it compiles fine. However in the llvm
generated, it shows the target triple as
target triple = "i386-pc-linux-gnu"

So it crashes with the llc ( due to the address space errors).

I also tried building llvm with only nvptx target, still the target triple
is the same.

Please help.

Thanks a ton,
Ankur




On Wed, Jan 23, 2013 at 1:20 PM, Benyei, Guy <guy.benyei at intel.com> wrote:

> Hi Ankur,****
>
> SPIR generation is not yet fully supported in Clang. I’m working on this
> task, but there are still some missing parts.****
>
> The correct way to generate SPIR by Clang is adding the “-triple
> spir-unknown-unknown” or “-triple spir64-unknown-unknown” command line
> options when running clang.****
>
> ** **
>
> Thanks****
>
>    Guy Benyei****
>
> [image: email_signature_guy_new2]****
>
> ** **
>
> *From:* cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] *On
> Behalf Of *ankur deshwal
> *Sent:* Tuesday, January 22, 2013 11:09
> *To:* cfe-dev at cs.uiuc.edu
> *Subject:* [cfe-dev] OpenCL SPIR code generation****
>
> ** **
>
> Hi all,****
>
> ** **
>
> I am trying to compile a openCL code to SPIR with LLVM/Clang-3.2. ****
>
> ** **
>
> I see there is no backend for SPIR( which makes sense as SPIR is variant
> of LLVM-IR). However this leads me clueless how to configure LLVM/Clang for
> SPIR and what is the command I shall use to generate SPIR code from cl code.
> ****
>
> ** **
>
> Thanks,****
>
> Ankur****
>
> ---------------------------------------------------------------------
> 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/20130123/442d4d30/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130123/442d4d30/attachment.png>


More information about the llvm-dev mailing list