******************************************************************************** conan test conan-center-index\recipes\gemmlowp\all\test_package\conanfile.py gemmlowp/cci.20210928@ --profile=C:\J\w\BuildSingleReference@6/49577/bf5a28e3-a1c7-454e-bf95-1338f042a15f/profile.txt ******************************************************************************** Configuration: [settings] arch=x86_64 build_type=Release compiler=Visual Studio compiler.runtime=MT compiler.version=15 os=Windows [options] gemmlowp:shared=True [build_requires] [env] gemmlowp/cci.20210928 (test package): Installing package Requirements gemmlowp/cci.20210928 from local cache - Cache Packages gemmlowp/cci.20210928:f42ebec2d0ee7d5c41713cd8eee15cf988b0d202 - Cache Installing (downloading, building) binaries... gemmlowp/cci.20210928: Already installed! [HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK [HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK gemmlowp/cci.20210928 (test package): Generator cmake created conanbuildinfo.cmake gemmlowp/cci.20210928 (test package): Generator txt created conanbuildinfo.txt gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowp-config-version.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowpTarget-release.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowpTargets.cmake gemmlowp/cci.20210928 (test package): Generator cmake_find_package_multi created gemmlowp-config.cmake gemmlowp/cci.20210928 (test package): Aggregating env generators gemmlowp/cci.20210928 (test package): Generated conaninfo.txt gemmlowp/cci.20210928 (test package): Generated graphinfo Using lockfile: 'C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091/conan.lock' Using cached profile from lockfile [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK gemmlowp/cci.20210928 (test package): Calling build() ----Running------ > cd C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091 && cmake -G "Visual Studio 15 2017 Win64" -DCONAN_LINK_RUNTIME="/MT" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="15" -DCONAN_CXX_FLAGS="/MP16" -DCONAN_C_FLAGS="/MP16" -DCMAKE_INSTALL_PREFIX="C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_PREFIX_PATH="C:/J/w/BuildSingleReference@6/conan-center-index/recipes/gemmlowp/all/test_package/build/290617066428d06d886410ca279f4b3067e5b091" -DCMAKE_MODULE_PATH="C:/J/w/BuildSingleReference@6/conan-center-index/recipes/gemmlowp/all/test_package/build/290617066428d06d886410ca279f4b3067e5b091" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -Wno-dev C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package ----------------- -- The C compiler identification is MSVC 19.16.27035.0 -- The CXX compiler identification is MSVC 19.16.27035.0 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: called by CMake conan helper -- Conan: Adjusting output directories -- Conan: Using cmake targets configuration -- Library eight_bit_int_gemm found C:/J/w/BuildSingleReference@6/.conan/data/gemmlowp/cci.20210928/_/_/package/f42ebec2d0ee7d5c41713cd8eee15cf988b0d202/lib/eight_bit_int_gemm.lib -- Conan: Adjusting default RPATHs Conan policies -- Conan: Adjusting language standard -- Library eight_bit_int_gemm found C:/J/w/BuildSingleReference@6/.conan/data/gemmlowp/cci.20210928/_/_/package/f42ebec2d0ee7d5c41713cd8eee15cf988b0d202/lib/eight_bit_int_gemm.lib -- Found: C:/J/w/BuildSingleReference@6/.conan/data/gemmlowp/cci.20210928/_/_/package/f42ebec2d0ee7d5c41713cd8eee15cf988b0d202/lib/eight_bit_int_gemm.lib -- Library eight_bit_int_gemm found C:/J/w/BuildSingleReference@6/.conan/data/gemmlowp/cci.20210928/_/_/package/f42ebec2d0ee7d5c41713cd8eee15cf988b0d202/lib/eight_bit_int_gemm.lib -- Found: C:/J/w/BuildSingleReference@6/.conan/data/gemmlowp/cci.20210928/_/_/package/f42ebec2d0ee7d5c41713cd8eee15cf988b0d202/lib/eight_bit_int_gemm.lib -- Configuring done -- Generating done -- Build files have been written to: C:/J/w/BuildSingleReference@6/conan-center-index/recipes/gemmlowp/all/test_package/build/290617066428d06d886410ca279f4b3067e5b091 ----Running------ > cmake --build C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091 --config Release -- /m:16 /verbosity:minimal ----------------- Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Checking Build System Building Custom Rule C:/J/w/BuildSingleReference@6/conan-center-index/recipes/gemmlowp/all/test_package/CMakeLists.txt test_package.cpp C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\test_package.cpp(80): warning C4244: '=': conversion from 'float' to 'uint8_t', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\test_package.cpp(81): warning C4244: '=': conversion from 'float' to 'uint8_t', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\test_package.cpp(110): warning C4244: '=': conversion from 'const double' to 'float', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\allocator.h(144): warning C4267: '=': conversion from 'size_t' to 'uint8_t', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\unpack.h(35): note: see reference to function template instantiation 'gemmlowp::Allocator::Handle gemmlowp::Allocator::Reserve(size_t)' being compiled c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(279): warning C4244: 'initializing': conversion from 'const int16_t' to 'uint8_t', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(262): note: while compiling class template member function 'void gemmlowp::PackingRegisterBlockBase::Pack(PackedSideBlock *,int)' with [ SrcMapType=SideMapType, PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(374): note: see reference to function template instantiation 'void gemmlowp::PackingRegisterBlockBase::Pack(PackedSideBlock *,int)' being compiled with [ SrcMapType=SideMapType, PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(294): note: see reference to class template instantiation 'gemmlowp::PackingRegisterBlockBase' being compiled with [ SrcMapType=SideMapType, PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(367): note: see reference to class template instantiation 'gemmlowp::PackingRegisterBlock' being compiled with [ SrcMapType=SideMapType, PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(366): note: while compiling class template member function 'void gemmlowp::PackSideBlockImpl::PackRun(int,int,int,int)' with [ PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(344): note: see reference to function template instantiation 'void gemmlowp::PackSideBlockImpl::PackRun(int,int,int,int)' being compiled with [ PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(428): note: see reference to class template instantiation 'gemmlowp::PackSideBlockImpl' being compiled with [ PackedSideBlock=gemmlowp::PackedSideBlock,1>> ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\multi_thread_gemm.h(690): note: see reference to function template instantiation 'void gemmlowp::PackRhs,1>>,gemmlowp::MatrixMap>(PackedSideBlock *,const MatrixMapType &)' being compiled with [ tScalar=uint8_t, PackedSideBlock=gemmlowp::PackedSideBlock,1>>, MatrixMapType=gemmlowp::MatrixMap ] c:\j\w\buildsinglereference@6\.conan\data\gemmlowp\cci.20210928\_\_\package\f42ebec2d0ee7d5c41713cd8eee15cf988b0d202\include\gemmlowp\internal\pack.h(279): warning C4244: 'initializing': conversion from 'const int16_t' to 'const uint8_t', possible loss of data [C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\test_package.vcxproj] test_package.vcxproj -> C:\J\w\BuildSingleReference@6\conan-center-index\recipes\gemmlowp\all\test_package\build\290617066428d06d886410ca279f4b3067e5b091\bin\test_package.exe Building Custom Rule C:/J/w/BuildSingleReference@6/conan-center-index/recipes/gemmlowp/all/test_package/CMakeLists.txt gemmlowp/cci.20210928 (test package): Running test() ----Running------ > bin\test_package ----------------- First, let us make some float matrices LHS and RHS, and compute their product. Here is the float LHS matrix: 0.629 0.812 -0.746 0.827 -0.729 0.67 0.938 -0.558 Here is the float RHS matrix: 0.265 -0.443 0.915 -0.384 -0.623 0.993 -0.805 0.0938 0.93 0.0944 0.986 0.935 Here is the float product (LHS * RHS) matrix obtained by ordinary float matrix multiplication, i.e. as far as we are concerned, the REFERENCE RESULT: 0.534 -0.0396 1.46 -1.26 -0.557 0.348 Now we embark on reproducing this result using quantized arithmetic. The code below splits into two parts: quantization code that only needs to run offline (e.g. to generate a quantized neural network workload), and actual runtime quantized code, which is typically performance-critical and where we typically do not want to use any floating-point arithmetic. We want to clearly distinguish between the two. The below is OFFLINE QUANTIZATION CODE. We still use some floating-point arithmetic in the process of generating the quantized workload to be run on-device. Now, let us choose quantization parameters for these matrices. You might ask, what good is quantization if we need to pick quantization parameters for the result before we can run the quantized computation to obtain the result? The idea is that we target applications such as neural networks, where unknown results are only allowed to vary within preexisting bounds. In practice, the bounds for the results are typically learned during the neural network training process. The min and max of the result do not have to be exact. If they are too broad, we just get lower quantization accuracy. If they are too narrow, we just get clamping at the bounds. For LHS, we have min = -0.746, max = 0.938, scale = 0.0066, zero_point = 113 For RHS, we have min = -0.805, max = 0.993, scale = 0.00705, zero_point = 114 For the result, we have min = -1.26, max = 1.46, scale = 0.0107, zero_point = 118 Quantized uint8 LHS matrix: 208 236 0 238 3 214 255 29 Quantized uint8 RHS matrix: 152 51 244 60 26 255 0 127 246 127 254 247 End of OFFLINE QUANTIZATION CODE. The below is ON-DEVICE RUNTIME QUANTIZED CODE. This is the part that is performance-critical and may only use quantized arithmetic. Quantized uint8 result matrix obtained by quantized multiplication: 168 115 255 0 66 151 End of ON-DEVICE RUNTIME QUANTIZED CODE. Here is the actual float product (LHS * RHS) matrix obtained by dequantizing the above uint8 result, i.e. as far as we are concerned, the ACTUAL RESULT: 0.533 -0.032 1.46 -1.26 -0.554 0.352 Difference between ACTUAL and REFERENCE float results: -0.000675 0.00764 -0.000674 -0.000674 0.0022 0.00369 CMake Warning: Manually-specified variables were not used by the project: CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_INSTALL_BINDIR CMAKE_INSTALL_DATAROOTDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_LIBEXECDIR CMAKE_INSTALL_OLDINCLUDEDIR CMAKE_INSTALL_SBINDIR