NVCC/CUDA 3.1 - ghtr-default.h 泛洪"declared static"但未定义的警告

nvcc/cuda 3.1 - ghtr-default.h flood of "declared static" but not defined warnings

本文关键字:static declared 未定义 警告 泛洪 CUDA ghtr-default NVCC      更新时间:2023-10-16

当用nvcc(使用cuda 3.1)编译一个项目时,我从gstr -default.h得到了大量的警告:

/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:118: warning: ‘int __gthrw_pthread_once(pthread_once_t*, void (*)())’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:119: warning: ‘void* __gthrw_pthread_getspecific(pthread_key_t) throw ()’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:120: warning: ‘int __gthrw_pthread_setspecific(pthread_key_t, const void*) throw ()’ declared ‘static’ but never defined

我到处都挖了,似乎找不到一种方法来抑制这种噪音,除了移除-Wall,我真的不想这么做。有没有人觉得这很眼熟?

我的CXXFLAGS是:

CXXFLAGS=-Isrc -I../cxxtest -I$(CUDA_INCLUDE_DIR) -Xcompiler -O2 -Xcompiler -Wall

我试过将$(CUDA_INCLUDE_DIR)添加到-Xcompiler选项中,但无济于事。我不想把沃尔从设置中移除……还有其他选择吗?

尝试将您的pthreads代码分离到另一个文件中,以便您可以避免# include触发这些警告的文件…

相关文章: