mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[Other] Add global SetProcLibCpuNumThreads method (#513)
[FlyCV] Add global SetProcLibCpuNumThreads method
This commit is contained in:
@@ -54,5 +54,12 @@ void DisableFlyCV() {
|
||||
<< DefaultProcLib::default_lib << std::endl;
|
||||
}
|
||||
|
||||
void SetProcLibCpuNumThreads(int threads) {
|
||||
cv::setNumThreads(threads);
|
||||
#ifdef ENABLE_FLYCV
|
||||
fcv::set_thread_num(threads);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace vision
|
||||
} // namespace fastdeploy
|
||||
|
@@ -31,6 +31,11 @@ FASTDEPLOY_DECL void EnableFlyCV();
|
||||
/// Disable using FlyCV to process image while deploy vision models.
|
||||
FASTDEPLOY_DECL void DisableFlyCV();
|
||||
|
||||
/*! @brief Set the cpu num threads of ProcLib. The cpu num threads
|
||||
* of FlyCV and OpenCV is 2 by default.
|
||||
*/
|
||||
FASTDEPLOY_DECL void SetProcLibCpuNumThreads(int threads);
|
||||
|
||||
class FASTDEPLOY_DECL Processor {
|
||||
public:
|
||||
// default_lib has the highest priority
|
||||
|
@@ -46,7 +46,7 @@ dependencies {
|
||||
|
||||
def archives = [
|
||||
[
|
||||
'src' : 'https://bj.bcebos.com/fastdeploy/test/fastdeploy-android-0.5.0-shared-dev.tgz',
|
||||
'src' : 'https://bj.bcebos.com/fastdeploy/test/fastdeploy-android-latest-shared-dev.tgz',
|
||||
'dest': 'libs'
|
||||
]
|
||||
]
|
||||
|
@@ -12,7 +12,7 @@ project("fastdeploy_jni")
|
||||
# You can define multiple libraries, and CMake builds them for you.
|
||||
# Gradle automatically packages shared libraries with your APK.
|
||||
|
||||
set(FastDeploy_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/fastdeploy-android-0.5.0-shared-dev")
|
||||
set(FastDeploy_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/fastdeploy-android-latest-shared-dev")
|
||||
|
||||
find_package(FastDeploy REQUIRED)
|
||||
|
||||
|
Reference in New Issue
Block a user