conditional_thunk_test.cc
Google Test frameworkimports xla/tsl/platform/statusor.h
SHA-25614dba65dd528da837e9c1e6e205dbef94603af69e2b6fd20ec7238916cca2627
MaleculeMd₂(In₂Pa)
Evidence
1/* Copyright 2025 The OpenXLA Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "xla/backends/gpu/runtime/conditional_thunk.h"
17
18#include <memory>
19#include <string>
20#include <utility>
21#include <vector>
22
23#include <gmock/gmock.h>
24#include <gtest/gtest.h>
25#include "absl/log/check.h"
26#include "absl/status/status.h"
27#include "absl/status/statusor.h"
28#include "google/protobuf/text_format.h"
29#include "xla/backends/gpu/runtime/thunk.h"
30#include "xla/backends/gpu/runtime/thunk.pb.h"
31#include "xla/backends/gpu/runtime/thunk_executor.h"
32#include "xla/service/buffer_assignment.h"
33#include "xla/service/shaped_slice.h"
34#include "xla/shape.h"
35#include "xla/shape_util.h"
36#include "xla/tsl/lib/core/status_test_util.h"
37#include "xla/tsl/platform/statusor.h"
38#include "xla/tsl/platform/test.h"
39#include "xla/tsl/util/proto/proto_matchers.h"
40#include "xla/xla_data.pb.h"
41
42namespace xla::gpu {
⋯5 lines
48:40… ;
49using Kind = Thunk::Kind;
50
51// A dummy `Thunk` that does nothing.
52struct DummyThunk : public Thunk {
53 explicit DummyThunk(Thunk::Kind kind, Thunk: …
104:10… nk_info, {slice, shape}, std::move(branch_thunk_sequences));
105
106 EXPECT_EQ(thunk->branch_index_is_bool(), kBranchIndexIsBool);
107 EXPECT_EQ(thunk->branch_index_buffer().slice, slice);
108
109 auto thunk_match …
178:13… execution_stream_id: 123
179 }
180 }
181 }
182 }
183 )pb";
184 EXPECT_THAT(proto, EqualsProto(expected));
185}
⋯4 lines