提交 4ce86e67 编写于 作者: J jiweibo

update for style. test=develop

上级 3580f630
......@@ -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<Place> 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
};
......
......@@ -105,13 +105,13 @@ void CxxPaddleApiImpl::CudaEnvInit(std::vector<std::string> *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<TargetType::kCUDA>::Devs &devs = Env<TargetType::kCUDA>::Global();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册