1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
/******************************************************************************
* Copyright (c) Intel Corporation - All rights reserved. *
* This file is part of the LIBXSMM library. *
* *
* For information on the license, see the LICENSE file. *
* Further information: https://github.com/hfp/libxsmm/ *
* SPDX-License-Identifier: BSD-3-Clause *
******************************************************************************/
/* Sasikanth Avancha, Dhiraj Kalamkar (Intel Corp.)
******************************************************************************/
#pragma once
#include <string>
#include <vector>
#include "Params.hpp"
#include "MLNode.fwd.hpp"
#include "Engine.fwd.hpp"
using namespace std;
using namespace gxm;
class MLNode
{
protected:
public:
MLNode(MLParams* p, MLEngine* e) {}
virtual ~MLNode(void) {}
virtual void createStrategy(int) {}
virtual int executeTask(int) {return 0;}
virtual void enqueTask(int pos) {}
virtual void createCheckPoint() {}
virtual void restoreCheckPoint() {}
virtual void createPersistentTask() {}
};
// Constructor should create Tensors for its output and internal buffers and assign type to it
template <typename NType, typename PType>
MLNode *CreateMLNode(MLParams *param, MLEngine *engine)
{
NType *obj = new NType(dynamic_cast<PType*>(param), engine);
return dynamic_cast<MLNode*>(obj);
}
|