Commit 7db0614e authored by pruthvi's avatar pruthvi

- explicitly link all the builders by referencing from the build funtion, so…

- explicitly link all the builders by referencing from the build funtion, so linker includes all the object files
parent 3191696b
......@@ -25,6 +25,7 @@ endif()
set(SRC
cpu_backend.cpp
cpu_builder.cpp
cpu_builder_registry.cpp
cpu_call_frame.cpp
cpu_executor.cpp
cpu_external_function.cpp
......
......@@ -79,6 +79,10 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Add);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_add_cpp() {}
#endif
}
}
}
......@@ -64,6 +64,10 @@ namespace ngraph
}
REGISTER_OP_BUILDER(AllReduce);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_allreduce_cpp() {}
#endif
}
}
}
......@@ -210,6 +210,10 @@ namespace ngraph
}
REGISTER_OP_BUILDER(ArgMax);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_argmax_cpp() {}
#endif
}
}
}
......@@ -210,6 +210,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(ArgMin);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_argmin_cpp() {}
#endif
}
}
}
......@@ -197,6 +197,10 @@ namespace ngraph
}
REGISTER_OP_BUILDER(AvgPool);
REGISTER_OP_BUILDER(AvgPoolBackprop);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_avg_pool_cpp() {}
#endif
}
}
}
......@@ -508,6 +508,11 @@ namespace ngraph
REGISTER_OP_BUILDER(BatchNormTrainingRelu);
REGISTER_OP_BUILDER(BatchNormInferenceRelu);
REGISTER_OP_BUILDER(BatchNormTrainingBackprop);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_batch_norm_cpp() {}
#endif
}
}
}
......@@ -88,6 +88,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(BoundedRelu);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_bounded_relu_cpp() {}
#endif
}
}
}
......@@ -232,6 +232,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Broadcast);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_broadcast_cpp() {}
#endif
}
}
}
......@@ -44,6 +44,9 @@ namespace ngraph
functors.emplace_back(functor);
}
REGISTER_OP_BUILDER(BroadcastDistributed);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_broadcast_distributed_cpp() {}
#endif
}
}
}
......@@ -170,6 +170,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Concat);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_concat_cpp() {}
#endif
}
}
}
......@@ -115,6 +115,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Convert);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_convert_cpp() {}
#endif
}
}
}
......@@ -104,6 +104,9 @@ namespace ngraph
functors.emplace_back(functor);
}
REGISTER_CPU_OP_BUILDER(ConvertLayout);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_convert_layout_cpp() {}
#endif
}
}
}
......@@ -832,6 +832,10 @@ namespace ngraph
REGISTER_OP_BUILDER(ConvolutionAdd);
REGISTER_OP_BUILDER(GroupConvolutionBias);
REGISTER_OP_BUILDER(DeconvolutionBias)
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_convolution_cpp() {}
#endif
} // namespace cpu
} // namespace runtime
} // namespace ngraph
......@@ -258,6 +258,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Dot);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_dot_cpp() {}
#endif
}
}
}
......@@ -127,6 +127,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Dropout);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_dropout_cpp() {}
#endif
}
}
}
......@@ -245,6 +245,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(EmbeddingLookup);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_embedding_lookup_cpp() {}
#endif
}
}
}
......@@ -72,6 +72,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(Erf);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_erf_cpp() {}
#endif
}
}
}
......@@ -237,6 +237,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Gather);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_gather_cpp() {}
#endif
} // namespace cpu
} // namespace runtime
} // namespace ngraph
......@@ -139,6 +139,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(GatherND);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_gather_nd_cpp() {}
#endif
}
}
}
......@@ -48,6 +48,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(GetOutputElement);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_get_output_element_cpp() {}
#endif
}
}
}
......@@ -86,6 +86,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(CPULeakyRelu);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_leaky_relu_cpp() {}
#endif
}
}
}
......@@ -123,6 +123,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(LRN);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_lrn_cpp() {}
#endif
}
}
}
......@@ -108,6 +108,9 @@ namespace ngraph
functors.emplace_back(functor);
}
REGISTER_OP_BUILDER(Lstm);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_lstm_cpp() {}
#endif
}
}
}
......@@ -396,6 +396,9 @@ namespace ngraph
REGISTER_OP_BUILDER(MatmulBias);
REGISTER_OP_BUILDER(BatchMatMul);
REGISTER_OP_BUILDER(BatchMatMulTranspose);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_matmul_bias_cpp() {}
#endif
}
}
}
......@@ -38,6 +38,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Max);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_max_cpp() {}
#endif
}
}
}
......@@ -337,6 +337,9 @@ namespace ngraph
REGISTER_OP_BUILDER(MaxPoolBackprop);
REGISTER_OP_BUILDER(MaxPoolWithIndices);
REGISTER_OP_BUILDER(MaxPoolWithIndicesBackprop);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_max_pool_cpp() {}
#endif
}
}
}
......@@ -38,6 +38,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Min);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_min_cpp() {}
#endif
}
}
}
......@@ -109,6 +109,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(OneHot);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_one_hot_cpp() {}
#endif
}
}
}
......@@ -171,6 +171,9 @@ namespace ngraph
}
}
REGISTER_CF_BUILDER(Pad);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_pad_cpp() {}
#endif
}
}
}
......@@ -38,6 +38,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Product);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_product_cpp() {}
#endif
}
}
}
......@@ -585,6 +585,9 @@ namespace ngraph
REGISTER_OP_BUILDER(Dequantize);
REGISTER_OP_BUILDER(Quantize);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_quantization_cpp() {}
#endif
}
}
}
......@@ -69,6 +69,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(QuantizedAvgPool);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_quantized_avg_pool_cpp() {}
#endif
}
}
}
......@@ -708,6 +708,9 @@ namespace ngraph
REGISTER_OP_BUILDER(QuantizedConvolutionBias);
REGISTER_OP_BUILDER(QuantizedConvolutionBiasAdd);
REGISTER_OP_BUILDER(QuantizedConvolutionBiasSignedAdd);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_quantized_conv_cpp() {}
#endif
}
}
}
......@@ -163,6 +163,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(QuantizedDotBias);
REGISTER_OP_BUILDER(QuantizedDot);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_quantized_dot_cpp() {}
#endif
}
}
}
......@@ -103,6 +103,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(QuantizedMatmul);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_quantized_matmul_cpp() {}
#endif
}
}
}
......@@ -84,6 +84,9 @@ namespace ngraph
REGISTER_OP_BUILDER(Any);
REGISTER_OP_BUILDER(All);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_reduce_function_cpp() {}
#endif
}
}
}
......@@ -134,6 +134,9 @@ namespace ngraph
REGISTER_OP_BUILDER(Relu);
REGISTER_OP_BUILDER(ReluBackprop);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_relu_cpp() {}
#endif
}
}
}
......@@ -135,6 +135,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(ReplaceSlice);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_replace_slice_cpp() {}
#endif
}
}
}
......@@ -248,6 +248,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Reshape);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_reshape_cpp() {}
#endif
}
}
}
......@@ -63,6 +63,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Reverse);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_reverse_cpp() {}
#endif
}
}
}
......@@ -80,6 +80,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(ReverseSequence);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_reverse_sequence_cpp() {}
#endif
}
}
}
......@@ -103,6 +103,9 @@ namespace ngraph
functors.emplace_back(functor);
}
REGISTER_OP_BUILDER(Rnn);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_rnn_cpp() {}
#endif
}
}
}
......@@ -140,6 +140,9 @@ namespace ngraph
}
}
REGISTER_OP_BUILDER(ScatterAdd);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_scatter_add_cpp() {}
#endif
}
}
}
......@@ -157,6 +157,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(ScatterNDAdd);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_scatter_nd_add_cpp() {}
#endif
}
}
}
......@@ -63,6 +63,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Select);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_select_cpp() {}
#endif
}
}
}
......@@ -189,6 +189,9 @@ namespace ngraph
REGISTER_OP_BUILDER(SigmoidBackprop);
REGISTER_OP_BUILDER(SigmoidMultiply);
REGISTER_OP_BUILDER(SigmoidMultiplyBackprop);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_sigmoid_cpp() {}
#endif
}
}
}
......@@ -188,6 +188,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Slice);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_slice_cpp() {}
#endif
}
}
}
......@@ -196,6 +196,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Softmax);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_softmax_cpp() {}
#endif
}
}
}
......@@ -140,6 +140,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(GenerateMask);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_state_cpp() {}
#endif
}
}
}
......@@ -38,6 +38,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Sum);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_sum_cpp() {}
#endif
}
}
}
......@@ -76,6 +76,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(Tile);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_tile_cpp() {}
#endif
}
}
}
......@@ -161,6 +161,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(TopK);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_topk_cpp() {}
#endif
}
}
}
......@@ -125,6 +125,9 @@ namespace ngraph
}
REGISTER_OP_BUILDER(UpdateSlice);
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
void register_builders_update_slice_cpp() {}
#endif
}
}
}
......@@ -66,6 +66,7 @@
#include "ngraph/op/tan.hpp"
#include "ngraph/op/tanh.hpp"
#include "ngraph/runtime/cpu/cpu_kernels.hpp"
#include "ngraph/runtime/cpu/cpu_builder_registry.hpp"
#include "ngraph/runtime/cpu/cpu_op_annotations.hpp"
#include "ngraph/runtime/cpu/kernel/abs.hpp"
#include "ngraph/runtime/cpu/kernel/acos.hpp"
......
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include "ngraph/runtime/cpu/cpu_builder_registry.hpp"
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
namespace ngraph
{
namespace runtime
{
namespace cpu
{
void register_builders() {
register_builders_add_cpp();
register_builders_allreduce_cpp();
register_builders_argmax_cpp();
register_builders_argmin_cpp();
register_builders_avg_pool_cpp();
register_builders_batch_norm_cpp();
register_builders_bounded_relu_cpp();
register_builders_broadcast_cpp();
register_builders_broadcast_distributed_cpp();
register_builders_concat_cpp();
register_builders_convert_cpp();
register_builders_convert_layout_cpp();
register_builders_convolution_cpp();
register_builders_dot_cpp();
register_builders_dropout_cpp();
register_builders_embedding_lookup_cpp();
register_builders_erf_cpp();
register_builders_gather_cpp();
register_builders_gather_nd_cpp();
register_builders_get_output_element_cpp();
register_builders_leaky_relu_cpp();
register_builders_lrn_cpp();
register_builders_lstm_cpp();
register_builders_matmul_bias_cpp();
register_builders_max_cpp();
register_builders_max_pool_cpp();
register_builders_min_cpp();
register_builders_one_hot_cpp();
register_builders_pad_cpp();
register_builders_product_cpp();
register_builders_quantization_cpp();
register_builders_quantized_avg_pool_cpp();
register_builders_quantized_conv_cpp();
register_builders_quantized_dot_cpp();
register_builders_quantized_matmul_cpp();
register_builders_reduce_function_cpp();
register_builders_relu_cpp();
register_builders_replace_slice_cpp();
register_builders_reshape_cpp();
register_builders_reverse_cpp();
register_builders_reverse_sequence_cpp();
register_builders_rnn_cpp();
register_builders_scatter_add_cpp();
register_builders_scatter_nd_add_cpp();
register_builders_select_cpp();
register_builders_state_cpp();
register_builders_sigmoid_cpp();
register_builders_slice_cpp();
register_builders_softmax_cpp();
register_builders_sum_cpp();
register_builders_tile_cpp();
register_builders_topk_cpp();
register_builders_update_slice_cpp();
}
}
}
}
#endif
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
namespace ngraph
{
namespace runtime
{
namespace cpu
{
void register_builders();
void register_builders_add_cpp();
void register_builders_allreduce_cpp();
void register_builders_argmax_cpp();
void register_builders_argmin_cpp();
void register_builders_avg_pool_cpp();
void register_builders_batch_norm_cpp();
void register_builders_bounded_relu_cpp();
void register_builders_broadcast_cpp();
void register_builders_broadcast_distributed_cpp();
void register_builders_concat_cpp();
void register_builders_convert_cpp();
void register_builders_convert_layout_cpp();
void register_builders_convolution_cpp();
void register_builders_dot_cpp();
void register_builders_dropout_cpp();
void register_builders_embedding_lookup_cpp();
void register_builders_erf_cpp();
void register_builders_gather_cpp();
void register_builders_gather_nd_cpp();
void register_builders_get_output_element_cpp();
void register_builders_leaky_relu_cpp();
void register_builders_lrn_cpp();
void register_builders_lstm_cpp();
void register_builders_matmul_bias_cpp();
void register_builders_max_cpp();
void register_builders_max_pool_cpp();
void register_builders_min_cpp();
void register_builders_one_hot_cpp();
void register_builders_pad_cpp();
void register_builders_product_cpp();
void register_builders_quantization_cpp();
void register_builders_quantized_avg_pool_cpp();
void register_builders_quantized_conv_cpp();
void register_builders_quantized_dot_cpp();
void register_builders_quantized_matmul_cpp();
void register_builders_reduce_function_cpp();
void register_builders_relu_cpp();
void register_builders_replace_slice_cpp();
void register_builders_reshape_cpp();
void register_builders_reverse_cpp();
void register_builders_reverse_sequence_cpp();
void register_builders_rnn_cpp();
void register_builders_scatter_add_cpp();
void register_builders_scatter_nd_add_cpp();
void register_builders_select_cpp();
void register_builders_state_cpp();
void register_builders_sigmoid_cpp();
void register_builders_slice_cpp();
void register_builders_softmax_cpp();
void register_builders_sum_cpp();
void register_builders_tile_cpp();
void register_builders_topk_cpp();
void register_builders_update_slice_cpp();
}
}
}
#endif
......@@ -155,6 +155,7 @@
#include "ngraph/runtime/aligned_buffer.hpp"
#include "ngraph/runtime/cpu/cpu_backend.hpp"
#include "ngraph/runtime/cpu/cpu_builder.hpp"
#include "ngraph/runtime/cpu/cpu_builder_registry.hpp"
#include "ngraph/runtime/cpu/cpu_call_frame.hpp"
#include "ngraph/runtime/cpu/cpu_cse.hpp"
#include "ngraph/runtime/cpu/cpu_emitter.hpp"
......@@ -1341,6 +1342,11 @@ void runtime::cpu::CPU_ExternalFunction::build(ngraph::pass::PassConfig& pass_co
"enabled due to concurrent graph execution");
}
// reference all the builders for static library
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
ngraph::runtime::cpu::register_builders();
#endif
// stream writer to dump the debug manifest for the DEX
static const string s_debug_dir = "cpu_codegen";
static StaticInitializers s_static_initializers(s_debug_dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment