gpu_aot_compilation_result_test.cc
Google Test frameworkimports xla/stream_executor/platform.h
SHA-256785fd48c780d3949c2fb8f47b6b3df9660e3ee13996753d8fc75bd9b59cbc4b7
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/service/gpu/gpu_aot_compilation_result.h"
17
18#include <memory>
19#include <optional>
20#include <string>
21#include <utility>
22#include <vector>
23
24#include <gmock/gmock.h>
25#include <gtest/gtest.h>
26#include "absl/status/status.h"
27#include "absl/status/status_matchers.h"
28#include "absl/status/statusor.h"
29#include "absl/strings/string_view.h"
30#include "riegeli/bytes/string_reader.h"
31#include "xla/backends/gpu/codegen/kernels/custom_kernel.h"
32#include "xla/backends/gpu/runtime/custom_kernel_thunk.h"
33#include "xla/backends/gpu/runtime/kernel_thunk.h"
34#include "xla/backends/gpu/runtime/thunk.h"
35#include "xla/backends/gpu/runtime/thunk_executor.h"
36#include "xla/codegen/emitters/kernel_arguments.h"
37#include "xla/hlo/ir/hlo_computation.h"
38#include "xla/hlo/ir/hlo_instruction.h"
39#include "xla/hlo/ir/hlo_module.h"
40#include "xla/literal_util.h"
41#include "xla/service/buffer_assignment.h"
42#include "xla/service/executable.h"
43#include "xla/service/gpu/gpu_executable.h"
44#include "xla/service/gpu/launch_dimensions.h"
45#include "xla/service/hlo_module_config.h"
46#include "xla/stream_executor/abi/executable_abi_version.h"
47#include "xla/stream_executor/cuda/cuda_compute_capability.h"
48#include "xla/stream_executor/device_description.h"
49#include "xla/stream_executor/gpu/tma_metadata.h"
50#include "xla/stream_executor/kernel_symbol_registry.h"
51#include "xla/stream_executor/launch_dim.h"
52#include "xla/stream_executor/mock_platform.h"
53#include "xla/stream_executor/mock_stream_executor.h"
54#include "xla/stream_executor/platform.h"
55#include "xla/stream_executor/platform_id.h"
56#include "xla/stream_executor/semantic_version.h"
57#include "xla/stream_executor/stream_executor.h"
58#include "xla/tsl/lib/core/status_test_util.h"
156:38… the global registry to look up symbols.
157 // That means different test cases can affect each other. Therefore we check
158 // if the symbol is re …
174:6… eam_executor::Platform::Id platform_id_ = kDummyPlatformId;
175};
176
177TEST_F(GpuAotCompilationResultTest, CreateAndSerialize) {
178 TF_ASSERT_OK_AND_ASSIGN(GpuExecutableProto reference_executable,
179 …
205:55… le_abi_version,
206 result->GetExecutableAbiVersion());
207 EXPECT_EQ(executable_abi_version.platform_name(), "CUDA");
208 EXPECT_EQ(executable_abi_version.proto()
209 .cuda_platform_ …