/third_party/mindspore/mindspore/lite/src/ |
D | lite_kernel_util.h | 27 …static std::vector<kernel::LiteKernel *> SubgraphInputNodes(const std::vector<kernel::LiteKernel *… 28 …static std::vector<kernel::LiteKernel *> SubgraphOutputNodes(const std::vector<kernel::LiteKernel … 29 …static std::vector<lite::Tensor *> SubgraphInputTensors(const std::vector<kernel::LiteKernel *> &k… 30 …static std::vector<lite::Tensor *> SubgraphOutputTensors(const std::vector<kernel::LiteKernel *> &… 31 static int TopologicalSortKernels(std::vector<kernel::LiteKernel *> *kernels); 32 static void InitTensorInitRefCount(const std::vector<kernel::LiteKernel *> &kernels); 33 static int SetInput(const LiteKernel &kernelMod, const std::vector<lite::Tensor *> &inputs); 35 static bool IsSwitchCall(kernel::LiteKernel *kernel); 37 static kernel::LiteKernel *GetInputsSpecificNode(const kernel::LiteKernel *kernel, 39 …static bool InputsContainsSpecificNode(const kernel::LiteKernel *kernel, const schema::PrimitiveTy… [all …]
|
D | scheduler.h | 58 int Schedule(std::vector<kernel::LiteKernel *> *dst_kernels); 63 int CheckInputParam(std::vector<kernel::LiteKernel *> *dst_kernels); 72 …int HandleBuildinCpuKernelWeight(kernel::SubGraphType belong_subgraph_type, kernel::LiteKernel *ke… 73 kernel::LiteKernel *FindBackendKernel(const std::vector<Tensor *> &in_tensors, 78 kernel::LiteKernel **kernel); 79 int CheckCpuValid(std::vector<kernel::LiteKernel *> *dst_kernels); 84 … OpParameter *op_parameter, const kernel::KernelKey &desc, kernel::LiteKernel **kernel, 88 … const LiteGraph::Node *node, TypeId data_type, kernel::LiteKernel **kernel); 90 int InitKernels(std::vector<kernel::LiteKernel *> dst_kernels); 91 kernel::LiteKernel *SchedulePartialToKernel(const lite::LiteGraph::Node *src_node); [all …]
|
D | lite_kernel_util.cc | 27 std::set<lite::Tensor *> LiteKernelUtil::AllOutTensor(const std::vector<kernel::LiteKernel *> &kern… in AllOutTensor() 37 std::vector<kernel::LiteKernel *> LiteKernelUtil::SubgraphInputNodes(const std::vector<kernel::Lite… in SubgraphInputNodes() 38 std::vector<kernel::LiteKernel *> input_nodes; in SubgraphInputNodes() 61 std::vector<kernel::LiteKernel *> LiteKernelUtil::SubgraphOutputNodes( in SubgraphOutputNodes() 62 const std::vector<kernel::LiteKernel *> &kernels) { in SubgraphOutputNodes() 63 std::set<kernel::LiteKernel *> all_kernels{}; in SubgraphOutputNodes() 67 std::vector<kernel::LiteKernel *> output_nodes; in SubgraphOutputNodes() 78 … [&all_kernels](kernel::LiteKernel *tmp) { return all_kernels.find(tmp) == all_kernels.end(); }) && in SubgraphOutputNodes() 86 …:Tensor *> LiteKernelUtil::SubgraphInputTensors(const std::vector<kernel::LiteKernel *> &kernels) { in SubgraphInputTensors() 88 std::vector<kernel::LiteKernel *> input_nodes = SubgraphInputNodes(kernels); in SubgraphInputTensors() [all …]
|
D | sub_graph_kernel.h | 60 class SubGraphKernel : public LiteKernel { 62 SubGraphKernel(std::vector<LiteKernel *> in_kernels, std::vector<LiteKernel *> out_kernels, in SubGraphKernel() 63 std::vector<LiteKernel *> nodes, Kernel *kernel) in SubGraphKernel() 64 : LiteKernel(std::shared_ptr<Kernel>(kernel)), in SubGraphKernel() 81 [&](LiteKernel *kernel) { return kernel->IsReady(scope_tensors); }); in IsReady() 94 void InitOutTensorInitRefCount(const std::vector<LiteKernel *> *mask_kernels) override; 102 std::vector<LiteKernel *> &nodes() { return this->nodes_; } in nodes() 104 void DropNode(LiteKernel *node); 106 std::vector<LiteKernel *> in_nodes() { return this->in_nodes_; } in in_nodes() 108 std::vector<LiteKernel *> out_nodes() { return this->out_nodes_; } in out_nodes() [all …]
|
D | lite_mindrt.h | 46 …explicit LiteOpActor(kernel::LiteKernel *kernel) : OpActor<lite::Tensor>(kernel->name()), kernel_(… in LiteOpActor() 78 void SetSubgraphAIDMap(const std::unordered_map<kernel::LiteKernel *, AID> &partial_map) { in SetSubgraphAIDMap() argument 91 kernel::LiteKernel *kernel_; 93 std::unordered_map<kernel::LiteKernel *, AID> subgraph_to_actor_{}; 99 void ReplaceNodeInTensor(kernel::LiteKernel *kernel, Tensor *old_tensor, Tensor *new_tensor); 113 kernel::LiteKernel *partial_node_ = nullptr; 114 kernel::LiteKernel *call_node_ = nullptr; 123 explicit LiteSwitchOpActor(kernel::LiteKernel *kernel) : LiteOpActor(kernel) {} in LiteSwitchOpActor() 148 kernel::LiteKernel *true_partial_node_ = nullptr; 149 kernel::LiteKernel *false_partial_node_ = nullptr; [all …]
|
D | scheduler.cc | 67 kernel::SubGraphKernel *CreateCustomSubGraph(std::vector<kernel::LiteKernel *> &&input_kernels, in CreateCustomSubGraph() 68 std::vector<kernel::LiteKernel *> &&output_kernels, in CreateCustomSubGraph() 69 … const std::vector<kernel::LiteKernel *> &kernels, kernel::Kernel *kernel) { in CreateCustomSubGraph() 123 int CastKernelWeight(kernel::SubGraphType belong_subgraph_type, kernel::LiteKernel *kernel, bool su… in CastKernelWeight() 191 …ndleBuildinCpuKernelWeight(kernel::SubGraphType belong_subgraph_type, kernel::LiteKernel *kernel) { in HandleBuildinCpuKernelWeight() 214 int Scheduler::InitKernels(std::vector<kernel::LiteKernel *> dst_kernels) { in InitKernels() 268 int Scheduler::CheckCpuValid(std::vector<kernel::LiteKernel *> *dst_kernels) { in CheckCpuValid() 281 int Scheduler::Schedule(std::vector<kernel::LiteKernel *> *dst_kernels) { in Schedule() 335 std::map<const kernel::LiteKernel *, bool> is_kernel_finish; in Schedule() 361 …std::vector<kernel ::LiteKernel *> kernel_list = reinterpret_cast<kernel::SubGraphKernel *>(subgra… in Schedule() [all …]
|
D | lite_kernel.cc | 27 bool LiteKernel::IsReady(const std::vector<lite::Tensor *> &scope_tensors) { in IsReady() 39 void LiteKernel::InitOutTensorInitRefCount(const std::vector<LiteKernel *> *mask_kernels) { in InitOutTensorInitRefCount() 56 std::string LiteKernel::ToString() const { in ToString() 79 int LiteKernel::DoExecute() { in DoExecute()
|
D | lite_kernel.h | 79 class LiteKernel { 81 LiteKernel() { in LiteKernel() function 86 explicit LiteKernel(std::shared_ptr<Kernel> kernel) : kernel_(kernel) { in LiteKernel() function 91 virtual ~LiteKernel() = default; 300 void AddInKernel(LiteKernel *kernel) { in AddInKernel() 306 void AddOutKernel(LiteKernel *kernel) { in AddOutKernel() 312 void set_in_kernels(const std::vector<LiteKernel *> &kernel) { this->in_kernels_ = kernel; } in set_in_kernels() 314 void set_out_kernels(const std::vector<LiteKernel *> &kernel) { this->out_kernels_ = kernel; } in set_out_kernels() 316 const std::vector<LiteKernel *> &in_kernels() const { return this->in_kernels_; } in in_kernels() 318 const std::vector<LiteKernel *> &out_kernels() const { return this->out_kernels_; } in out_kernels() [all …]
|
D | mindrt_executor.h | 35 int Prepare(const std::vector<kernel::LiteKernel *> &kernels, const std::vector<Tensor *> &inputs, 39 const std::vector<kernel::LiteKernel *> &kernels, const KernelCallBack &before = nullptr, 50 …int PrepareInputData(const std::vector<kernel::LiteKernel *> &kernels, const std::vector<Tensor *>… 51 …int PrepareOutputData(const std::vector<kernel::LiteKernel *> &kernels, const std::vector<Tensor *…
|
D | lite_session.h | 86 const std::vector<kernel::LiteKernel *> &get_kernels() const { return this->kernels_; } in get_kernels() 120 int SetAllocatorForDelegateKernels(const kernel::LiteKernel *kernel); 124 static int ReSizeKernels(const std::vector<kernel::LiteKernel *> &kernels); 126 static void FreePackOpWeight(const std::vector<kernel::LiteKernel *> &kernels); 133 bool IsIsolatedSubGraph(kernel::LiteKernel *kernel); 138 std::vector<kernel::LiteKernel *> kernels_;
|
D | mindrt_executor.cc | 25 int MindrtExecutor::PrepareInputData(const std::vector<kernel::LiteKernel *> &kernels, in PrepareInputData() 50 int MindrtExecutor::PrepareOutputData(const std::vector<kernel::LiteKernel *> &kernels, in PrepareOutputData() 95 int MindrtExecutor::Prepare(const std::vector<kernel::LiteKernel *> &kernels, const std::vector<Ten… in Prepare() 172 … const std::vector<kernel::LiteKernel *> &kernels, const KernelCallBack &before, in Run()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/ |
D | opencl_fusion.cc | 57 inline bool PredIs(const LiteKernel *node, PrimitiveType type, std::vector<LiteKernel *> *nodes) { in PredIs() 60 LiteKernel *pred = node->in_kernels().front(); in PredIs() 70 inline std::string GetTypeName(const LiteKernel *node) { in GetTypeName() 79 inline bool NC_N11C(const LiteKernel *node) { in NC_N11C() 93 inline bool N11C_NC(const LiteKernel *node) { in N11C_NC() 107 inline bool NC11_NC(const LiteKernel *node) { in NC11_NC() 133 void Merge(LiteKernel *a, LiteKernel *b, bool remove_a) { in Merge() 142 pred_out_kernels.begin(), pred_out_kernels.end(), [&](LiteKernel *x) { return x == a; }, b); in Merge() 185 succ_in_kernels.begin(), succ_in_kernels.end(), [&](LiteKernel *x) { return x == b; }, a); in Merge() 191 inline void MergeRemoveA(LiteKernel *a, LiteKernel *b, std::set<LiteKernel *> *removed_set, in MergeRemoveA() [all …]
|
D | opencl_subgraph.h | 31 OpenCLSubGraph(const std::vector<kernel::LiteKernel *> &inKernels, in OpenCLSubGraph() 32 …const std::vector<kernel::LiteKernel *> &outKernels, const std::vector<kernel::LiteKernel *> &node… in OpenCLSubGraph() 45 …all_kernels_infer_done_ = std::all_of(nodes_.begin(), nodes_.end(), [](const kernel::LiteKernel *k… in OpenCLSubGraph() 62 … const std::vector<kernel::LiteKernel *> &in_kernels, lite::Tensor *new_tensor, 63 … kernel::LiteKernel *in_convert_op, lite::opencl::MemType mem_type); 66 const std::vector<std::vector<kernel::LiteKernel *>> &in_kernels, 68 std::vector<LiteKernel *> *out_convert_ops, lite::opencl::MemType mem_type); 70 const std::vector<kernel::LiteKernel *> &in_kernels, 71 … std::vector<std::vector<kernel::LiteKernel *>> *out_kernels, bool is_from); 85 std::vector<LiteKernel *> in_convert_ops_; [all …]
|
D | opencl_subgraph.cc | 39 … const std::vector<kernel::LiteKernel *> &in_kernels, in ReplaceOutTensorAndKernelToConvert() 40 … lite::Tensor *new_tensor, kernel::LiteKernel *in_convert_op, in ReplaceOutTensorAndKernelToConvert() 47 …auto fk = std::find_if(kernels.begin(), kernels.end(), [&](kernel::LiteKernel *kv) { return kv == … in ReplaceOutTensorAndKernelToConvert() 73 const std::vector<std::vector<kernel::LiteKernel *>> &in_kernels, in GenToFormatOp() 76 std::vector<LiteKernel *> *out_convert_ops, MemType mem_type) { in GenToFormatOp() 83 std::vector<std::vector<kernel::LiteKernel *>> loop_kernels; in GenToFormatOp() 135 auto *in_convert_op = new (std::nothrow) kernel::LiteKernel(inner_convert_op); in GenToFormatOp() 170 std::vector<std::vector<kernel::LiteKernel *>> from_kernels_; in InsertOpsPass() 179 std::vector<std::vector<kernel::LiteKernel *>> to_kernels_; in InsertOpsPass() 260 const std::vector<kernel::LiteKernel *> &in_kernels, in GetKernelFromToTensor() [all …]
|
/third_party/mindspore/mindspore/lite/src/runtime/ |
D | runtime_pass.cc | 25 void Nc4hw4PassReplace(std::vector<kernel::LiteKernel *> *kernels, std::vector<Tensor *> *tensors, … in Nc4hw4PassReplace() 26 kernel::LiteKernel *conv_kernel = kernels->at(index); in Nc4hw4PassReplace() 27 kernel::LiteKernel *transpose_kernel = conv_kernel->out_kernels().front(); in Nc4hw4PassReplace() 28 kernel::LiteKernel *c4_kernel = transpose_kernel->out_kernels().front(); in Nc4hw4PassReplace() 29 kernel::LiteKernel *transpose2_kernel = c4_kernel->out_kernels().front(); in Nc4hw4PassReplace() 30 std::vector<kernel::LiteKernel *> end_kernels = transpose2_kernel->out_kernels(); in Nc4hw4PassReplace() 87 bool Nc4hw4PassMatch(std::vector<kernel::LiteKernel *> *kernels, size_t index) { in Nc4hw4PassMatch() 88 kernel::LiteKernel *start_kernel = kernels->at(index); in Nc4hw4PassMatch() 100 kernel::LiteKernel *traspose_nhwc2nchw_kernel = start_kernel->out_kernels().front(); in Nc4hw4PassMatch() 108 kernel::LiteKernel *end_kernel = traspose_nhwc2nchw_kernel->out_kernels().front(); in Nc4hw4PassMatch() [all …]
|
/third_party/mindspore/mindspore/lite/src/train/ |
D | train_session.h | 102 int FindUseInTensorKernel(std::vector<kernel::LiteKernel *> *use_in_tensor_kernels, 104 const std::vector<kernel::LiteKernel *> &inference_kernels); 105 int FindExportKernels(std::vector<kernel::LiteKernel *> *export_kernels, 107 const std::vector<kernel::LiteKernel *> &inference_kernels); 111 bool IsLossKernel(const kernel::LiteKernel *kernel) const; 112 bool IsGradKernel(const kernel::LiteKernel *kernel) const; 113 bool IsOptimizer(kernel::LiteKernel *kernel) const; 114 bool IsMaskOutput(kernel::LiteKernel *kernel) const; 115 bool IsBN(kernel::LiteKernel *kernel) const; 139 std::vector<kernel::LiteKernel *> inference_kernels_; [all …]
|
D | train_utils.h | 27 class LiteKernel; variable 31 kernel::LiteKernel *TSFindKernel(const std::vector<kernel::LiteKernel *> &where, const std::string … 34 kernel::LiteKernel *TSFindKernel(const std::vector<kernel::LiteKernel *> &where, const std::string …
|
D | train_export.h | 42 int ExportNet(const std::vector<mindspore::kernel::LiteKernel *> &kernels, 63 Model::Node *FindNode(const mindspore::kernel::LiteKernel *kernel, const Model *model); 65 std::unique_ptr<schema::CNodeT> CreateCNode(const mindspore::kernel::LiteKernel *kernel, 69 …int CreateAndAddCNode(const mindspore::kernel::LiteKernel *kernel, std::vector<uint32_t> inputInde… 78 mindspore::schema::QuantType GetNodeQuantType(const mindspore::kernel::LiteKernel *kernel);
|
D | train_session.cc | 175 int TrainSession::AllocTensors(const std::vector<kernel::LiteKernel *> &kernels) { in AllocTensors() 281 const std::vector<kernel::LiteKernel *> &run_kernels) { in ExecKernels() 327 bool TrainSession::AllInputsNeedScale(kernel::LiteKernel *kernel) { in AllInputsNeedScale() 345 int TrainSession::MixPrecisionPreProcess(kernel::LiteKernel *kernel, float scale) { in MixPrecisionPreProcess() 364 int TrainSession::MixPrecisionPostProcess(kernel::LiteKernel *kernel) { in MixPrecisionPostProcess() 391 const std::vector<kernel::LiteKernel *> &run_kernels) { in MixPrecisionExecKernels() 604 …ainSession::BuildInferenceKernelsRecursive(kernel::LiteKernel *kernel, std::vector<kernel::LiteKer… in BuildInferenceKernelsRecursive() 882 bool TrainSession::IsLossKernel(const kernel::LiteKernel *kernel) const { in IsLossKernel() 892 bool TrainSession::IsGradKernel(const kernel::LiteKernel *kernel) const { in IsGradKernel() 896 bool TrainSession::IsOptimizer(kernel::LiteKernel *kernel) const { in IsOptimizer() [all …]
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/ |
D | runtime_pass_tests.cc | 24 extern void Nc4hw4PassAct(std::vector<kernel::LiteKernel *> *kernels, std::vector<Tensor *> *tensor… 25 extern void ConvNormC4PassAct(std::vector<kernel::LiteKernel *> *kernels); 33 void Nc4hw4PassConstruct(std::vector<kernel::LiteKernel *> *kernels, std::vector<lite::Tensor *> *t… in Nc4hw4PassConstruct() 50 kernel::LiteKernel *conv_kernel = nullptr; in Nc4hw4PassConstruct() 61 kernel::LiteKernel *trans_kernel = nullptr; in Nc4hw4PassConstruct() 74 kernel::LiteKernel *in_kernel = nullptr; in Nc4hw4PassConstruct() 87 kernel::LiteKernel *trans2_kernel = nullptr; in Nc4hw4PassConstruct() 104 kernel::LiteKernel *conv2_kernel = nullptr; in Nc4hw4PassConstruct() 119 void ConvNormC4PassConstruct(std::vector<kernel::LiteKernel *> *kernels, std::vector<lite::Tensor *… in ConvNormC4PassConstruct() 136 kernel::LiteKernel *conv1_kernel = nullptr; in ConvNormC4PassConstruct() [all …]
|
/third_party/mindspore/mindspore/lite/test/ut/src/ |
D | utils_test.cc | 36 auto kernel0 = std::make_shared<kernel::LiteKernel>(); in TEST_F() 37 auto kernel1 = std::make_shared<kernel::LiteKernel>(); in TEST_F() 38 auto kernel2 = std::make_shared<kernel::LiteKernel>(); in TEST_F() 58 std::vector<kernel::LiteKernel *> kernels = {kernel0.get(), kernel1.get(), kernel2.get()}; in TEST_F()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/base/ |
D | partial_fusion.h | 34 void set_subgraph_kernel(LiteKernel *subgraph_kernel) { subgraph_kernel_ = subgraph_kernel; } in set_subgraph_kernel() 35 LiteKernel *subgraph_kernel() { return subgraph_kernel_; } in subgraph_kernel() 38 LiteKernel *subgraph_kernel_ = nullptr;
|
/third_party/mindspore/mindspore/lite/src/runtime/gpu/opencl/ |
D | opencl_executor.h | 34 int Prepare(const std::vector<kernel::LiteKernel *> &kernels, const std::vector<Tensor *> &inputs, in Prepare() 40 const std::vector<kernel::LiteKernel *> &kernels, const KernelCallBack &before = nullptr, 43 … const std::vector<kernel::LiteKernel *> &kernels, const KernelCallBack &before = nullptr,
|
/third_party/mindspore/mindspore/lite/test/st/ |
D | mindrt_parallel_test.cc | 42 std::vector<kernel::LiteKernel *> nodes0 = subgraph0->nodes(); in CheckOffline1() 52 std::vector<kernel::LiteKernel *> nodes1 = subgraph1->nodes(); in CheckOffline1() 64 std::vector<kernel::LiteKernel *> nodes2 = subgraph2->nodes(); in CheckOffline1() 76 std::vector<kernel::LiteKernel *> nodes3 = subgraph3->nodes(); in CheckOffline1()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/opencl/ |
D | fill_tests.cc | 68 auto *fill_kernel = new (std::nothrow) kernel::LiteKernel(inner_kernel); in TEST_F() 76 std::vector<kernel::LiteKernel *> kernels{fill_kernel}; in TEST_F() 138 auto *fill_kernel = new (std::nothrow) kernel::LiteKernel(inner_kernel); in TEST_F() 146 std::vector<kernel::LiteKernel *> kernels{fill_kernel}; in TEST_F()
|