Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / mkldnn_plugin / mkldnn_descriptor.cpp
index bcb4741..63af551 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
 // SPDX-License-Identifier: Apache-2.0
 //
 
@@ -53,19 +53,6 @@ MKLDNNDescriptor::operator std::shared_ptr<mkldnn::convolution_forward::desc>()
     return typeDesc->getPtr();
 }
 
-MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::convolution_relu_forward::desc> desc) {
-    this->desc.reset(new DescFwdImpl<mkldnn::convolution_relu_forward::desc>(desc));
-}
-
-MKLDNNDescriptor::operator std::shared_ptr<mkldnn::convolution_relu_forward::desc>() {
-    DescFwdImpl<mkldnn::convolution_relu_forward::desc> *typeDesc =
-            dynamic_cast<DescFwdImpl<mkldnn::convolution_relu_forward::desc> *>(desc.get());
-    if (typeDesc == nullptr) {
-        THROW_IE_EXCEPTION << "Cannot cast descriptor!";
-    }
-    return typeDesc->getPtr();
-}
-
 MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::convolution_backward_data::desc> desc,
                                    std::shared_ptr<mkldnn::convolution_forward::primitive_desc> prim) {
     this->desc.reset(
@@ -132,19 +119,6 @@ MKLDNNDescriptor::operator std::shared_ptr<mkldnn::pooling_forward::desc>() {
     return typeDesc->getPtr();
 }
 
-MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::relu_forward::desc> desc) {
-    this->desc.reset(new DescFwdImpl<mkldnn::relu_forward::desc>(desc));
-}
-
-MKLDNNDescriptor::operator std::shared_ptr<mkldnn::relu_forward::desc>() {
-    DescFwdImpl<mkldnn::relu_forward::desc> *typeDesc =
-            dynamic_cast<DescFwdImpl<mkldnn::relu_forward::desc> *>(desc.get());
-    if (typeDesc == nullptr) {
-        THROW_IE_EXCEPTION << "Cannot cast descriptor!";
-    }
-    return typeDesc->getPtr();
-}
-
 MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::roi_pooling_forward::desc> desc) {
     this->desc.reset(new DescFwdImpl<mkldnn::roi_pooling_forward::desc>(desc));
 }
@@ -196,3 +170,40 @@ MKLDNNDescriptor::operator std::shared_ptr<mkldnn::rnn_forward::desc>() {
     }
     return typeDesc->getPtr();
 }
+
+MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::eltwise_forward::desc> desc) {
+    this->desc.reset(new DescFwdImpl<mkldnn::eltwise_forward::desc>(desc));
+}
+
+MKLDNNDescriptor::operator std::shared_ptr<mkldnn::eltwise_forward::desc>() {
+    DescFwdImpl<mkldnn::eltwise_forward::desc> *typeDesc =
+            dynamic_cast<DescFwdImpl<mkldnn::eltwise_forward::desc> *>(desc.get());
+        if (typeDesc == nullptr) {
+        THROW_IE_EXCEPTION << "Cannot cast descriptor!";
+    }
+    return typeDesc->getPtr();
+}
+
+MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::binarization_forward::desc> desc) {
+    this->desc.reset(new DescFwdImpl<mkldnn::binarization_forward::desc>(desc));
+}
+
+MKLDNNDescriptor::operator std::shared_ptr<mkldnn::binarization_forward::desc>() {
+    auto *typeDesc = dynamic_cast<DescFwdImpl<mkldnn::binarization_forward::desc> *>(desc.get());
+    if (typeDesc == nullptr) {
+        THROW_IE_EXCEPTION << "Cannot cast descriptor!";
+    }
+    return typeDesc->getPtr();
+}
+
+MKLDNNDescriptor::MKLDNNDescriptor(std::shared_ptr<mkldnn::binary_convolution_forward::desc> desc) {
+    this->desc.reset(new DescFwdImpl<mkldnn::binary_convolution_forward::desc>(desc));
+}
+
+MKLDNNDescriptor::operator std::shared_ptr<mkldnn::binary_convolution_forward::desc>() {
+    auto *typeDesc = dynamic_cast<DescFwdImpl<mkldnn::binary_convolution_forward::desc> *>(desc.get());
+    if (typeDesc == nullptr) {
+        THROW_IE_EXCEPTION << "Cannot cast descriptor!";
+    }
+    return typeDesc->getPtr();
+}