diff --git a/tensorflow/stream_executor/rocm/rocm_driver.cc b/tensorflow/stream_executor/rocm/rocm_driver.cc index 8547c9f07f5e00..44a90c2978dc97 100644 --- a/tensorflow/stream_executor/rocm/rocm_driver.cc +++ b/tensorflow/stream_executor/rocm/rocm_driver.cc @@ -305,8 +305,8 @@ static port::Status InternalInit() { /* static */ port::Status GpuDriver::Init() { // Cached return value from calling InternalInit(), as hipInit need only be // called once, but GpuDriver::Init may be called many times. - static port::Status* init_retval = [&] { - init_retval = new Status(InternalInit()); + static port::Status* init_retval = [] { + return new port::Status(InternalInit()); }(); return *init_retval; }