簡體   English   中英

在Linux上編譯具有CUDA支持的OpenCv

[英]Compile OpenCv with CUDA support on linux

我正在嘗試在Linux上使用帶有CUDA支持的OpenCv編譯程序。 我創建了Makefile:

filtry_gpu: filtry_gpu.cu
     nvcc -lopencv_highgui -lopencv_core -I/opt/opencv/include -L/opt/opencv/lib -Xcompiler \-fopenmp -Xcompiler \-Wall -Xlinker \-lgomp filtry_gpu.cu -o filtry_gpu 

clean:
    rm -f *.o

但我有錯誤:

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(218): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(225): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(711): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(717): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(964): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(964): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(988): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(988): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1012): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1012): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1060): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1060): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1132): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1181): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1199): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1199): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1229): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1229): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1235): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1235): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1241): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1241): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1247): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1247): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1253): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1253): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1426): error: argument of type "__v2di *" is incompatible with parameter of type "__attribute((vector_size(16))) long *"

/usr/lib/gcc/x86_64-linux-gnu/4.3.5/include/emmintrin.h(1426): error: argument of type "__v2di" is incompatible with parameter of type "__attribute((vector_size(16))) long"

我的openCV版本是4.3.7,CUDA 4.0,g ++ 4.4

相同的程序在visual Studio 2012中可以正常工作。是否可以在Linux上編譯此程序?

看來您使用的是OpenCV 2.4版本。 您不能在CUDA代碼中使用OpenCV標頭。 要在CUDA項目中使用OpenCV,請將文件分為兩個文件: .cpp.cu ,並將所有CUDA代碼.cu文件,並將所有OpenCV代碼放入.cpp文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM