CUDA编译问题

在CUDA5.0中,我们对于CUDA 错误问题的检查是通过
#include <helper_functions.h> 
#include <helper_cuda.h>   
这两个头文件进行的,但是引用这个进行编译的时候会出现这么一个问题
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\common\inc\helper_timer.h(219) fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory。
这个问题,到目录下面发现
#ifdef WIN32
// includes, system
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
#undef min
#undef max
原来是要我们自己定义一下WIN32,主要我的机子是64位的。
在程序头中加入
#ifndef WIN32
#define WIN32
#endif
就可以了。
原文地址:https://www.cnblogs.com/fengbing/p/3122757.html