如何在Windows上使用其他具有CUDA的c ++编译器? [英] How do I use other c++ compilers with CUDA on Windows?

查看:463
本文介绍了如何在Windows上使用其他具有CUDA的c ++编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用CUDA构建一个简单的应用程序,我一直在尝试几个小时在结束,我只是不能使它在Windows上工作。 nvcc绝对拒绝编译没有Visual Studio的编译器不支持我需要的东西。我试图建立使用nvcc与铛,但它只是要求我使用Visual Studio的编译器。我也试过直接使用clang,因为它现在支持CUDA,但我收到这个错误:

I'm trying to build a simple application with CUDA and I've been trying for hours on end and I just can't make it work on windows. nvcc absolutely refuses to compile without Visual Studio's compiler which doesn't support things I need. I tried building using nvcc with clang but It just asks me to use Visual Studio's compiler. I've also tried using clang directly since it now supports CUDA but I receive this error:

clang++.exe: error: Unsupported CUDA gpu architecture: compute_52

这对我来说没有意义,因为我有CUDA工具包版本7.5和我显卡是一款GTX 970(其中两款)。我已经google了这个广泛和无处不在我遇到的错误,人总是有他们的CUDA工具包是& 7.5。我现在正在眼泪的边缘,现在试图得到像VLA一样简单工作在这个CUDA应用程序,我只是不能实现... ...

This makes no sense to me because I have the CUDA toolkit version 7.5 and my graphics card is a GTX 970 (two of them). I have googled this extensively and everywhere I come across the error the person always has is their CUDA toolkit is < 7.5. I'm on the brink of tears right now trying to get something as simple as VLA to work on this CUDA application and I just can't achieve it...

推荐答案

CUDA Windows工具链需要 Visual Studio C ++编译器。您不能使用该平台上的任何其他内容。如果VS编译器不支持您在CUDA主机代码中需要的语言功能,您别无选择,只能更改平台或您的期望。

The CUDA windows toolchain requires the Visual Studio C++ compiler. You cannot use anything else on that platform. If the VS compiler doesn't support the language features you need within CUDA host code, you have no choice but to change platforms, or your expectations.

您仍然可以使用另一个编译器编译非CUDA主机代码,然后使用NVCC和VS工具链链接该代码。

You can still potentially compile non-CUDA host code using another compiler and then link that code using NVCC and the VS toolchain.

这篇关于如何在Windows上使用其他具有CUDA的c ++编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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