Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubangoTelecom committed Feb 16, 2019
1 parent 69f819f commit 55e5b26
Show file tree
Hide file tree
Showing 47 changed files with 3,496 additions and 3,555 deletions.
1 change: 0 additions & 1 deletion api/include/compv/compv_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

#include <compv/base/ml/compv_base_ml_knn.h>
#include <compv/base/ml/compv_base_ml_svm.h>
#include <compv/base/ml/compv_base_ml_svm_predict.h>

#include <compv/base/parallel/compv_condvar.h>
#include <compv/base/parallel/compv_mutex.h>
Expand Down
2 changes: 0 additions & 2 deletions base/CompVBase.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@
<ClInclude Include="include\compv\base\ml\annoy-1.11.4\mman.h" />
<ClInclude Include="include\compv\base\ml\compv_base_ml_knn.h" />
<ClInclude Include="include\compv\base\ml\compv_base_ml_svm.h" />
<ClInclude Include="include\compv\base\ml\compv_base_ml_svm_predict.h" />
<ClInclude Include="include\compv\base\ml\libsvm-322\intrin\x86\compv_ml_libsvm-322_intrin_avx.h" />
<ClInclude Include="include\compv\base\ml\libsvm-322\intrin\x86\compv_ml_libsvm-322_intrin_sse2.h" />
<ClInclude Include="include\compv\base\ml\libsvm-322\libsvm.h" />
Expand Down Expand Up @@ -1117,7 +1116,6 @@
<ClCompile Include="math\lmfit-6.1\lmmin.cxx" />
<ClCompile Include="ml\compv_base_ml_knn.cxx" />
<ClCompile Include="ml\compv_base_ml_svm.cxx" />
<ClCompile Include="ml\compv_base_ml_svm_predict.cxx" />
<ClCompile Include="ml\libsvm-322\intrin\x86\compv_ml_libsvm-322_intrin_avx.cxx">
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug_sdk|Win32'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
Expand Down
6 changes: 0 additions & 6 deletions base/CompVBase.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1029,9 +1029,6 @@
<ClInclude Include="include\compv\base\ml\libsvm-322\intrin\x86\compv_ml_libsvm-322_intrin_avx.h">
<Filter>include\ml\libsvm-322\intrin\x86</Filter>
</ClInclude>
<ClInclude Include="include\compv\base\ml\compv_base_ml_svm_predict.h">
<Filter>include\ml</Filter>
</ClInclude>
<ClInclude Include="include\compv\base\image\intrin\x86\compv_image_remap_intrin_sse41.h">
<Filter>include\image\intrin\x86</Filter>
</ClInclude>
Expand Down Expand Up @@ -1670,9 +1667,6 @@
<ClCompile Include="ml\libsvm-322\intrin\x86\compv_ml_libsvm-322_intrin_avx.cxx">
<Filter>source\ml\libsvm-322\intrin\x86</Filter>
</ClCompile>
<ClCompile Include="ml\compv_base_ml_svm_predict.cxx">
<Filter>source\ml</Filter>
</ClCompile>
<ClCompile Include="image\intrin\x86\compv_image_remap_intrin_sse41.cxx">
<Filter>source\image\intrin\x86</Filter>
</ClCompile>
Expand Down
20 changes: 13 additions & 7 deletions base/compv_sharedlib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ void* CompVSharedLib::sym(const char* name)
return CompVSharedLib::sym(m_pHandle, name);
}

COMPV_ERROR_CODE CompVSharedLib::open(const char* filePath, void** handle)
COMPV_ERROR_CODE CompVSharedLib::open(const char* filePath, void** handle, bool quiet COMPV_DEFAULT(false))
{
COMPV_CHECK_EXP_RETURN(!filePath || !handle, COMPV_ERROR_CODE_E_INVALID_PARAMETER);
void* handle_ = NULL;
void* handle_ = nullptr;
#if COMPV_OS_WINDOWS
# if COMPV_OS_WINDOWS_RT
wchar_t* szPath = (wchar_t*)tsk_calloc(tsk_strlen(path) + 1, sizeof(wchar_t));
Expand All @@ -55,10 +55,13 @@ COMPV_ERROR_CODE CompVSharedLib::open(const char* filePath, void** handle)
#endif /* !COMPV_OS_WINDOWS_CE */
# endif /*end-of-else-COMPV_OS_WINDOWS_RT*/
#else
handle_ = dlopen(filePath, RTLD_NOW);
handle_ = dlopen(filePath, RTLD_LAZY);
#endif

if (!handle_) {
if (quiet) {
return COMPV_ERROR_CODE_E_NOT_FOUND;
}
COMPV_DEBUG_ERROR("Failed to load library with path=%s", filePath);
COMPV_CHECK_CODE_RETURN(COMPV_ERROR_CODE_E_NOT_FOUND);
}
Expand Down Expand Up @@ -98,12 +101,15 @@ void* CompVSharedLib::sym(void* handle, const char* name)
return sym_;
}

COMPV_ERROR_CODE CompVSharedLib::newObj(CompVSharedLibPtrPtr sharedlib, const char* filePath)
COMPV_ERROR_CODE CompVSharedLib::newObj(CompVSharedLibPtrPtr sharedlib, const char* filePath, bool quiet COMPV_DEFAULT(false))
{
COMPV_CHECK_EXP_RETURN(!sharedlib || !filePath, COMPV_ERROR_CODE_E_INVALID_PARAMETER);
void* handle_ = NULL;
COMPV_CHECK_CODE_RETURN(CompVSharedLib::open(filePath, &handle_));
COMPV_ERROR_CODE err;
void* handle_ = nullptr;
COMPV_ERROR_CODE err = CompVSharedLib::open(filePath, &handle_, quiet);
if (quiet && COMPV_ERROR_CODE_IS_NOK(err)) {
return err;
}
COMPV_CHECK_CODE_BAIL(err);
COMPV_CHECK_CODE_BAIL(err = CompVSharedLib::newObj(sharedlib, handle_));
COMPV_DEBUG_INFO("Loaded shared lib: %s", filePath);
bail:
Expand Down
4 changes: 2 additions & 2 deletions base/include/compv/base/compv_sharedlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class COMPV_BASE_API CompVSharedLib : public CompVObj

void* sym(const char* name);

static COMPV_ERROR_CODE open(const char* filePath, void** handle);
static COMPV_ERROR_CODE open(const char* filePath, void** handle, bool quiet = false);
static COMPV_ERROR_CODE close(void* handle);
static void* sym(void* handle, const char* name);

static COMPV_ERROR_CODE newObj(CompVSharedLibPtrPtr sharedlib, const char* filePath);
static COMPV_ERROR_CODE newObj(CompVSharedLibPtrPtr sharedlib, const char* filePath, bool quiet = false);
static COMPV_ERROR_CODE newObj(CompVSharedLibPtrPtr sharedlib, void* handle);

private:
Expand Down
58 changes: 0 additions & 58 deletions base/include/compv/base/ml/compv_base_ml_svm_predict.h

This file was deleted.

Loading

0 comments on commit 55e5b26

Please sign in to comment.