Download modules/core/perf/perf_allocation.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/core/perf/perf_allocation.cpp
- Command line
-
hf download hf://tgollogly/test/modules/core/perf/perf_allocation.cpp
-
curl -L -o perf_allocation.cpp https://huggingface.co/tgollogly/test/resolve/main/modules/core/perf/perf_allocation.cpp
1.42 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. | |
| using namespace perf; | |
| namespace opencv_test | |
| { | |
| typedef perf::TestBaseWithParam<MatType> MatDepth_tb; | |
| PERF_TEST_P(MatDepth_tb, DISABLED_Allocation_Aligned, | |
| testing::Values(CV_8UC1, CV_16SC1, CV_8UC3, CV_8UC4)) | |
| { | |
| const int matType = GetParam(); | |
| const cv::Mat utility(1, 1, matType); | |
| const size_t elementBytes = utility.elemSize(); | |
| const std::array<cv::Size, 20> sizes{ALLOC_MAT_SIZES}; | |
| std::array<size_t, 20> bytes; | |
| for (size_t i = 0; i < sizes.size(); ++i) | |
| { | |
| bytes[i] = sizes[i].width * sizes[i].height * elementBytes; | |
| } | |
| declare.time(60) | |
| .iterations(100); | |
| TEST_CYCLE() | |
| { | |
| for (int i = 0; i < 100000; ++i) | |
| { | |
| fastFree(fastMalloc(bytes[i % sizes.size()])); | |
| } | |
| } | |
| SANITY_CHECK_NOTHING(); | |
| } | |
| } | |