作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一些严重依赖 Eigen 的代码。我想用 CUDA 优化它,但是当我编译时我得到:
[tcai4@golubh4 Try1]$ nvcc conv_parallel.cu -I /home/tcai4/project-cse/Try1 -lfftw3 -o conv.o
In file included from Eigen/Dense:1,
from Eigen/Eigen:1,
from functions.h:8,
from conv_parallel.cu:10:
Eigen/Core:44:34: error: math_functions.hpp: No such file or directory
我认为 math_functions.hpp 是来自 CUDA 的文件。谁能帮我弄清楚为什么 nvcc 找不到它?
编辑:我使用的是 CUDA 5.5 和 Eigen 3.3,除了链接 Eigen 和 fftw3 库之外,我没有使用任何其他标志(正如您从我的代码中看到的那样)。
最佳答案
我在使用 Cuda 9.1 构建 TensorFlow 1.4.1 时遇到了这个问题,奇怪的是 math_functions.hpp
只存在于 include/crt
中。
创建从 cuda/include/math_functions.hpp
到 cuda/include/crt/math_functions.hpp
的符号链接(symbolic link)解决了这个问题:
ln -s /usr/local/cuda/include/crt/math_functions.hpp /usr/local/cuda/include/math_functions.hpp
关于c++ - 将 CUDA 与 Eigen 一起使用时找不到 math_functions.hpp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43113508/
我有一些严重依赖 Eigen 的代码。我想用 CUDA 优化它,但是当我编译时我得到: [tcai4@golubh4 Try1]$ nvcc conv_parallel.cu -I /home/tca
我是一名优秀的程序员,十分优秀!