From a7d82c23a34e18c122084a85e6a67d78b91999f3 Mon Sep 17 00:00:00 2001 From: Maosquerade Date: Thu, 28 Apr 2022 18:13:15 +0800 Subject: [PATCH 1/4] [FIX] remove nanodet for windows --- examples/base/tnn_sdk_sample.h | 1 + examples/windows/x86/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/base/tnn_sdk_sample.h b/examples/base/tnn_sdk_sample.h index a1ae30bbe..f16d769ec 100644 --- a/examples/base/tnn_sdk_sample.h +++ b/examples/base/tnn_sdk_sample.h @@ -16,6 +16,7 @@ #define TNN_EXAMPLES_BASE_TNN_SDK_SAMPLE_H_ #ifdef _WIN32 #define NOMINMAX + #include #endif #include #include diff --git a/examples/windows/x86/CMakeLists.txt b/examples/windows/x86/CMakeLists.txt index 0df4163a9..604318921 100644 --- a/examples/windows/x86/CMakeLists.txt +++ b/examples/windows/x86/CMakeLists.txt @@ -51,7 +51,9 @@ file(GLOB_RECURSE UTIL_SRC "${CMAKE_SOURCE_DIR}/../../utils/*.cc") file(GLOB_RECURSE WEBCAM_SRC "${CMAKE_SOURCE_DIR}/../../base/ocr*.cc") -list(REMOVE_ITEM BASE_SRC ${WEBCAM_SRC}) +file(GLOB_RECURSE NANODET_SRC "${CMAKE_SOURCE_DIR}/../../base/*nanodet.cc") + +list(REMOVE_ITEM BASE_SRC ${WEBCAM_SRC} ${NANODET_SRC}) if (TNN_DEMO_WITH_OPENCV) add_definitions(-D_OPENCV_) From aa584f3e63df32000b7c1aa7becfd9a2498a91ce Mon Sep 17 00:00:00 2001 From: Maosquerade Date: Tue, 21 Jun 2022 15:56:14 +0800 Subject: [PATCH 2/4] remove ninga compile for some bug --- examples/windows/x86/build_msvc_native.bat | 2 +- scripts/.gitignore | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/windows/x86/build_msvc_native.bat b/examples/windows/x86/build_msvc_native.bat index 3769769fb..7d277e12d 100644 --- a/examples/windows/x86/build_msvc_native.bat +++ b/examples/windows/x86/build_msvc_native.bat @@ -14,7 +14,7 @@ cd %ROOT_DIR%\..\..\..\examples\windows\x86\ mkdir build_msvc_native cd build_msvc_native -cmake .. -G "Ninja" ^ +cmake .. ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_SYSTEM_NAME=Windows ^ -DCMAKE_SYSTEM_PROCESSOR=AMD64 ^ diff --git a/scripts/.gitignore b/scripts/.gitignore index e92883994..e4935b0a8 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -14,3 +14,4 @@ cuda_linux_release build_cuda_msvc cuda_msvc_release build_linux_native +build_win From 87a5f62a55bc9e83599b209ce3a94de9ea1fb920 Mon Sep 17 00:00:00 2001 From: Maosquerade Date: Mon, 27 Jun 2022 09:59:12 +0800 Subject: [PATCH 3/4] fix x86 mat type register macro name --- source/tnn/device/x86/x86_blob_converter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tnn/device/x86/x86_blob_converter.h b/source/tnn/device/x86/x86_blob_converter.h index 3f822e0b6..9ee610fa6 100644 --- a/source/tnn/device/x86/x86_blob_converter.h +++ b/source/tnn/device/x86/x86_blob_converter.h @@ -70,7 +70,7 @@ class X86BlobConvertFuncRegister { }; #define REGISTER_X86_BLOB_CONVERT_FUNC(mat_type, data_type, cvt_dir, cvt_func) \ - X86BlobConvertFuncRegister g_arm_##mat_type##_##data_type##_##cvt_dir##_register(mat_type, data_type, \ + X86BlobConvertFuncRegister g_x86_##mat_type##_##data_type##_##cvt_dir##_register(mat_type, data_type, \ cvt_dir, cvt_func); } // namespace TNN_NS From d9edfabcc1230630a6792971ae5c82efe43fbdf9 Mon Sep 17 00:00:00 2001 From: Maosquerade Date: Tue, 28 Jun 2022 11:12:09 +0800 Subject: [PATCH 4/4] fix x86 matmul with 2 inputs --- source/tnn/device/x86/acc/x86_mat_mul_layer_acc.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/tnn/device/x86/acc/x86_mat_mul_layer_acc.cc b/source/tnn/device/x86/acc/x86_mat_mul_layer_acc.cc index fff56fd43..f51201f3d 100644 --- a/source/tnn/device/x86/acc/x86_mat_mul_layer_acc.cc +++ b/source/tnn/device/x86/acc/x86_mat_mul_layer_acc.cc @@ -23,10 +23,16 @@ X86MatMulLayerAcc::~X86MatMulLayerAcc() {} Status X86MatMulLayerAcc::Init(Context *context, LayerParam *param, LayerResource *resource, const std::vector &inputs, const std::vector &outputs) { + Status ret; + if (inputs.size() == 2) { + ret = X86LayerAcc::Init(context, param, resource, inputs, outputs); + RETURN_ON_NEQ(ret, TNN_OK); + return TNN_OK; + } + auto res = dynamic_cast(resource); CHECK_PARAM_NULL(res); - Status ret; if (res->weight.GetDataType() == DATA_TYPE_HALF) { LayerResource *fp32_res = nullptr; RETURN_ON_NEQ(ConvertHalfResource(LAYER_MATMUL, res, &fp32_res), TNN_OK);