Skip to content

Commit 95825c1

Browse files
authored
FLush check command_queue_ is nullptr,test=develop (#8901)
1 parent 1c9b38a commit 95825c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lite/backends/opencl/cl_runtime.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ CLRuntime* CLRuntime::Global() {
3030
}
3131

3232
void CLRuntime::Flush(const int index) {
33-
if (is_cl_runtime_initialized_ && index % opencl_flush_period_ == 0) {
33+
if (is_cl_runtime_initialized_ && index % opencl_flush_period_ == 0 &&
34+
command_queue_ != nullptr) {
3435
command_queue_->flush();
3536
}
3637
}

0 commit comments

Comments
 (0)