简体   繁体   English

什么编译器支持CUDA

[英]What compilers support CUDA

I found some problem with Visual Studio. 我发现Visual Studio有些问题。 My project that use openMP multithreading was twice slow on Visual Studio 2010, than on Dev-C++ , Now I wrote my other project that uses CUDA technology , I think that my project works slow because of Visual Studio, so I need some other compiler that will support CUDA , my questions are: 我使用openMP多线程的项目在Visual Studio 2010上比在Dev-C ++上慢两倍,现在我编写了另一个使用CUDA技术的项目,我认为我的项目由于Visual Studio而运行缓慢,所以我需要一些其他编译器将支持CUDA,我的问题是:

  1. is Dev-C++ support CUDA? Dev-C ++是否支持CUDA?

  2. what compilers support CUDA except Visual Studio? 什么编译器支持除Visual Studio之外的CUDA?

  3. if there are a lot compilers supporting CUDA what will give best speed for application? 如果有很多编译器支持CUDA什么能提供最佳的应用速度?

CUDA Toolkit 发行说明列出了支持的平台和编译器。

Well I think it's the other way around. 好吧,我认为这是相反的方式。 The thing is, there is a driver called nvcc . 问题是,有一个名为nvcc的驱动程序。 it generates device code and host code and sends the host code to a compiler. 它生成设备代码和主机代码,并将主机代码发送给编译器。 It should be a C compiler and it should be in the executable path. 它应该是一个C编译器,它应该在可执行路径中。 (EDIT: and it should be gcc on Linux and cl on Windows and I think I should ignore mac as the release note did(?)) (编辑:它应该是Linux上的gcc和Windows上的cl,我认为我应该忽略mac,因为发行说明(?))

nvcc Compiler Info reads: nvcc编译器信息如下:

A general purpose C compiler is needed by nvcc in the following situations: 在以下情况下,nvcc需要通用C编译器:

  1. During non-CUDA phases (except the run phase), because these phases will be forwarded by nvcc to this compiler 在非CUDA阶段(运行阶段除外),因为这些阶段将由nvcc转发到此编译器

  2. During CUDA phases, for several preprocessing stages (see also 0). 在CUDA阶段,有几个预处理阶段(另见0)。 On Linux platforms, the compiler is assumed to be 'gcc', or 'g++' for linking. 在Linux平台上,编译器被假定为'gcc'或'g ++'用于链接。 On Windows platforms, the compiler is assumed to be 'cl'. 在Windows平台上,编译器被假定为“cl”。 The compiler executables are expected to be in the current executable search path, unless option -compiler-bin-dir is specified, in which case the value of this option must be the name of the directory in which these compiler executables reside. 除非指定了选项-compiler-bin-dir,否则编译器可执行文件应位于当前可执行搜索路径中,在这种情况下,此选项的值必须是这些编译器可执行文件所在目录的名称。

And please don't talk like that about compilers. 请不要那样谈论编译器。 Your code is in a way that works better with Dev-C++. 您的代码使用Dev-C ++可以更好地工作。 What is generated is an assembly code. 生成的是汇编代码。 I don't say that they don't make any difference, but maybe 4 to 5%, not 100%. 我不是说他们没有任何区别,但可能是4到5%,而不是100%。

And absolutely definitely don't blame the compiler for your slow program. 并且绝对不要因为你的慢程序而责怪编译器。 It is definitely because of inefficient memory access and incorrect use of different types of memory. 这肯定是因为低效的内存访问和不正确使用不同类型的内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM