Dynamic CUDA support library loading implemented for Linux.

Logical mistake in macro fixed;
DeviceInfo deligate reimplemented;
Build and warning fixes.
This commit is contained in:
Alexander Smorkalov
2013-12-13 17:28:29 +04:00
parent d4087f19a2
commit 8660e048bc
6 changed files with 357 additions and 227 deletions

View File

@@ -1,6 +1,5 @@
project(opencv_core_cuda)
set(HAVE_CUDA FALSE)
add_definitions("-DHAVE_CUDA")
add_definitions(-DUSE_CUDA)
include_directories(${CUDA_INCLUDE_DIRS}
"../src/"
"../include/opencv2/core/"

View File

@@ -1,6 +1,10 @@
#include "cvconfig.h"
#include "opencv2/core/core.hpp"
#include "opencv2/core/gpumat.hpp"
#include <stdio.h>
#include <iostream>
#ifdef HAVE_CUDA
#include <cuda_runtime.h>
#include <npp.h>
@@ -17,7 +21,30 @@
#endif
#endif
using namespace std;
using namespace cv;
using namespace cv::gpu;
#include "gpumat_cuda.hpp"
#include "gpumat_cuda.hpp"
#ifdef HAVE_CUDA
static CudaDeviceInfoFuncTable deviceInfoTable;
static CudaFuncTable gpuTable;
#else
static EmptyDeviceInfoFuncTable deviceInfoTable;
static EmptyFuncTable gpuTable;
#endif
extern "C" {
DeviceInfoFuncTable* deviceInfoFactory()
{
return (DeviceInfoFuncTable*)&deviceInfoTable;
}
GpuFuncTable* gpuFactory()
{
return (GpuFuncTable*)&gpuTable;
}
}