11 #ifndef EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_
12 #define EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_
14 #include "tensor_node_executor.hpp"
16 #include "talshxx.hpp"
18 #include <unordered_map>
39 TensorOpExecHandle * exec_handle)
override;
41 TensorOpExecHandle * exec_handle)
override;
43 TensorOpExecHandle * exec_handle)
override;
45 TensorOpExecHandle * exec_handle)
override;
47 TensorOpExecHandle * exec_handle)
override;
49 bool sync(TensorOpExecHandle op_handle,
51 bool wait =
false)
override;
54 const std::vector<std::pair<DimOffset,DimExtent>> & slice_spec)
override;
56 const std::string name()
const override {
return "talsh-node-executor";}
57 const std::string description()
const override {
return "TALSH tensor graph node executor";}
58 std::shared_ptr<TensorNodeExecutor> clone()
override {
return std::make_shared<TalshNodeExecutor>();}
62 std::unordered_map<numerics::TensorHashType,std::shared_ptr<talsh::Tensor>>
tensors_;
64 std::unordered_map<TensorOpExecHandle,std::shared_ptr<talsh::TensorTask>>
tasks_;
73 inline int get_talsh_tensor_element_kind(TensorElementType element_type)
75 int talsh_data_kind = NO_TYPE;
77 case TensorElementType::REAL32: talsh_data_kind = R4;
break;
78 case TensorElementType::REAL64: talsh_data_kind = R8;
break;
79 case TensorElementType::COMPLEX32: talsh_data_kind = C4;
break;
80 case TensorElementType::COMPLEX64: talsh_data_kind = C8;
break;
82 return talsh_data_kind;
86 inline TensorElementType get_exatn_tensor_element_kind(
int element_type)
89 case R4:
return TensorElementType::REAL32;
90 case R8:
return TensorElementType::REAL64;
91 case C4:
return TensorElementType::COMPLEX32;
92 case C8:
return TensorElementType::COMPLEX64;
94 return TensorElementType::VOID;
100 #endif //EXATN_RUNTIME_TALSH_NODE_EXECUTOR_HPP_