Skip to content

Commit

Permalink
PR tensorflow#13021: Fix build issue of gpu_sparse_dot_test
Browse files Browse the repository at this point in the history
Imported from GitHub PR openxla/xla#13021

replaces EXPECT_OK with TF_EXPECT_OK and added relevant header file and dependency.

Error:
#10 1431.9 xla/service/gpu/tests/gpu_sparse_dot_test.cc:134:3: error: use of undeclared identifier 'EXPECT_OK'
[1792](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1792)#10 1431.9   134 |   EXPECT_OK(dense_module);
[1793](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1793)#10 1431.9       |   ^
[1794](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1794)#10 1431.9 xla/service/gpu/tests/gpu_sparse_dot_test.cc:137:3: error: use of undeclared identifier 'EXPECT_OK'
[1795](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1795)#10 1431.9   137 |   EXPECT_OK(dense_result);
[1796](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1796)#10 1431.9       |   ^
[1797](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1797)#10 1431.9 xla/service/gpu/tests/gpu_sparse_dot_test.cc:158:3: error: use of undeclared identifier 'EXPECT_OK'
[1798](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1798)#10 1431.9   158 |   EXPECT_OK(sparse_module);
[1799](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1799)#10 1431.9       |   ^
[1800](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1800)#10 1431.9 xla/service/gpu/tests/gpu_sparse_dot_test.cc:161:3: error: use of undeclared identifier 'EXPECT_OK'
[1801](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1801)#10 1431.9   161 |   EXPECT_OK(sparse_result);
[1802](https://gitlab-master.nvidia.com/dl/openxla/ci/-/jobs/94442414#L1802)#10 1431.9       |   ^
Copybara import of the project:

--
a7d07b02230794d9c13175b39473666d5d067c54 by hmonishN <hmonish@nvidia.com>:

fixing build issue for this test

--
e45b3b975c40b318ac4918859b364d8e8c3b304a by hmonishN <hmonish@nvidia.com>:

fix build error

--
077b7a5b8277cb2e55b57aca64102871326afd0d by Harshit Monish <143435143+hmonishN@users.noreply.github.com>:

Incorporated review comment.

Merging this change closes tensorflow#13021

PiperOrigin-RevId: 636832662
  • Loading branch information
hmonishN authored and tensorflower-gardener committed May 24, 2024
1 parent ec47405 commit 05f19a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions third_party/xla/xla/service/gpu/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ xla_test(
"//xla:literal",
"//xla:literal_util",
"//xla/tests:xla_internal_test_main",
"@local_tsl//tsl/lib/core:status_test_util",
],
["@local_tsl//tsl/platform:test_main"], # b/317293391
),
Expand Down
9 changes: 5 additions & 4 deletions third_party/xla/xla/service/gpu/tests/gpu_sparse_dot_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ limitations under the License.
#include "xla/literal.h"
#include "xla/literal_util.h"
#include "xla/service/gpu/tests/gpu_codegen_test.h"
#include "tsl/lib/core/status_test_util.h"

namespace xla {
namespace gpu {
Expand Down Expand Up @@ -131,10 +132,10 @@ ENTRY main {
Literal dense_rhs = LiteralUtil::CreateR1<uint16_t>(absl::MakeSpan(in2));

auto dense_module = ParseAndReturnVerifiedModule(dense_hlo);
EXPECT_OK(dense_module);
TF_EXPECT_OK(dense_module);
auto dense_result =
Execute(std::move(*dense_module), {&dense_lhs, &dense_rhs});
EXPECT_OK(dense_result);
TF_EXPECT_OK(dense_result);

// Execute sparse dot.
const char* kSparseTpl = R"(
Expand All @@ -155,10 +156,10 @@ ENTRY main {
Literal sparse_meta = LiteralUtil::CreateR1<uint16_t>(absl::MakeSpan(meta));

auto sparse_module = ParseAndReturnVerifiedModule(sparse_hlo);
EXPECT_OK(sparse_module);
TF_EXPECT_OK(sparse_module);
auto sparse_result = Execute(std::move(*sparse_module),
{&sparse_lhs, &sparse_rhs, &sparse_meta});
EXPECT_OK(sparse_result);
TF_EXPECT_OK(sparse_result);

// Compare the results.
EXPECT_EQ(*dense_result, *sparse_result);
Expand Down

0 comments on commit 05f19a0

Please sign in to comment.