Download modules/core/src/parallel/parallel_tbb.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/parallel/parallel_tbb.cpp
- Command line
-
hf download hf://tgollogly/test/modules/core/src/parallel/parallel_tbb.cpp
-
curl -L -o parallel_tbb.cpp https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/parallel/parallel_tbb.cpp
1.92 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| namespace cv { namespace parallel { | |
| static | |
| std::shared_ptr<cv::parallel::tbb::ParallelForBackend>& getInstance() | |
| { | |
| static std::shared_ptr<cv::parallel::tbb::ParallelForBackend> g_instance = std::make_shared<cv::parallel::tbb::ParallelForBackend>(); | |
| return g_instance; | |
| } | |
| std::shared_ptr<cv::parallel::ParallelForAPI> createParallelBackendTBB() | |
| { | |
| return getInstance(); | |
| } | |
| }} // namespace | |
| static | |
| CvResult cv_getInstance(CV_OUT CvPluginParallelBackendAPI* handle) CV_NOEXCEPT | |
| { | |
| try | |
| { | |
| if (!handle) | |
| return CV_ERROR_FAIL; | |
| *handle = cv::parallel::getInstance().get(); | |
| return CV_ERROR_OK; | |
| } | |
| catch (...) | |
| { | |
| return CV_ERROR_FAIL; | |
| } | |
| } | |
| static const OpenCV_Core_Parallel_Plugin_API plugin_api = | |
| { | |
| { | |
| sizeof(OpenCV_Core_Parallel_Plugin_API), ABI_VERSION, API_VERSION, | |
| CV_VERSION_MAJOR, CV_VERSION_MINOR, CV_VERSION_REVISION, CV_VERSION_STATUS, | |
| "TBB (interface " CVAUX_STR(TBB_INTERFACE_VERSION) ") OpenCV parallel plugin" | |
| }, | |
| { | |
| /* 1*/cv_getInstance | |
| } | |
| }; | |
| const OpenCV_Core_Parallel_Plugin_API* CV_API_CALL opencv_core_parallel_plugin_init_v0(int requested_abi_version, int requested_api_version, void* /*reserved=NULL*/) CV_NOEXCEPT | |
| { | |
| if (requested_abi_version == ABI_VERSION && requested_api_version <= API_VERSION) | |
| return &plugin_api; | |
| return NULL; | |
| } | |