intel / ARM_NEON_2_x86_SSE

The platform independent header allowing to compile any C/C++ code containing ARM NEON intrinsic functions for x86 target systems using SIMD up to AVX2 intrinsic functions
Other
430 stars 149 forks source link

Extensive Correctness Tests for the ARM Neon Intrinsic Functions #14

Closed lcy1991ycl closed 6 years ago

lcy1991ycl commented 6 years ago

How do you do the extensive correctness tests for the ARM Neon intrinsic functions? Could you share the test report, or the test code?

Zvictoria commented 6 years ago

The solution for the functions implemented passes extensive correctness tests for the ARM Neon intrinsic functions https://github.com/christophe-lyon/arm-neon-tests I will add it to the project description, thanks for the hint :)

lcy1991ycl commented 6 years ago

But it is not for the functions implemented with SSE instructions, it is for ARM/NEON instructions. https://github.com/christophe-lyon/arm-neon-tests

Zvictoria commented 6 years ago

Then I don't understand your question, sorry. If you want to test the SSE implementation of ARM NEON set - just use this header for the tests set mentioned above and compare with the original arm_neon.h based version.

lcy1991ycl commented 6 years ago

That's what I mean. But the tests set mentioned above is for an ARM target or an ARM simulator, doesn't support execution on the Intel platform.

lcy1991ycl commented 6 years ago

I am confused the extensive correctness tests that you have done and passed. Could you introduce it to me in detail? Maybe, you can share the test report with us.

Zvictoria commented 6 years ago

Well, that's what my project is about - to facilitate ARM project port to x86 :) therefore I've just took the ARM tests mentioned and applied my tool there. Except for that some minor corrections were necessary to make it running on x86 in my setup (say some other auxiliary headers inclusion/exclusion) but I don't plan to share it anywhere, sorry - they are for my own usage only. The test set mentioned has the perfect test report as an output - just use it :)

lcy1991ycl commented 6 years ago

The report that I mean is not the output, but the precision, just as the output of which function implemented is different, and how much the difference is.

lcy1991ycl commented 6 years ago

pragma once

include

include

include

include

////////////////////////////////////////////////////////////////////////// //scope exit namespace { template class InnerScopeExit { public: InnerScopeExit(const FuncType _func) :func(_func){} ~InnerScopeExit(){ if (!dismissed){ func(); } } private: FuncType func; bool dismissed = false; }; template InnerScopeExit MakeScopeExit(F f) { return InnerScopeExit(f); }; }

define DO_STRING_JOIN(arg1, arg2) arg1 ## arg2

define STRING_JOIN(arg1, arg2) DO_STRING_JOIN(arg1, arg2)

define SCOPEEXIT(code) auto STRING_JOIN(scope_exitobject, LINE) = ::MakeScopeExit([&](){code;});

////////////////////////////////////////////////////////////////////////// //function cost time calculate helper class FuncCostTimeHelper { public: FuncCostTimeHelper(const std::string& _tag) :tag(_tag) { start_time = std::chrono::high_resolution_clock::now(); } ~FuncCostTimeHelper() { stop_time = std::chrono::high_resolution_clock::now(); const auto cost_time = std::chrono::duration_cast(stop_time - start_time).count(); //us std::cout << tag << " cost time : " << cost_time << " us" << std::endl; } private: std::string tag; std::chrono::high_resolution_clock::time_point start_time; std::chrono::high_resolution_clock::time_point stop_time; };

lcy1991ycl commented 6 years ago

Is this header nessesary to include?

Zvictoria commented 6 years ago

When I say "it passes the test" is means output is the same :) The only difference is in some floating point approximations and I don't remember the exact difference order of magnitude but it is acceptable for generic usage for sure. As for exact test modifications (what headers, defines etc to include) - the honest answer is - I don't remember and don't plan to look into it in foreseeable future, sorry. Here you are on your own. Just to mention - everything depends on your setup. My one has been for Visual Studio 2013.

lcy1991ycl commented 6 years ago

OK, thank you very much.