diff --git a/xla/pjrt/c/pjrt_c_api_gpu_test.cc b/xla/pjrt/c/pjrt_c_api_gpu_test.cc index eee88adae5a78..e17b04de73cec 100644 --- a/xla/pjrt/c/pjrt_c_api_gpu_test.cc +++ b/xla/pjrt/c/pjrt_c_api_gpu_test.cc @@ -77,8 +77,8 @@ class PjrtCApiGpuTest : public PjrtCApiTestBase { TEST_F(PjrtCApiGpuTest, CreateViewOfDeviceBuffer) { // Prepares a device memory ptr on GPU. - std::unique_ptr buffer = - create_buffer().first; + auto [buffer, buffer_future] = create_buffer(); + TF_CHECK_OK(buffer_future.Await()); PJRT_Buffer_OpaqueDeviceMemoryDataPointer_Args device_buffer_ptr_args; device_buffer_ptr_args.struct_size = PJRT_Buffer_OpaqueDeviceMemoryDataPointer_Args_STRUCT_SIZE;