• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2019-2020 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 
17 #ifndef MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_GE_RUNTIME_MODEL_CONTEXT_H_
18 #define MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_GE_RUNTIME_MODEL_CONTEXT_H_
19 
20 #include <vector>
21 #include "runtime/rt_model.h"
22 
23 namespace mindspore::ge::model_runner {
24 class ModelContext {
25  public:
ModelContext(uint32_t device_id,uint64_t session_id,int32_t priority,rtModel_t rt_model_handle,rtStream_t rt_model_stream,const std::vector<rtStream_t> & stream_list,const std::vector<rtLabel_t> & label_list,const std::vector<rtEvent_t> & event_list)26   ModelContext(uint32_t device_id, uint64_t session_id, int32_t priority, rtModel_t rt_model_handle,
27                rtStream_t rt_model_stream, const std::vector<rtStream_t> &stream_list,
28                const std::vector<rtLabel_t> &label_list, const std::vector<rtEvent_t> &event_list)
29       : device_id_(device_id),
30         session_id_(session_id),
31         priority_(priority),
32         rt_model_handle_(rt_model_handle),
33         rt_model_stream_(rt_model_stream),
34         stream_list_(stream_list),
35         label_list_(label_list),
36         event_list_(event_list) {}
~ModelContext()37   ~ModelContext() {}
38 
device_id()39   uint64_t device_id() const { return device_id_; }
session_id()40   uint64_t session_id() const { return session_id_; }
priority()41   int32_t priority() const { return priority_; }
rt_model_handle()42   const rtModel_t &rt_model_handle() const { return rt_model_handle_; }
rt_model_stream()43   const rtStream_t &rt_model_stream() const { return rt_model_stream_; }
stream_list()44   const std::vector<rtStream_t> &stream_list() const { return stream_list_; }
label_list()45   const std::vector<rtLabel_t> &label_list() const { return label_list_; }
event_list()46   const std::vector<rtEvent_t> &event_list() const { return event_list_; }
47 
48  private:
49   uint32_t device_id_;
50   uint64_t session_id_;
51   int32_t priority_;
52   rtModel_t rt_model_handle_;
53   rtStream_t rt_model_stream_;
54   std::vector<rtStream_t> stream_list_;
55   std::vector<rtLabel_t> label_list_;
56   std::vector<rtEvent_t> event_list_;
57 };
58 }  // namespace mindspore::ge::model_runner
59 #endif  // MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_GE_RUNTIME_MODEL_CONTEXT_H_
60