如何解决这些GLM CUDA编译器警告?

时间:2019-05-14 01:07:26

标签: c++ cuda compiler-warnings glm-math

我正在使用CUDA 10.1,OpenGL 4.6和GLM库制作程序。当我使用Visual Studio 2017进行编译时,我不断收到很多这些警告:

/detail/type_vec2.hpp(94): warning : __device__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec2.hpp(94): warning : __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec2.hpp(95): warning : __device__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec2.hpp(95): warning : __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec2.hpp(143): warning : __device__ annotation is ignored on a function("operator=") that is explicitly defaulted on its first declaration
/detail/type_vec2.hpp(143): warning : __host__ annotation is ignored on a function("operator=") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(98): warning : __device__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(98): warning : __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(99): warning : __device__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(99): warning : __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(176): warning : __device__ annotation is ignored on a function("operator=") that is explicitly defaulted on its first declaration
/detail/type_vec3.hpp(176): warning : __host__ annotation is ignored on a function("operator=") that is explicitly defaulted on its first declaration

还有很多类似的格式(以至于我不允许全部发布),但是每个引用GLM中的不同文件时,我都想知道如何摆脱它们。我在网上阅读了这篇文章,这与使用CUDA编译的GML代码有关,但并没有意识到。虽然找不到任何解决方法。 GLM手册说,在包含库中的任何内容之前先拥有#define GLM_FORCE_CUDA,但这没有用,并产生了错误:/simd/platform.h(120): fatal error C1189: #error: "GLM requires CUDA 7.0 or higher",因为它无法识别CUDA 10.1,因为当我查看该内容时该文件中的行仅在CUDA_VERSION < 7000奇怪的情况下才产生该错误,因为我的应该10100。我目前未在任何设备代码中使用GML。那我该如何摆脱它们?

0 个答案:

没有答案