From 1f13b3ef6de2e553023f830b1b255e5f25a1973f Mon Sep 17 00:00:00 2001 From: ervinzhang Date: Tue, 4 Aug 2020 14:15:05 -0400 Subject: [PATCH] exclude de_tensor in normal build --- mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt | 2 -- mindspore/ccsrc/minddata/dataset/core/tensor.h | 7 ++++++- mindspore/ccsrc/minddata/dataset/include/tensor.h | 7 ++++++- mindspore/lite/CMakeLists.txt | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt b/mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt index 93de69aad24..ae0b9cc28ed 100644 --- a/mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt +++ b/mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt @@ -13,6 +13,4 @@ add_library(cpp-API OBJECT iterator.cc transforms.cc samplers.cc - de_tensor.cc - execute.cc ) diff --git a/mindspore/ccsrc/minddata/dataset/core/tensor.h b/mindspore/ccsrc/minddata/dataset/core/tensor.h index 89c69e318bd..85ed96215df 100644 --- a/mindspore/ccsrc/minddata/dataset/core/tensor.h +++ b/mindspore/ccsrc/minddata/dataset/core/tensor.h @@ -38,18 +38,21 @@ #include "minddata/dataset/core/data_type.h" #include "minddata/dataset/core/tensor_shape.h" #include "minddata/dataset/util/status.h" -#include "minddata/dataset/include/de_tensor.h" #ifndef ENABLE_ANDROID #include "proto/example.pb.h" +#else +#include "minddata/dataset/include/de_tensor.h" #endif #ifdef ENABLE_PYTHON namespace py = pybind11; #endif namespace mindspore { +#ifdef ENABLE_ANDROID namespace tensor { class DETensor; } // namespace tensor +#endif namespace dataset { class Tensor; template @@ -61,7 +64,9 @@ using offset_t = uint32_t; // type of offset va using TensorPtr = std::shared_ptr; class Tensor { +#ifdef ENABLE_ANDROID friend class tensor::DETensor; +#endif public: Tensor() = delete; Tensor(const Tensor &other) = delete; diff --git a/mindspore/ccsrc/minddata/dataset/include/tensor.h b/mindspore/ccsrc/minddata/dataset/include/tensor.h index 89c69e318bd..85ed96215df 100644 --- a/mindspore/ccsrc/minddata/dataset/include/tensor.h +++ b/mindspore/ccsrc/minddata/dataset/include/tensor.h @@ -38,18 +38,21 @@ #include "minddata/dataset/core/data_type.h" #include "minddata/dataset/core/tensor_shape.h" #include "minddata/dataset/util/status.h" -#include "minddata/dataset/include/de_tensor.h" #ifndef ENABLE_ANDROID #include "proto/example.pb.h" +#else +#include "minddata/dataset/include/de_tensor.h" #endif #ifdef ENABLE_PYTHON namespace py = pybind11; #endif namespace mindspore { +#ifdef ENABLE_ANDROID namespace tensor { class DETensor; } // namespace tensor +#endif namespace dataset { class Tensor; template @@ -61,7 +64,9 @@ using offset_t = uint32_t; // type of offset va using TensorPtr = std::shared_ptr; class Tensor { +#ifdef ENABLE_ANDROID friend class tensor::DETensor; +#endif public: Tensor() = delete; Tensor(const Tensor &other) = delete; diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index cf48032b2d0..1a7e4d15885 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -138,7 +138,6 @@ if (BUILD_MINDDATA) include_directories(${TOP_DIR}/third_party/libjpeg-turbo/include) add_compile_definitions(ENABLE_ANDROID) - add_compile_definitions(ENABLE_EAGER) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/minddata) endif()