dump_test.cc
imports tsl/platform/path.himports tsl/platform/platform.h
SHA-2560ce60316d576269c08d1511aa588defbdb0e4569677cf34d5e5734dd8f7058e2
MaleculeMd₂(In₅Pa)
Evidence
1/* Copyright 2024 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/dump.h"
17
18#include <sys/types.h>
19
20#include <cstdint>
21#include <memory>
22#include <string>
23#include <utility>
24#include <vector>
25
26#include <gmock/gmock.h>
27#include <gtest/gtest.h>
28#include "absl/algorithm/container.h"
29#include "absl/strings/match.h"
30#include "absl/strings/numbers.h"
31#include "google/protobuf/text_format.h"
32#include "xla/debug_options_flags.h"
33#include "xla/hlo/analysis/alias_info.h"
34#include "xla/hlo/analysis/hlo_ordering.h"
35#include "xla/hlo/ir/hlo_module.h"
36#include "xla/hlo/parser/hlo_parser.h"
37#include "xla/runtime/large_hlo_snapshot_serialization/serialization.h"
38#include "xla/service/buffer_assignment.h"
39#include "xla/service/buffer_value.h"
40#include "xla/service/hlo_module_config.h"
41#include "xla/service/logical_buffer.h"
42#include "xla/shape_util.h"
43#include "xla/tsl/lib/core/status_test_util.h"
44#include "xla/tsl/platform/env.h"
45#include "xla/tsl/platform/statusor.h"
46#include "xla/tsl/platform/test.h"
47#include "xla/tsl/testing/temporary_directory.h"
48#include "xla/tsl/util/proto/proto_matchers.h"
49#include "xla/xla.pb.h"
50#include "tsl/platform/path.h"
51#include "tsl/platform/platform.h"
52
53namespace xla {
⋯5 lines
63:50… ();
64 auto env = tsl::Env::Default();
65 std::string dump_dir;
66 EXPECT_TRUE(env->LocalTempFilename(&dump_dir));
67 options.set_xla_dump_to(dump_dir);
68 options.set_xla_dump_hlo_as_text(true);
69 options.se …
81:27… "dump";
82 auto paths = DumpHloModuleIfEnabled(*m, dump_name);
83 EXPECT_EQ(paths.size(), 2); // debug options dump + HLO dump.
84 std::string data;
85 EXPECT_TRUE(ReadFileToString(env, paths[0], &data).o …