Skip to content

Instantly share code, notes, and snippets.

@bakercp
Created April 30, 2017 02:03
Show Gist options
  • Save bakercp/157573d1e27eec5f6fe4467c98477aa7 to your computer and use it in GitHub Desktop.
Save bakercp/157573d1e27eec5f6fe4467c98477aa7 to your computer and use it in GitHub Desktop.
dlib SIMD tests
#include <dlib/image_io.h>
#include <dlib/image_transforms.h>
using namespace std;
using namespace dlib;
int main(int argc, char** argv)
{
try
{
int numRuns = 100;
double sum = 0.0;
for (int i = 0; i < numRuns; ++i)
{
matrix<unsigned char, 1536, 2048> img;
dlib::array<array2d<double>> hog;
chrono::system_clock::time_point start = chrono::system_clock::now();
impl_fhog::impl_extract_fhog_features(img, hog, 8, 1, 1);
chrono::system_clock::time_point end = chrono::system_clock::now();
double msec = std::chrono::duration_cast<chrono::milliseconds>(end - start).count();
sum += msec;
}
cout << "~" << (sum / numRuns) << " ms" << endl;
}
catch (exception& e)
{
cout << "exception thrown: " << e.what() << endl;
}
}
@MiXaiLL76
Copy link

Orange Pi Zero plus 2 (armbian)

neon not worked on aarch64

g++ -DDLIB_NO_GUI_SUPPORT -DNO_MAKEFILE -std=c++11 -O3 -I.. -lpthread fhog_simd_ex.cpp && ./a.out 

result single core

~450.77 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment