Browse Source

fix #1542; fix avx2 uint16_t including (#1968)

* fix #1542; fix avx2 uint16_t including

for #1542, it is for compatibility for opencv 2.x, such as on ubuntu 16.04 apt installed opencv
tags/20200916
zchrissirhcz GitHub 6 years ago
parent
commit
b80b84fda5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions
  1. +1
    -0
      src/layer/x86/cast_x86.cpp
  2. +23
    -0
      tools/quantize/ncnn2table.cpp

+ 1
- 0
src/layer/x86/cast_x86.cpp View File

@@ -22,6 +22,7 @@
#endif // __AVX__

#if __AVX__
#include <stdint.h>
typedef union m128i
{
__m128i vec;


+ 23
- 0
tools/quantize/ncnn2table.cpp View File

@@ -795,6 +795,25 @@ static int find_all_value_in_string(const std::string& values_string, std::vecto
return 0;
}

#if CV_MAJOR_VERSION < 3
class NcnnQuantCommandLineParser : public cv::CommandLineParser
{
public:
NcnnQuantCommandLineParser(int argc, const char* const argv[], const char* key_map)
: cv::CommandLineParser(argc, argv, key_map)
{
}
bool has(const std::string& keys)
{
return cv::CommandLineParser::has(keys);
}
void printMessage()
{
cv::CommandLineParser::printParams();
}
};
#endif

int main(int argc, char** argv)
{
std::cout << "--- ncnn post training quantization tool --- " << __TIME__ << " " << __DATE__ << std::endl;
@@ -810,7 +829,11 @@ int main(int argc, char** argv)
"{swapRB c | | flag which indicates that swap first and last channels in 3-channel image is necessary }"
"{thread t | 4 | count of processing threads }";

#if CV_MAJOR_VERSION < 3
NcnnQuantCommandLineParser parser(argc, argv, key_map);
#else
cv::CommandLineParser parser(argc, argv, key_map);
#endif

if (parser.has("help"))
{


Loading…
Cancel
Save