From 4ce86e67a57c7b2d94c49b8bf178d73e1116a335 Mon Sep 17 00:00:00 2001 From: jiweibo Date: Sat, 27 Jun 2020 03:35:42 +0000 Subject: [PATCH] update for style. test=develop --- lite/api/cxx_api.h | 10 +++++----- lite/api/cxx_api_impl.cc | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lite/api/cxx_api.h b/lite/api/cxx_api.h index 937647398d..92e17128c0 100644 --- a/lite/api/cxx_api.h +++ b/lite/api/cxx_api.h @@ -162,10 +162,10 @@ class LITE_API Predictor { // #endif #ifdef LITE_WITH_CUDA - void SetMultiStream(bool multi_stream) { multi_stream_ = multi_stream; } + void set_multi_stream(bool multi_stream) { multi_stream_ = multi_stream; } bool multi_stream() { return multi_stream_; } - void SetExecStream(cudaStream_t* stream) { exec_stream_ = stream; } - void SetIoStream(cudaStream_t* stream) { io_stream_ = stream; } + void set_exec_stream(cudaStream_t* stream) { exec_stream_ = stream; } + void set_io_stream(cudaStream_t* stream) { io_stream_ = stream; } const cudaStream_t& exec_stream() { return *exec_stream_; } const cudaStream_t& io_stream() { return *io_stream_; } #endif @@ -182,8 +182,8 @@ class LITE_API Predictor { std::vector valid_places_; #ifdef LITE_WITH_CUDA bool multi_stream_{false}; - cudaStream_t* io_stream_; - cudaStream_t* exec_stream_; + cudaStream_t* io_stream_{nullptr}; + cudaStream_t* exec_stream_{nullptr}; #endif }; diff --git a/lite/api/cxx_api_impl.cc b/lite/api/cxx_api_impl.cc index dd94c2de20..0370dcdee7 100644 --- a/lite/api/cxx_api_impl.cc +++ b/lite/api/cxx_api_impl.cc @@ -105,13 +105,13 @@ void CxxPaddleApiImpl::CudaEnvInit(std::vector *passes) { TargetWrapperCuda::CreateStream(io_stream_); } - raw_predictor_->SetExecStream(exec_stream_); - raw_predictor_->SetIoStream(io_stream_); + raw_predictor_->set_exec_stream(exec_stream_); + raw_predictor_->set_io_stream(io_stream_); // init sync events. if (config_.multi_stream()) { multi_stream_ = true; - raw_predictor_->SetMultiStream(multi_stream_); + raw_predictor_->set_multi_stream(multi_stream_); passes->push_back("multi_stream_analysis_pass"); VLOG(3) << "add pass: " << (*passes)[0]; Env::Devs &devs = Env::Global(); -- GitLab