Unverified Commit e5d122c8 authored by Ilya Churaev's avatar Ilya Churaev Committed by GitHub

Defining opset2 (#4370)

* Defining opset2

* Added opset2
Co-authored-by: 's avatarScott Cyphers <diyessi@users.noreply.github.com>
parent 35d50450
......@@ -64,3 +64,20 @@ const ngraph::OpSet& ngraph::get_opset1()
}
return opset;
}
const ngraph::OpSet& ngraph::get_opset2()
{
static std::mutex init_mutex;
static OpSet opset;
if (opset.size() == 0)
{
std::lock_guard<std::mutex> guard(init_mutex);
if (opset.size() == 0)
{
#define NGRAPH_OP(NAME, NAMESPACE) opset.insert<NAMESPACE::NAME>();
#include "ngraph/opsets/opset2_tbl.hpp"
#undef NGRAPH_OP
}
}
return opset;
}
......@@ -101,4 +101,5 @@ namespace ngraph
const NGRAPH_API OpSet& get_opset0();
const NGRAPH_API OpSet& get_opset1();
const NGRAPH_API OpSet& get_opset2();
}
\ No newline at end of file
//*****************************************************************************
// Copyright 2017-2020 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
#include "ngraph/ops.hpp"
#include "ngraph/opsets/opset1.hpp"
namespace ngraph
{
namespace opset2
{
#define NGRAPH_OP(a, b) using b::a;
#include "ngraph/opsets/opset2_tbl.hpp"
#undef NGRAPH_OP
}
}
//*****************************************************************************
// Copyright 2017-2020 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.
//*****************************************************************************
// This collection contains one entry for each new op on top of the opset1.
#ifndef NGRAPH_OP
#warning "NGRAPH_OP not defined"
#define NGRAPH_OP(x, y)
#endif
#include "opset1_tbl.hpp"
NGRAPH_OP(Gelu, ngraph::op::v0)
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