|
- /**
- * Copyright 2020 Huawei Technologies Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- #include "dynamic_execute_addr.h"
-
- #include "common/ge_inner_error_codes.h"
- #include "common/debug/log.h"
-
- namespace ge {
- DynamicExecuteAddr &DynamicExecuteAddr::GetInstance() {
- static DynamicExecuteAddr instance;
- return instance;
- }
-
- std::map<void *, hybrid::TensorValue>DynamicExecuteAddr::GetTensorValue(uint64_t session_id) {
- auto it = dynamic_execute_dev_addr_.find(session_id);
- return it->second;
- }
-
- void DynamicExecuteAddr::RemoveTensorValue(uint64_t session_id,void * data_dev_addr) {
- auto it = dynamic_execute_dev_addr_.find(session_id);
- if (it != dynamic_execute_dev_addr_.end()) {
- auto tensor_values = it ->second;
- auto tensor_value_it = tensor_values.find(data_dev_addr);
- if (tensor_value_it != tensor_values.end()) {
- tensor_values.erase(tensor_value_it);
- }
- GELOGW("Can not find data device addr");
- }
- GELOGW("Can not find session,session id is %ld",session_id);
- }
-
- } // namespace ge
|