CUDA编译器(nvcc)宏 [英] CUDA compiler (nvcc) macro

查看:336
本文介绍了CUDA编译器(nvcc)宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有CUDA的#define编译器(nvcc)宏,我可以使用? (像_WIN32 for Windows等)

Is there a #define compiler (nvcc) macro of CUDA which I can use? (Like _WIN32 for Windows and so on.)

我需要这个头文件代码,这将是常见的nvcc和VC ++编译器。我知道我可以继续定义我自己的,并将其作为参数传递给nvcc编译器(-D),但如果有一个已经定义,将是巨大的。

I need this for header code that will be common between nvcc and VC++ compilers. I know I can go ahead and define my own and pass it as an argument to the nvcc compiler (-D), but it would be great if there is one already defined.

推荐答案

__CUDACC__

我不认为这将是微不足道。检查以下主题

I don't think it will be that trivial. Check the following thread

http://forums.nvidia.com/index.php?showtopic=32369&st=0&p=179913&#entry179913

这篇关于CUDA编译器(nvcc)宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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