cuda 9 1 和 eigen手動適配

2021-08-19 07:06:32 字數 2319 閱讀 5717

計算機視覺應用中,經常用到eigen庫,也會用到cuda庫,因為eigen庫沒有及時follow cuda的更新,導致cuda 9.0和9.1最新的版本,會出eigen相容問題,報錯如下:

note:如果使用cmake build,注意下面的順序,一定放到include_directories開始

include_directories($)

include_directories($)

因為eigen是標頭檔案自包含的lib;對於裝有多個eigen版本,或者使用其他版本eigen的庫,一樣會有問題

in file included from /usr/local/cuda/include/common_functions.h:50:0,

from /usr/local/cuda/include/cuda_runtime.h:115,

from

:0:/usr/local/cuda/include/crt/common_functions.h:64:24: error: token

""__cudacc_ver__ is no longer supported. use __cudacc_ver_major__, __cudacc_ver_minor__, and __cudacc_ver_build__ instead."" is not valid in preprocessor expressions

#define __cudacc_ver__ "__cudacc_ver__ is no longer supported. use __cudacc_ver_major__, __cudacc_ver_minor__, and __cudacc_ver_build__ instead."

^/usr/include/eigen3/eigen/src/core/util/macros.h:364:33: note: in expansion of macro 『__cudacc_ver__』

#if defined(__cudacc_ver__) && __cudacc_ver__ >= 70500 && __cplusplus > 199711l

^in file included from /usr/local/cuda/include/common_functions.h:50:0,

from /usr/local/cuda/include/cuda_runtime.h:115,

from

:0:/usr/local/cuda/include/crt/common_functions.h:64:24: error: token

""__cudacc_ver__ is no longer supported. use __cudacc_ver_major__, __cudacc_ver_minor__, and __cudacc_ver_build__ instead."" is not valid in preprocessor expressions

#define __cudacc_ver__ "__cudacc_ver__ is no longer supported. use __cudacc_ver_major__, __cudacc_ver_minor__, and __cudacc_ver_build__ instead."

^/usr/include/eigen3/eigen/src/core/util/macros.h:364:33: note: in expansion of macro 『__cudacc_ver__』

#if defined(__cudacc_ver__) && __cudacc_ver__ >= 70500 && __cplusplus > 199711l

^cmake error at cuda_compile_1_generated_estimate.cu.o.cmake:219 (message):

error generating

/home/chengxiang/cainiao/workspace/cudaicp/build/cmakefiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_estimate.cu.o

cmake error at cuda_compile_1_generated_pyrdown.cu.o.cmake:219 (message):

error generating

/home/chengxiang/cainiao/workspace/cudaicp/build/cmakefiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_pyrdown.cu.o

同時安裝CUDA8 0和CUDA9 0

tensorflow1.5版本竟然不支援cuda8.0了 解除安裝是不可能解除安裝的 建議選擇使用.run檔案安裝,因為使用.deb可能會將已經安裝的較新的顯示卡驅動替換。對於cudnn7.0的安裝方式選項,我選擇的是cudnn v7.0.5 library for linux,對應於cudnn 9...

careercup 遞迴和動態規劃 9 1

9.1 有個小孩正在上樓梯,樓梯有n階台階,小孩一次可以上1階 2階或3階。實現乙個方法,計算小孩有多少種上樓梯的方法。解法 我們可以採用自上而下的方式來解決這個問題。小孩上樓梯的最後一步,也就是抵達第n階的那一步,可能走1階 2階或3階。也就是說,最後一步可能是從第n 1階往上走1階 從n 2階往...

CUDA 求平方和

include include include define data size 1048576 int data data size void generatenumbers int number,int size printf sum cpu d n sum system pause 要怎麼把計...