回退 'Pull Request !11074 : replace tdt with acltdt interface'
parent
26d4b99019
commit
7f538b51e7
@ -1,6 +1,5 @@
|
|||||||
file(
|
file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
|
||||||
GLOB_RECURSE _CURRENT_SRC_FILES
|
|
||||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
"*.cc")
|
|
||||||
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)
|
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)
|
||||||
add_library(engine-tdt OBJECT tdt_plugin.cc tdt_handle.cc)
|
add_library(engine-tdt OBJECT
|
||||||
|
tdt_plugin.cc
|
||||||
|
)
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2021 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 "minddata/dataset/engine/tdt/tdt_handle.h"
|
|
||||||
namespace mindspore {
|
|
||||||
namespace dataset {
|
|
||||||
|
|
||||||
std::vector<acltdtChannelHandle *> TdtHandle::acl_handle = std::vector<acltdtChannelHandle *>();
|
|
||||||
|
|
||||||
void TdtHandle::AddHandle(acltdtChannelHandle *handle) {
|
|
||||||
if (handle != nullptr) {
|
|
||||||
acl_handle.emplace_back(handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TdtHandle::DestroyHandle() {
|
|
||||||
for (auto handle : acl_handle) {
|
|
||||||
if (handle != nullptr) {
|
|
||||||
if (acltdtDestroyChannel(handle) != ACL_SUCCESS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} // namespace dataset
|
|
||||||
} // namespace mindspore
|
|
@ -1,38 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright 2021 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.
|
|
||||||
*/
|
|
||||||
#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_TDT_TDT_HANDLE_H_
|
|
||||||
#define MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_TDT_TDT_HANDLE_H_
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <vector>
|
|
||||||
#include "acl/acl_tdt.h"
|
|
||||||
|
|
||||||
namespace mindspore {
|
|
||||||
namespace dataset {
|
|
||||||
class TdtHandle {
|
|
||||||
public:
|
|
||||||
static void AddHandle(acltdtChannelHandle *handle);
|
|
||||||
|
|
||||||
static bool DestroyHandle();
|
|
||||||
|
|
||||||
private:
|
|
||||||
TdtHandle() {}
|
|
||||||
|
|
||||||
static std::vector<acltdtChannelHandle *> acl_handle;
|
|
||||||
};
|
|
||||||
} // namespace dataset
|
|
||||||
} // namespace mindspore
|
|
||||||
#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_TDT_TDT_HANDLE_H_
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue