From 0d12ae8095b52e0182c1e59485477d44d26ca0cd Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 16 Jun 2020 13:44:12 +0800 Subject: [PATCH] feat(opr/standalone): import NMSKeep from MegSkull contrib 1. clang-format. 2. Use name "NMSKeepMGB" during serialization to avoid conflict with MegSkull contrib one. GitOrigin-RevId: 627c60e4829f34b45a7587bb09770af761b90be9 --- python_module/megengine/_internal/__init__.py | 2 +- python_module/megengine/_internal/opr_extra.py | 3 +++ src/CMakeLists.txt | 5 +++++ src/opr/impl/mgb_cpp_opr.fbs | 5 +++++ src/serialization/impl/schema.fbs | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 python_module/megengine/_internal/opr_extra.py diff --git a/python_module/megengine/_internal/__init__.py b/python_module/megengine/_internal/__init__.py index e46ec7cd4..684aa51e9 100644 --- a/python_module/megengine/_internal/__init__.py +++ b/python_module/megengine/_internal/__init__.py @@ -25,7 +25,7 @@ from . import config, craniotome, dtype from . import global_init as _global_init from . import helper as _helper from . import mgb as _detail -from . import opr, opr_param_defs, plugin +from . import opr, opr_extra, opr_param_defs, plugin from .exc import MegBrainError from .logconf import get_logger from .mgb import ( diff --git a/python_module/megengine/_internal/opr_extra.py b/python_module/megengine/_internal/opr_extra.py new file mode 100644 index 000000000..7a59a2cfc --- /dev/null +++ b/python_module/megengine/_internal/opr_extra.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015-2019 Megvii Inc. All rights reserved. + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 20ddcbbcb..0a9263ac8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,6 +34,11 @@ if(MGE_WITH_CUDA AND MGE_WITH_TRT) endif() +if(MGE_WITH_CUDA) + file(GLOB_RECURSE SOURCES_ opr/impl/standalone/*.cu) + list(APPEND SOURCES ${SOURCES_}) +endif() + add_library(megbrain OBJECT EXCLUDE_FROM_ALL ${SOURCES}) target_link_libraries(megbrain PUBLIC mgb_opr_param_defs) target_include_directories(megbrain diff --git a/src/opr/impl/mgb_cpp_opr.fbs b/src/opr/impl/mgb_cpp_opr.fbs index 75b76795c..48dfe44c9 100644 --- a/src/opr/impl/mgb_cpp_opr.fbs +++ b/src/opr/impl/mgb_cpp_opr.fbs @@ -55,3 +55,8 @@ struct IndexDescMaskItem { table IndexDescMaskDump { items:[IndexDescMaskItem]; } + +table NMSKeep { + iou_thresh:float; + max_output:uint; +} diff --git a/src/serialization/impl/schema.fbs b/src/serialization/impl/schema.fbs index d0a85bfdb..623f5a704 100644 --- a/src/serialization/impl/schema.fbs +++ b/src/serialization/impl/schema.fbs @@ -98,6 +98,7 @@ union OperatorParam { param.IndexDescMaskDump = 66, DType = 67, param.Remap = 68, + param.NMSKeep = 69, } table Operator { -- GitLab