From 9082d46ff0eff4c7776780db1b8a2996864b5196 Mon Sep 17 00:00:00 2001 From: wilfChen Date: Tue, 14 Sep 2021 14:10:20 +0800 Subject: [PATCH] remove useless code --- include/api/context.h | 10 +++++++--- mindspore/ccsrc/cxx_api/context.cc | 10 ---------- mindspore/lite/src/cxx_api/context.cc | 6 ------ 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/api/context.h b/include/api/context.h index 1c4e93d2192..10f5eea2671 100644 --- a/include/api/context.h +++ b/include/api/context.h @@ -227,10 +227,14 @@ class MS_API GPUDeviceInfo : public DeviceInfoContext { /// \return The device id. uint32_t GetDeviceID() const; - void SetGpuTrtInferMode(bool gpu_trt_infer_mode); - bool GetGpuTrtInferMode() const; + /// \brief Set the precision mode. + /// + /// \param[in] precision_mode Optional "origin", "fp16". "origin" is set as default. + inline void SetPrecisionMode(const std::string &precision_mode); - inline void SetPrecisionMode(const std::string &precison_mode); + /// \brief Get the precision mode. + /// + /// \return The precision mode. inline std::string GetPrecisionMode() const; /// \brief Set enables to perform the float16 inference diff --git a/mindspore/ccsrc/cxx_api/context.cc b/mindspore/ccsrc/cxx_api/context.cc index c74570dddcb..7b62f4a3371 100644 --- a/mindspore/ccsrc/cxx_api/context.cc +++ b/mindspore/ccsrc/cxx_api/context.cc @@ -25,7 +25,6 @@ constexpr auto kModelOptionGPUEnableFP16 = "mindspore.option.gpu.enable_fp16"; constexpr auto kModelOptionKirinNpuFrequency = "mindspore.option.kirin_npu.frequency"; constexpr auto kModelOptionDeviceID = "mindspore.option.device_id"; constexpr auto kModelOptionGPUDeviceID = kModelOptionDeviceID; -constexpr auto kModelOptionGPUTrtInferMode = "mindspore.option.gpu.trt_infer_mode"; constexpr auto kModelOptionGPUPrecisionMode = "mindspore.option.gpu.precision_mode"; constexpr auto kModelOptionAscend910DeviceID = kModelOptionDeviceID; constexpr auto kModelOptionAscend310DeviceID = kModelOptionDeviceID; @@ -155,15 +154,6 @@ uint32_t GPUDeviceInfo::GetDeviceID() const { return GetValue(data_, kModelOptionGPUDeviceID); } -void GPUDeviceInfo::SetGpuTrtInferMode(bool gpu_trt_infer_mode) { - MS_EXCEPTION_IF_NULL(data_); - data_->params[kModelOptionGPUTrtInferMode] = gpu_trt_infer_mode; -} -bool GPUDeviceInfo::GetGpuTrtInferMode() const { - MS_EXCEPTION_IF_NULL(data_); - return GetValue(data_, kModelOptionGPUTrtInferMode); -} - void GPUDeviceInfo::SetPrecisionMode(const std::vector &precision_mode) { MS_EXCEPTION_IF_NULL(data_); data_->params[kModelOptionGPUPrecisionMode] = CharToString(precision_mode); diff --git a/mindspore/lite/src/cxx_api/context.cc b/mindspore/lite/src/cxx_api/context.cc index c4ef7deb2fa..3f89d80a80b 100644 --- a/mindspore/lite/src/cxx_api/context.cc +++ b/mindspore/lite/src/cxx_api/context.cc @@ -292,12 +292,6 @@ uint32_t GPUDeviceInfo::GetDeviceID() const { return GetValue(data_, kModelOptionGPUDeviceID); } -void GPUDeviceInfo::SetGpuTrtInferMode(bool gpu_trt_infer_mode) { MS_LOG(ERROR) << "Unsupported Feature."; } -bool GPUDeviceInfo::GetGpuTrtInferMode() const { - MS_LOG(ERROR) << "Unsupported Feature."; - return false; -} - void GPUDeviceInfo::SetPrecisionMode(const std::vector &precision_mode) { MS_LOG(ERROR) << "Unsupported Feature."; }