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:
@@ -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/"
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user