如何编译CUDA到llvm IR? [英] how to compile CUDA to llvm IR?

查看:833
本文介绍了如何编译CUDA到llvm IR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试三天编译CUDA内核到llvm IR,我不能这样做。我改变了 langoptions.cpp 并在构造函数中添加了 CUDA = 1; ,但是clang给我错误cuda语法的消息(如_synchthreads()调用)。
我做了以下:

I've been trying for three days to compile a CUDA kernel into llvm IR and I couldn't do it. I've changed langoptions.cpp and added CUDA=1; in the constructor , but still the clang give me Error messages for cuda syntax (like _synchthreads() call). I've done the following:


  1. 下载了llvm(包括clang)修改langoptions.cpp(CUDA = 1;
    在构造函数中),并安装它。

  2. 安装了CUDA工具包4.1和CUDA SDK。

  3. 使用clang编译了一个CUDA示例:

  1. downloaded llvm (including clang) modified langoptions.cpp (CUDA=1; in the constructor), and installed it.
  2. installed CUDA toolkit 4.1 and CUDA SDK.
  3. compiled a CUDA example using clang using:

clang -I${CUDA_HOME}/include -I${CUDA_SDK_INC}
~/workspace/cuda_example/mis_kernel.cu -S -emit-llvm -o
~/workspace/cuda_example/a.ll



$ b

and as I said it doesn't work.

<$>

推荐答案

NVCC不支持发出LLVM IR。

NVCC doesn't support emitting LLVM IR.

这篇关于如何编译CUDA到llvm IR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆