fixed gpu module compilation
This commit is contained in:
@@ -2099,7 +2099,7 @@ NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus loadFromXML(const String &filename,
|
||||
NCVStatus loadFromXML(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
std::vector<HaarStage64> &haarStages,
|
||||
std::vector<HaarClassifierNode128> &haarClassifierNodes,
|
||||
@@ -2110,7 +2110,7 @@ NCVStatus loadFromXML(const String &filename,
|
||||
#define NVBIN_HAAR_VERSION 0x1
|
||||
|
||||
|
||||
static NCVStatus loadFromNVBIN(const String &filename,
|
||||
static NCVStatus loadFromNVBIN(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
std::vector<HaarStage64> &haarStages,
|
||||
std::vector<HaarClassifierNode128> &haarClassifierNodes,
|
||||
@@ -2174,14 +2174,14 @@ static NCVStatus loadFromNVBIN(const String &filename,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarGetClassifierSize(const String &filename, Ncv32u &numStages,
|
||||
NCVStatus ncvHaarGetClassifierSize(const cv::String &filename, Ncv32u &numStages,
|
||||
Ncv32u &numNodes, Ncv32u &numFeatures)
|
||||
{
|
||||
size_t readCount;
|
||||
NCVStatus ncvStat;
|
||||
|
||||
String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower);
|
||||
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
fext = fext.toLowerCase();
|
||||
|
||||
if (fext == "nvbin")
|
||||
{
|
||||
@@ -2226,7 +2226,7 @@ NCVStatus ncvHaarGetClassifierSize(const String &filename, Ncv32u &numStages,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarLoadFromFile_host(const String &filename,
|
||||
NCVStatus ncvHaarLoadFromFile_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
@@ -2238,8 +2238,8 @@ NCVStatus ncvHaarLoadFromFile_host(const String &filename,
|
||||
|
||||
NCVStatus ncvStat;
|
||||
|
||||
String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower);
|
||||
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
fext = fext.toLowerCase();
|
||||
|
||||
std::vector<HaarStage64> haarStages;
|
||||
std::vector<HaarClassifierNode128> haarNodes;
|
||||
@@ -2272,7 +2272,7 @@ NCVStatus ncvHaarLoadFromFile_host(const String &filename,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarStoreNVBIN_host(const String &filename,
|
||||
NCVStatus ncvHaarStoreNVBIN_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
|
@@ -438,18 +438,18 @@ NCV_EXPORTS NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
|
||||
Ncv32f curScale);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarGetClassifierSize(const String &filename, Ncv32u &numStages,
|
||||
NCV_EXPORTS NCVStatus ncvHaarGetClassifierSize(const cv::String &filename, Ncv32u &numStages,
|
||||
Ncv32u &numNodes, Ncv32u &numFeatures);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarLoadFromFile_host(const String &filename,
|
||||
NCV_EXPORTS NCVStatus ncvHaarLoadFromFile_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
NCVVector<HaarFeature64> &h_HaarFeatures);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const String &filename,
|
||||
NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
@@ -457,4 +457,4 @@ NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const String &filename,
|
||||
|
||||
|
||||
|
||||
#endif // _ncvhaarobjectdetection_hpp_
|
||||
#endif // _ncvhaarobjectdetection_hpp_
|
||||
|
@@ -52,16 +52,16 @@
|
||||
//==============================================================================
|
||||
|
||||
|
||||
static void stdDebugOutput(const String &msg)
|
||||
static void stdDebugOutput(const cv::String &msg)
|
||||
{
|
||||
std::cout << msg;
|
||||
std::cout << msg.c_str() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
static NCVDebugOutputHandler *debugOutputHandler = stdDebugOutput;
|
||||
|
||||
|
||||
void ncvDebugOutput(const String &msg)
|
||||
void ncvDebugOutput(const cv::String &msg)
|
||||
{
|
||||
debugOutputHandler(msg);
|
||||
}
|
||||
@@ -905,4 +905,4 @@ NCVStatus ncvDrawRects_32u_device(Ncv32u *d_dst,
|
||||
return drawRectsWrapperDevice(d_dst, dstStride, dstWidth, dstHeight, d_rects, numRects, color, cuStream);
|
||||
}
|
||||
|
||||
#endif /* CUDA_DISABLER */
|
||||
#endif /* CUDA_DISABLER */
|
||||
|
@@ -53,8 +53,8 @@
|
||||
#endif
|
||||
|
||||
#include <cuda_runtime.h>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include "opencv2/core/cvstd.hpp"
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
@@ -243,10 +243,10 @@ const Ncv32u K_LOG2_WARP_SIZE = 5;
|
||||
//==============================================================================
|
||||
|
||||
|
||||
NCV_EXPORTS void ncvDebugOutput(const String &msg);
|
||||
NCV_EXPORTS void ncvDebugOutput(const cv::String &msg);
|
||||
|
||||
|
||||
typedef void NCVDebugOutputHandler(const String &msg);
|
||||
typedef void NCVDebugOutputHandler(const cv::String &msg);
|
||||
|
||||
|
||||
NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
@@ -257,9 +257,8 @@ NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
{ \
|
||||
if (!(pred)) \
|
||||
{ \
|
||||
std::ostringstream oss; \
|
||||
oss << "NCV Assertion Failed: " << msg << ", file=" << __FILE__ << ", line=" << __LINE__ << std::endl; \
|
||||
ncvDebugOutput(oss.str()); \
|
||||
cv::String str = cv::format("NCV Assertion Failed: %s, file=%s, line=%d", msg, __FILE__, __LINE__); \
|
||||
ncvDebugOutput(str); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -273,14 +272,19 @@ NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
|
||||
|
||||
#define ncvAssertReturn(pred, err) \
|
||||
ncvAssertPrintReturn(pred, "retcode=" << (int)err, err)
|
||||
do \
|
||||
{ \
|
||||
cv::String msg = cv::format("retcode=%d", (int)err); \
|
||||
ncvAssertPrintReturn(pred, msg.c_str(), err); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define ncvAssertReturnNcvStat(ncvOp) \
|
||||
do \
|
||||
{ \
|
||||
NCVStatus _ncvStat = ncvOp; \
|
||||
ncvAssertPrintReturn(NCV_SUCCESS==_ncvStat, "NcvStat=" << (int)_ncvStat, _ncvStat); \
|
||||
cv::String msg = cv::format("NcvStat=%d", (int)_ncvStat); \
|
||||
ncvAssertPrintReturn(NCV_SUCCESS==_ncvStat, msg.c_str(), _ncvStat); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -288,7 +292,8 @@ NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
do \
|
||||
{ \
|
||||
cudaError_t res = cudacall; \
|
||||
ncvAssertPrintReturn(cudaSuccess==res, "cudaError_t=" << (int)res, errCode); \
|
||||
cv::String msg = cv::format("cudaError_t=%d", (int)res); \
|
||||
ncvAssertPrintReturn(cudaSuccess==res, msg.c_str(), errCode); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -296,7 +301,8 @@ NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
do \
|
||||
{ \
|
||||
cudaError_t res = cudaGetLastError(); \
|
||||
ncvAssertPrintReturn(cudaSuccess==res, "cudaError_t=" << (int)res, errCode); \
|
||||
cv::String msg = cv::format("cudaError_t=%d", (int)res); \
|
||||
ncvAssertPrintReturn(cudaSuccess==res, msg.c_str(), errCode); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -805,7 +811,7 @@ public:
|
||||
T& at(Ncv32u x, Ncv32u y) const
|
||||
{
|
||||
NcvBool bOutRange = (x >= this->_width || y >= this->_height);
|
||||
ncvAssertPrintCheck(!bOutRange, "Error addressing matrix at [" << x << ", " << y << "]");
|
||||
ncvAssertPrintCheck(!bOutRange, "Error addressing matrix");
|
||||
if (bOutRange)
|
||||
{
|
||||
return *this->_ptr;
|
||||
|
Reference in New Issue
Block a user