Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / tests / unit / engines / mkldnn / mkldnn_primitive_test.cpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #include <gtest/gtest.h>
6 #include <gmock/gmock.h>
7 #include "mkldnn_plugin/mkldnn_memory.h"
8 #include "mkldnn_plugin/mkldnn_graph.h"
9
10 using namespace std;
11 using namespace MKLDNNPlugin;
12 using namespace mkldnn;
13 using namespace ::testing;
14
15 class MKLDNNPrimitiveTest : public ::testing::Test {
16 protected:
17     virtual void TearDown() override{
18     }
19
20     virtual void SetUp() override{
21     }
22 };
23
24 //class ChildConv : public MKLDNNConvolution {
25 // public:
26 //    explicit ChildConv(const engine& eng) : MKLDNNConvolution(eng) {}
27 //    // Add the following two lines to the mock class.
28 //    MOCK_METHOD0(die, void());
29 //    ~ChildConv () { die(); }
30 //};
31
32
33 TEST_F(MKLDNNPrimitiveTest, DISABLED_canDeleteWeightInweitableLayer) {
34     //simulate how convlayer gets created
35     engine e(engine::cpu, 0);
36     //auto node = MKLDNNPlugin::MKLDNNNodePtr(MKLDNNPlugin::MKLDNNNode::CreateNode(MKLDNNPlugin::Generic, InferenceEngine::Precision::FP32, ""));
37 //    ChildConv *conv = new ChildConv(e);
38 //    EXPECT_CALL(*conv, die()).Times(1);
39
40     std::vector<float> weights = {1,2,3,4};
41     std::vector<void *> weightsData = {(void*)&*weights.begin()};
42     std::vector <size_t> weightsSize = {weights.size() * sizeof(float)};
43
44     memory::dims dims(4);
45     dims[0] = weights.size();
46
47 //    conv->CreateWeightsMemory(dims, memory::f32, memory::nchw);
48 //    conv->SetWeights(weightsData, weightsSize);
49     FAIL() << "Should change the test";
50 //    node->SetPrimitive(conv);
51 //    node.reset();
52
53 //    Mock::VerifyAndClear(conv);
54 }