From 27d55e6105e02214cc1f8e460efe40ec09e4c843 Mon Sep 17 00:00:00 2001 From: jiaopu Date: Thu, 9 Apr 2020 19:48:31 +0800 Subject: [PATCH] move sth from device_info to backends/mlu --- lite/backends/mlu/target_wrapper.cc | 4 --- lite/backends/mlu/target_wrapper.h | 2 -- lite/core/device_info.cc | 48 ----------------------------- lite/core/device_info.h | 23 -------------- 4 files changed, 77 deletions(-) diff --git a/lite/backends/mlu/target_wrapper.cc b/lite/backends/mlu/target_wrapper.cc index f5c7eece48..9a41b15885 100644 --- a/lite/backends/mlu/target_wrapper.cc +++ b/lite/backends/mlu/target_wrapper.cc @@ -116,12 +116,8 @@ int TargetWrapperMlu::MLUCoreNumber() { return mlu_core_number_; } bool TargetWrapperMlu::UseFirstConv() { return use_first_conv_; } -// const std::vector& TargetWrapperMlu::MeanVec() const { return -// mean_vec_; } const std::vector& TargetWrapperMlu::MeanVec() { return mean_vec_; } -// const std::vector& TargetWrapperMlu::StdVec() const { return std_vec_; -// } const std::vector& TargetWrapperMlu::StdVec() { return std_vec_; } DataLayoutType TargetWrapperMlu::InputLayout() { return input_layout_; } diff --git a/lite/backends/mlu/target_wrapper.h b/lite/backends/mlu/target_wrapper.h index c1a35a9aa2..da9d3f173b 100644 --- a/lite/backends/mlu/target_wrapper.h +++ b/lite/backends/mlu/target_wrapper.h @@ -53,8 +53,6 @@ class TargetWrapper { static cnmlCoreVersion_t MLUCoreVersion(); static int MLUCoreNumber(); static bool UseFirstConv(); - // static const std::vector& MeanVec() const; - // static const std::vector& StdVec() const; static const std::vector& MeanVec(); static const std::vector& StdVec(); static DataLayoutType InputLayout(); diff --git a/lite/core/device_info.cc b/lite/core/device_info.cc index 6038343689..6d856b9188 100644 --- a/lite/core/device_info.cc +++ b/lite/core/device_info.cc @@ -66,15 +66,6 @@ thread_local std::vector DeviceInfo::active_ids_; thread_local TensorLite DeviceInfo::workspace_; thread_local int64_t DeviceInfo::count_ = 0; -// #ifdef LITE_WITH_MLU -// thread_local cnmlCoreVersion_t DeviceInfo::mlu_core_version_{CNML_MLU270}; -// thread_local int DeviceInfo::mlu_core_number_{1}; -// thread_local bool DeviceInfo::use_first_conv_{false}; -// thread_local std::vector DeviceInfo::mean_vec_; -// thread_local std::vector DeviceInfo::std_vec_; -// thread_local DataLayoutType DeviceInfo::input_layout_{DATALAYOUT(kNCHW)}; -// #endif - #ifdef TARGET_IOS const int DEFAULT_L1_CACHE_SIZE = 64 * 1024; const int DEFAULT_L2_CACHE_SIZE = 2048 * 1024; @@ -1089,45 +1080,6 @@ int DeviceInfo::Setup() { return 0; } -// #ifdef LITE_WITH_MLU -// void DeviceInfo::SetMLURunMode(lite_api::MLUCoreVersion core_version, -// int core_number, -// bool use_first_conv, -// const std::vector& mean_vec, -// const std::vector& std_vec, -// DataLayoutType input_layout) { -// switch (core_version) { -// case (lite_api::MLUCoreVersion::MLU_220): -// mlu_core_version_ = CNML_MLU220; -// break; -// case (lite_api::MLUCoreVersion::MLU_270): -// mlu_core_version_ = CNML_MLU270; -// break; -// default: -// mlu_core_version_ = CNML_MLU270; -// break; -// } -// mlu_core_number_ = core_number; -// use_first_conv_ = use_first_conv; -// mean_vec_ = mean_vec; -// std_vec_ = std_vec; -// input_layout_ = input_layout; -// } -// -// cnmlCoreVersion_t DeviceInfo::MLUCoreVersion() { return mlu_core_version_; } -// -// int DeviceInfo::MLUCoreNumber() { return mlu_core_number_; } -// -// bool DeviceInfo::UseFirstConv() { return use_first_conv_; } -// -// const std::vector& DeviceInfo::MeanVec() const { return mean_vec_; } -// -// const std::vector& DeviceInfo::StdVec() const { return std_vec_; } -// -// DataLayoutType DeviceInfo::InputLayout() const { return input_layout_; } -// -// #endif // LITE_WITH_MLU - void DeviceInfo::SetRunMode(lite_api::PowerMode mode, int thread_num) { #ifdef ARM_WITH_OMP thread_num = std::min(thread_num, core_num_); diff --git a/lite/core/device_info.h b/lite/core/device_info.h index ae2e1fa551..5f5c4259e9 100644 --- a/lite/core/device_info.h +++ b/lite/core/device_info.h @@ -55,20 +55,6 @@ class DeviceInfo { int Setup(); void SetRunMode(lite_api::PowerMode mode, int thread_num); - // #ifdef LITE_WITH_MLU - // void SetMLURunMode(lite_api::MLUCoreVersion core_version, - // int core_number, - // bool use_first_conv, - // const std::vector& mean_vec, - // const std::vector& std_vec, - // DataLayoutType input_layout); - // cnmlCoreVersion_t MLUCoreVersion(); - // int MLUCoreNumber(); - // bool UseFirstConv(); - // const std::vector& MeanVec() const; - // const std::vector& StdVec() const; - // DataLayoutType InputLayout() const; - // #endif void SetCache(int l1size, int l2size, int l3size); void SetArch(ARMArch arch) { arch_ = arch; } @@ -120,15 +106,6 @@ class DeviceInfo { static thread_local TensorLite workspace_; static thread_local int64_t count_; - // #ifdef LITE_WITH_MLU - // static thread_local cnmlCoreVersion_t mlu_core_version_; - // static thread_local int mlu_core_number_; - // static thread_local bool use_first_conv_; - // static thread_local std::vector mean_vec_; - // static thread_local std::vector std_vec_; - // static thread_local DataLayoutType input_layout_; - // #endif - void SetDotInfo(int argc, ...); void SetFP16Info(int argc, ...); void SetFP32Info(int argc, ...); -- GitLab