Skip to content

Commit 5b172fa

Browse files
jblespiaucopybara-github
authored andcommitted
Replace tensorflow::Status::OK() with tensorflow::OkStatus().
PiperOrigin-RevId: 476296298
1 parent f581148 commit 5b172fa

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

tensorflow_graphics/rendering/opengl/egl_offscreen_context.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ tensorflow::Status EGLOffscreenContext::Create(
112112
surface_cleanup.release();
113113
*egl_offscreen_context = std::unique_ptr<EGLOffscreenContext>(
114114
new EGLOffscreenContext(context, display, pixel_buffer_surface));
115-
return tensorflow::Status::OK();
115+
return tensorflow::Status();
116116
}
117117

118118
tensorflow::Status EGLOffscreenContext::Destroy() {
@@ -127,19 +127,19 @@ tensorflow::Status EGLOffscreenContext::Destroy() {
127127
return TFG_INTERNAL_ERROR(
128128
"an error occured in TerminateInitializedEGLDisplay.");
129129
}
130-
return tensorflow::Status::OK();
130+
return tensorflow::Status();
131131
}
132132

133133
tensorflow::Status EGLOffscreenContext::MakeCurrent() const {
134134
TFG_RETURN_IF_EGL_ERROR(eglMakeCurrent(display_, pixel_buffer_surface_,
135135
pixel_buffer_surface_, context_));
136-
return tensorflow::Status::OK();
136+
return tensorflow::Status();
137137
}
138138

139139
tensorflow::Status EGLOffscreenContext::Release() {
140140
if (context_ != EGL_NO_CONTEXT && context_ == eglGetCurrentContext()) {
141141
TFG_RETURN_IF_EGL_ERROR(eglMakeCurrent(display_, EGL_NO_SURFACE,
142142
EGL_NO_SURFACE, EGL_NO_CONTEXT));
143143
}
144-
return tensorflow::Status::OK();
144+
return tensorflow::Status();
145145
}

tensorflow_graphics/rendering/opengl/gl_program.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ tensorflow::Status Program::CompileShader(const std::string& shader_code,
5959
std::string(&info_log[0]));
6060
}
6161
shader_cleanup.release();
62-
return tensorflow::Status::OK();
62+
return tensorflow::Status();
6363
}
6464

6565
tensorflow::Status Program::Create(
@@ -99,12 +99,12 @@ tensorflow::Status Program::Create(
9999
program_cleanup.release();
100100
// The content of shader_cleanups needs cleanup and hence is not released; see
101101
// https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteProgram.xhtml.
102-
return tensorflow::Status::OK();
102+
return tensorflow::Status();
103103
}
104104

105105
tensorflow::Status Program::Detach() const {
106106
TFG_RETURN_IF_GL_ERROR(glUseProgram(0));
107-
return tensorflow::Status::OK();
107+
return tensorflow::Status();
108108
}
109109

110110
tensorflow::Status Program::GetProgramResourceIndex(
@@ -113,7 +113,7 @@ tensorflow::Status Program::GetProgramResourceIndex(
113113
TFG_RETURN_IF_EGL_ERROR(*resource_index = glGetProgramResourceIndex(
114114
program_handle_, program_interface,
115115
resource_name.data()));
116-
return tensorflow::Status::OK();
116+
return tensorflow::Status();
117117
}
118118

119119
tensorflow::Status Program::GetProgramResourceiv(
@@ -123,7 +123,7 @@ tensorflow::Status Program::GetProgramResourceiv(
123123
TFG_RETURN_IF_EGL_ERROR(glGetProgramResourceiv(
124124
program_handle_, program_interface, resource_index, num_properties,
125125
properties, num_property_value, length, property_value));
126-
return tensorflow::Status::OK();
126+
return tensorflow::Status();
127127
}
128128

129129
tensorflow::Status Program::GetResourceProperty(
@@ -152,12 +152,12 @@ tensorflow::Status Program::GetResourceProperty(
152152
return TFG_INTERNAL_ERROR("length != num_properties: ", length,
153153
" != ", num_properties);
154154

155-
return tensorflow::Status::OK();
155+
return tensorflow::Status();
156156
}
157157

158158
tensorflow::Status Program::Use() const {
159159
TFG_RETURN_IF_EGL_ERROR(glUseProgram(program_handle_));
160-
return tensorflow::Status::OK();
160+
return tensorflow::Status();
161161
}
162162

163163
} // namespace gl_utils

tensorflow_graphics/rendering/opengl/gl_render_targets.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RenderTargets::~RenderTargets() {
4040

4141
tensorflow::Status RenderTargets::BindFramebuffer() const {
4242
TFG_RETURN_IF_GL_ERROR(glBindFramebuffer(GL_FRAMEBUFFER, frame_buffer_));
43-
return tensorflow::Status::OK();
43+
return tensorflow::Status();
4444
}
4545

4646
tensorflow::Status RenderTargets::CreateValidInternalFormat(
@@ -92,7 +92,7 @@ tensorflow::Status RenderTargets::CreateValidInternalFormat(
9292
gen_color_cleanup.release();
9393
gen_depth_cleanup.release();
9494
gen_frame_cleanup.release();
95-
return tensorflow::Status::OK();
95+
return tensorflow::Status();
9696
}
9797

9898
GLsizei RenderTargets::GetHeight() const { return height_; }
@@ -101,7 +101,7 @@ GLsizei RenderTargets::GetWidth() const { return width_; }
101101

102102
tensorflow::Status RenderTargets::UnbindFrameBuffer() const {
103103
TFG_RETURN_IF_GL_ERROR(glBindFramebuffer(GL_FRAMEBUFFER, 0));
104-
return tensorflow::Status::OK();
104+
return tensorflow::Status();
105105
}
106106

107107
} // namespace gl_utils

tensorflow_graphics/rendering/opengl/gl_shader_storage_buffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ tensorflow::Status ShaderStorageBuffer::Create(
3232
TFG_RETURN_IF_EGL_ERROR(glGenBuffers(1, &buffer));
3333
*shader_storage_buffer =
3434
std::unique_ptr<ShaderStorageBuffer>(new ShaderStorageBuffer(buffer));
35-
return tensorflow::Status::OK();
35+
return tensorflow::Status();
3636
}
3737

3838
tensorflow::Status ShaderStorageBuffer::BindBufferBase(GLuint index) const {
3939
TFG_RETURN_IF_EGL_ERROR(
4040
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, buffer_));
41-
return tensorflow::Status::OK();
41+
return tensorflow::Status();
4242
}
4343

4444
} // namespace gl_utils

tensorflow_graphics/rendering/opengl/rasterizer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ tensorflow::Status Rasterizer::SetUniformMatrix(
9898
uniform_location, 1, transpose ? GL_TRUE : GL_FALSE, matrix.data()));
9999

100100
// Cleanup the program; no program is active at this point.
101-
return tensorflow::Status::OK();
101+
return tensorflow::Status();
102102
}

tensorflow_graphics/rendering/opengl/rasterizer_op.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static tensorflow::Status GetVariablesRank(
6868
"Variable with name='", variable_names[index],
6969
"' has an invalid batch rank of ", batch_rank, "; expected ", *rank);
7070
}
71-
return tensorflow::Status::OK();
71+
return tensorflow::Status();
7272
}
7373

7474
REGISTER_OP("Rasterize")
@@ -137,7 +137,7 @@ rendered_image: A tensor of shape `[A1, ..., An, width, height, 4]`, with the
137137
c->Concatenate(batch_shape, image_shape, &output_shape));
138138
c->set_output(0, output_shape);
139139

140-
return tensorflow::Status::OK();
140+
return tensorflow::Status();
141141
});
142142

143143
class RasterizeOp : public tensorflow::OpKernel {
@@ -244,7 +244,7 @@ tensorflow::Status RasterizeOp::RenderImage(
244244

245245
TF_RETURN_IF_ERROR(rasterizer->Render(
246246
num_points, absl::MakeSpan(image_data, image_data + image_size)));
247-
return tensorflow::Status::OK();
247+
return tensorflow::Status();
248248
}
249249

250250
tensorflow::Status RasterizeOp::SetVariables(
@@ -280,7 +280,7 @@ tensorflow::Status RasterizeOp::SetVariables(
280280
value_pointer + buffer_length * (outer_dim + 1))));
281281
}
282282
}
283-
return tensorflow::Status::OK();
283+
return tensorflow::Status();
284284
}
285285

286286
tensorflow::Status RasterizeOp::ValidateVariables(
@@ -327,7 +327,7 @@ tensorflow::Status RasterizeOp::ValidateVariables(
327327
*batch_shape);
328328
}
329329
}
330-
return tensorflow::Status::OK();
330+
return tensorflow::Status();
331331
}
332332

333333
// Register kernel with TF

tensorflow_graphics/rendering/opengl/rasterizer_with_context.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RasterizerWithContext::RasterizerWithContext(
2828
RasterizerWithContext::~RasterizerWithContext() {
2929
// Destroy the rasterizer in the correct EGL context.
3030
auto status = egl_context_->MakeCurrent();
31-
if (status != tensorflow::Status::OK())
31+
if (status != tensorflow::Status())
3232
std::cerr
3333
<< "~RasterizerWithContext: failure to set the context as current."
3434
<< std::endl;
@@ -69,7 +69,7 @@ tensorflow::Status RasterizerWithContext::Create(
6969
std::move(offscreen_context), std::move(program),
7070
std::move(render_targets), clear_red, clear_green, clear_blue,
7171
clear_alpha, clear_depth, enable_cull_face));
72-
return tensorflow::Status::OK();
72+
return tensorflow::Status();
7373
}
7474

7575
tensorflow::Status RasterizerWithContext::Render(int num_points,
@@ -79,7 +79,7 @@ tensorflow::Status RasterizerWithContext::Render(int num_points,
7979
MakeCleanup([this]() { return this->egl_context_->Release(); });
8080
TF_RETURN_IF_ERROR(Rasterizer::Render(num_points, result));
8181
// context_cleanup calls EGLOffscreenContext::Release here.
82-
return tensorflow::Status::OK();
82+
return tensorflow::Status();
8383
}
8484

8585
tensorflow::Status RasterizerWithContext::Render(
@@ -89,5 +89,5 @@ tensorflow::Status RasterizerWithContext::Render(
8989
MakeCleanup([this]() { return this->egl_context_->Release(); });
9090
TF_RETURN_IF_ERROR(Rasterizer::Render(num_points, result));
9191
// context_cleanup calls EGLOffscreenContext::Release here.
92-
return tensorflow::Status::OK();
92+
return tensorflow::Status();
9393
}

0 commit comments

Comments
 (0)