gpt4 book ai didi

c++ - nvcc/cuda 3.1 - ghtr-default.h 泛滥 "declared static"但未定义警告

转载 作者:行者123 更新时间:2023-11-28 08:14:56 25 4
gpt4 key购买 nike

使用 nvcc(使用 cuda 3.1)编译项目时,我从 gthr-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 选项,但无济于事。我不想从设置中删除 Wall...还有其他选项吗?

最佳答案

尝试将你的 pthreads 代码分离到不同的文件中,这样你就可以避免#including 任何文件触发这些警告...

关于c++ - nvcc/cuda 3.1 - ghtr-default.h 泛滥 "declared static"但未定义警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7969419/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com