-
Notifications
You must be signed in to change notification settings - Fork 15
/
tensor_method.hpp
41 lines (26 loc) · 891 Bytes
/
tensor_method.hpp
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
/** TAL-SH: Tensor Method Interface (Tensor Functor)
REVISION: 2019/09/18
Copyright (C) 2018-2022 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2022 Oak Ridge National Laboratory (UT-Battelle)
LICENSE: BSD 3-Clause **/
#ifndef TENSOR_METHOD_HPP_
#define TENSOR_METHOD_HPP_
#ifdef EXATN_SERVICE
#include "byte_packet.h"
namespace talsh{
class Tensor;
//External tensor functor (identifiable):
template <typename IdentifiableConcept>
class TensorFunctor: public IdentifiableConcept{
public:
TensorFunctor() = default;
virtual ~TensorFunctor() = default;
//Packing/unpacking data members into/from a plain byte packet:
virtual void pack(BytePacket & packet) = 0;
virtual void unpack(BytePacket & packet) = 0;
//Application-defined external tensor method:
virtual int apply(Tensor & local_tensor) = 0;
};
} //namespace talsh
#endif //EXATN_SERVICE
#endif //TENSOR_METHOD_HPP_