ExaTN
tensor_node_executor.hpp
1 
18 #ifndef EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
19 #define EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
20 
21 #include "Identifiable.hpp"
22 
23 #include "tensor_op_factory.hpp"
24 #include "tensor.hpp"
25 
26 #include <vector>
27 #include <memory>
28 
29 namespace talsh{
30 class Tensor;
31 }
32 
33 namespace exatn {
34 namespace runtime {
35 
36 class TensorNodeExecutor : public Identifiable, public Cloneable<TensorNodeExecutor> {
37 
38 public:
39 
40  virtual ~TensorNodeExecutor() = default;
41 
43  virtual void initialize() = 0;
44 
49  virtual int execute(numerics::TensorOpCreate & op,
50  TensorOpExecHandle * exec_handle) = 0;
51  virtual int execute(numerics::TensorOpDestroy & op,
52  TensorOpExecHandle * exec_handle) = 0;
53  virtual int execute(numerics::TensorOpTransform & op,
54  TensorOpExecHandle * exec_handle) = 0;
55  virtual int execute(numerics::TensorOpAdd & op,
56  TensorOpExecHandle * exec_handle) = 0;
57  virtual int execute(numerics::TensorOpContract & op,
58  TensorOpExecHandle * exec_handle) = 0;
59 
61  virtual bool sync(TensorOpExecHandle op_handle,
62  int * error_code,
63  bool wait = false) = 0;
64 
66  virtual std::shared_ptr<talsh::Tensor> getLocalTensor(const numerics::Tensor & tensor,
67  const std::vector<std::pair<DimOffset,DimExtent>> & slice_spec) = 0;
68 
69  virtual std::shared_ptr<TensorNodeExecutor> clone() = 0;
70 };
71 
72 } //namespace runtime
73 } //namespace exatn
74 
75 #endif //EXATN_RUNTIME_TENSOR_NODE_EXECUTOR_HPP_
exatn::numerics::Tensor
Definition: tensor.hpp:63
talsh
Definition: tensor_node_executor.hpp:29
exatn::runtime::TensorNodeExecutor::getLocalTensor
virtual std::shared_ptr< talsh::Tensor > getLocalTensor(const numerics::Tensor &tensor, const std::vector< std::pair< DimOffset, DimExtent >> &slice_spec)=0
exatn::runtime::TensorNodeExecutor::sync
virtual bool sync(TensorOpExecHandle op_handle, int *error_code, bool wait=false)=0
exatn
Definition: DriverClient.hpp:10
exatn::numerics::TensorOpAdd
Definition: tensor_op_add.hpp:21
exatn::Cloneable
Definition: Identifiable.hpp:18
exatn::runtime::TensorNodeExecutor::initialize
virtual void initialize()=0
exatn::numerics::TensorOpDestroy
Definition: tensor_op_destroy.hpp:21
exatn::Identifiable
Definition: Identifiable.hpp:9
exatn::numerics::TensorOpTransform
Definition: tensor_op_transform.hpp:27
exatn::runtime::TensorNodeExecutor::execute
virtual int execute(numerics::TensorOpCreate &op, TensorOpExecHandle *exec_handle)=0
exatn::numerics::TensorOpContract
Definition: tensor_op_contract.hpp:22
exatn::numerics::TensorOpCreate
Definition: tensor_op_create.hpp:21
exatn::runtime::TensorNodeExecutor
Definition: tensor_node_executor.hpp:36