1 /** 2 * Copyright 2024 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef MINDSPORE_MINDSPORE_CCSRC_RUNTIME_PIPELINE_PIPELINE_H_ 17 #define MINDSPORE_MINDSPORE_CCSRC_RUNTIME_PIPELINE_PIPELINE_H_ 18 19 #include "utils/ms_utils.h" 20 #include "include/backend/visible.h" 21 #include "runtime/pipeline/async_rqueue.h" 22 23 namespace mindspore { 24 namespace runtime { 25 class BACKEND_EXPORT Pipeline { 26 public: 27 static Pipeline &Get(); 28 frontend_stage()29 const AsyncRQueuePtr &frontend_stage() const { return frontend_stage_; } backend_stage()30 const AsyncRQueuePtr &backend_stage() const { return backend_stage_; } launch_stage()31 const AsyncRQueuePtr &launch_stage() const { return launch_stage_; } 32 33 private: 34 Pipeline(); 35 ~Pipeline() = default; 36 DISABLE_COPY_AND_ASSIGN(Pipeline); 37 38 // Infer and create output tensor. 39 AsyncRQueuePtr frontend_stage_; 40 // Malloc and free. 41 AsyncRQueuePtr backend_stage_; 42 // Launch kernel. 43 AsyncRQueuePtr launch_stage_; 44 }; 45 } // namespace runtime 46 } // namespace mindspore 47 #endif // MINDSPORE_MINDSPORE_CCSRC_RUNTIME_PIPELINE_PIPELINE_H_ 48