diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b42ace5b95..5658f0fd36 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -479,6 +479,10 @@ if (onnxruntime_USE_TVM) include(onnxruntime_codegen.cmake) endif() +if (onnxruntime_ENABLE_MICROSOFT_INTERNAL) + add_definitions(-DMICROSOFT_INTERNAL) +endif() + #names in this var must match the directory names under onnxruntime/core/providers set(ONNXRUNTIME_PROVIDER_NAMES cpu) diff --git a/onnxruntime/core/graph/contrib_ops/contrib_defs.cc b/onnxruntime/core/graph/contrib_ops/contrib_defs.cc index e11b3af821..9a2e58057c 100644 --- a/onnxruntime/core/graph/contrib_ops/contrib_defs.cc +++ b/onnxruntime/core/graph/contrib_ops/contrib_defs.cc @@ -5,10 +5,13 @@ #include "core/graph/contrib_ops/attn_lstm_schema_defs.h" #include "core/graph/contrib_ops/contrib_defs.h" #include "core/graph/contrib_ops/range_schema_defs.h" -#include "core/graph/contrib_ops/internal_schema_defs.h" #include "core/graph/op.h" #include "onnx/defs/shape_inference.h" +#ifdef MICROSOFT_INTERNAL +#include "core/graph/contrib_ops/internal_schema_defs.h" +#endif + namespace ONNX_NAMESPACE { void convPoolTypeAndShapeInference(ONNX_NAMESPACE::InferenceContext& ctx, bool use_dilation, bool require_kernel_shape); } @@ -653,8 +656,11 @@ Example 4: indices = [[[0,1]],[[1,0]]] output = [[[2,3]],[[4,5]]] )DOC"); + +#ifdef MICROSOFT_INTERNAL // register internal ops RegisterInternalSchemas(); +#endif } } // namespace contrib } // namespace onnxruntime diff --git a/onnxruntime/core/graph/contrib_ops/internal_schema_defs.cc b/onnxruntime/core/graph/contrib_ops/internal_schema_defs.cc deleted file mode 100644 index f88ed27cfc..0000000000 --- a/onnxruntime/core/graph/contrib_ops/internal_schema_defs.cc +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "range_schema_defs.h" - -namespace onnxruntime { -namespace contrib { - -void RegisterInternalSchemas() {} - -} // namespace contrib -} // namespace onnxruntime diff --git a/onnxruntime/core/graph/contrib_ops/internal_schema_defs.h b/onnxruntime/core/graph/contrib_ops/internal_schema_defs.h deleted file mode 100644 index 25333585fa..0000000000 --- a/onnxruntime/core/graph/contrib_ops/internal_schema_defs.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wignored-qualifiers" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif -#include "onnx/defs/schema.h" -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif - -namespace onnxruntime { -namespace contrib { - -void RegisterInternalSchemas(); - -} // namespace contrib -} // namespace onnxruntime