From 9d0fde29f4bdad550087fd6a7447b50db6c1bf23 Mon Sep 17 00:00:00 2001 From: Jonathan Yan Date: Sat, 4 Apr 2020 06:48:58 -0400 Subject: [PATCH] remove ENABLE_MINDRECORD flag --- mindspore/ccsrc/dataset/CMakeLists.txt | 2 -- mindspore/ccsrc/dataset/api/de_pipeline.cc | 12 +++--------- mindspore/ccsrc/dataset/api/de_pipeline.h | 4 ---- mindspore/ccsrc/dataset/api/python_bindings.cc | 6 ------ .../engine/datasetops/source/mindrecord_op.cc | 3 --- .../dataset/engine/datasetops/source/mindrecord_op.h | 2 -- tests/ut/cpp/CMakeLists.txt | 1 - tests/ut/cpp/dataset/mind_record_op_test.cc | 2 -- 8 files changed, 3 insertions(+), 29 deletions(-) diff --git a/mindspore/ccsrc/dataset/CMakeLists.txt b/mindspore/ccsrc/dataset/CMakeLists.txt index d6791f2b9b..477d37051e 100644 --- a/mindspore/ccsrc/dataset/CMakeLists.txt +++ b/mindspore/ccsrc/dataset/CMakeLists.txt @@ -17,8 +17,6 @@ if (ENABLE_TDTQUE) message(STATUS "TDT queue is enabled") endif () -add_definitions(-D ENABLE_MINDRECORD) - # conde coverage # option(ENABLE_COVERAGE "Enable code coverage report" OFF) # if (ENABLE_COVERAGE) diff --git a/mindspore/ccsrc/dataset/api/de_pipeline.cc b/mindspore/ccsrc/dataset/api/de_pipeline.cc index d51204f659..65ec8d30f2 100644 --- a/mindspore/ccsrc/dataset/api/de_pipeline.cc +++ b/mindspore/ccsrc/dataset/api/de_pipeline.cc @@ -29,11 +29,9 @@ #include "dataset/engine/datasetops/source/manifest_op.h" #include "dataset/engine/datasetops/source/cifar_op.h" #include "dataset/engine/datasetops/source/celeba_op.h" -#ifdef ENABLE_MINDRECORD -#include "./shard_category.h" -#include "./shard_sample.h" -#include "./shard_shuffle.h" -#endif +#include "mindrecord/include/shard_category.h" +#include "mindrecord/include/shard_sample.h" +#include "mindrecord/include/shard_shuffle.h" #include "dataset/util/random.h" #include "dataset/util/status.h" @@ -46,9 +44,7 @@ using pFunction = Status (DEPipeline::*)(const py::dict &, std::shared_ptr g_parse_op_func_ = {{kStorage, &DEPipeline::ParseStorageOp}, {kShuffle, &DEPipeline::ParseShuffleOp}, -#ifdef ENABLE_MINDRECORD {kMindrecord, &DEPipeline::ParseMindRecordOp}, -#endif {kMap, &DEPipeline::ParseMapOp}, {kBatch, &DEPipeline::ParseBatchOp}, {kRepeat, &DEPipeline::ParseRepeatOp}, @@ -364,7 +360,6 @@ Status DEPipeline::ParseShuffleOp(const py::dict &args, std::shared_ptr *in_partitions) { if (args["partitions"].is_none()) { std::string err_msg = "Error: partitions is not set (None)"; @@ -450,7 +445,6 @@ Status DEPipeline::ParseMindRecordOp(const py::dict &args, std::shared_ptr *ptr) { std::shared_ptr builder = std::make_shared(); diff --git a/mindspore/ccsrc/dataset/api/de_pipeline.h b/mindspore/ccsrc/dataset/api/de_pipeline.h index e8dde85a77..acffc390cc 100644 --- a/mindspore/ccsrc/dataset/api/de_pipeline.h +++ b/mindspore/ccsrc/dataset/api/de_pipeline.h @@ -38,9 +38,7 @@ using DsOpPtr = std::shared_ptr; enum OpName { kStorage = 0, kShuffle, -#ifdef ENABLE_MINDRECORD kMindrecord, -#endif kBatch, kCache, kRepeat, @@ -101,11 +99,9 @@ class DEPipeline { Status ParseShuffleOp(const py::dict &args, std::shared_ptr *ptr); -#ifdef ENABLE_MINDRECORD Status CheckMindRecordPartitionInfo(const py::dict &args, std::vector *ptr); Status ParseMindRecordOp(const py::dict &args, std::shared_ptr *ptr); -#endif Status ParseMapOp(const py::dict &args, std::shared_ptr *ptr); diff --git a/mindspore/ccsrc/dataset/api/python_bindings.cc b/mindspore/ccsrc/dataset/api/python_bindings.cc index 86b0a5d66a..e6c2691281 100644 --- a/mindspore/ccsrc/dataset/api/python_bindings.cc +++ b/mindspore/ccsrc/dataset/api/python_bindings.cc @@ -44,9 +44,7 @@ #include "dataset/engine/datasetops/source/io_block.h" #include "dataset/engine/datasetops/source/mnist_op.h" #include "dataset/engine/datasetops/source/manifest_op.h" -#ifdef ENABLE_MINDRECORD #include "dataset/engine/datasetops/source/mindrecord_op.h" -#endif #include "dataset/engine/datasetops/source/sampler/distributed_sampler.h" #include "dataset/engine/datasetops/source/sampler/pk_sampler.h" #include "dataset/engine/datasetops/source/sampler/random_sampler.h" @@ -146,14 +144,12 @@ void bindDatasetOps(py::module *m) { return py::make_tuple(count, num_classes); }); -#ifdef ENABLE_MINDRECORD (void)py::class_>(*m, "MindRecordOp") .def_static("get_num_rows", [](const std::string &path) { int64_t count = 0; THROW_IF_ERROR(MindRecordOp::CountTotalRows(path, &count)); return count; }); -#endif (void)py::class_>(*m, "ManifestOp") .def_static("get_num_rows_and_classes", @@ -424,9 +420,7 @@ PYBIND11_MODULE(_c_dataengine, m) { .value("STORAGE", OpName::kStorage) .value("SHUFFLE", OpName::kShuffle) .value("BATCH", OpName::kBatch) -#ifdef ENABLE_MINDRECORD .value("MINDRECORD", OpName::kMindrecord) -#endif .value("CACHE", OpName::kCache) .value("REPEAT", OpName::kRepeat) .value("TAKE", OpName::kTake) diff --git a/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc b/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc index b062371d7f..b5bea5416c 100644 --- a/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc +++ b/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc @@ -13,8 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifdef ENABLE_MINDRECORD - #include "dataset/engine/datasetops/source/mindrecord_op.h" #include @@ -665,4 +663,3 @@ Status MindRecordOp::CountTotalRows(const std::string dataset_path, int64_t *cou } } // namespace dataset } // namespace mindspore -#endif diff --git a/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.h b/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.h index 2535acbc50..0b16391b20 100644 --- a/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.h +++ b/mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.h @@ -15,7 +15,6 @@ */ #ifndef DATASET_ENGINE_DATASETOPS_SOURCE_MINDRECORD_OP_H_ #define DATASET_ENGINE_DATASETOPS_SOURCE_MINDRECORD_OP_H_ -#ifdef ENABLE_MINDRECORD #pragma once #include @@ -276,5 +275,4 @@ class MindRecordOp : public ParallelOp { }; } // namespace dataset } // namespace mindspore -#endif #endif // DATASET_ENGINE_DATASETOPS_SOURCE_MINDRECORD_OP_H_ diff --git a/tests/ut/cpp/CMakeLists.txt b/tests/ut/cpp/CMakeLists.txt index 5f4bd41b3b..8d3f8a8138 100644 --- a/tests/ut/cpp/CMakeLists.txt +++ b/tests/ut/cpp/CMakeLists.txt @@ -26,7 +26,6 @@ MESSAGE("check ut_test ${CMAKE_BINARY_DIR}") link_directories(${MS_CCSRC_BUILD_PATH}) if(ENABLE_MINDDATA) - add_definitions(-D ENABLE_MINDRECORD) add_definitions(-D ENABLE_MINDDATA) link_directories(${MS_CCSRC_BUILD_PATH}/dataset) link_directories(${MS_CCSRC_BUILD_PATH}/mindrecord) diff --git a/tests/ut/cpp/dataset/mind_record_op_test.cc b/tests/ut/cpp/dataset/mind_record_op_test.cc index abe7faef14..3d5c80b3f4 100644 --- a/tests/ut/cpp/dataset/mind_record_op_test.cc +++ b/tests/ut/cpp/dataset/mind_record_op_test.cc @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifdef ENABLE_MINDRECORD #include #include #include @@ -480,4 +479,3 @@ TEST_F(MindDataTestMindRecordOp, TestMindRecordBlockReaderRepeat) { row_count++; } } -#endif