xla_device_context.cc
imports tensorflow/core/platform/errors.himports tensorflow/core/platform/status.h
SHA-256d09f4cec474957ffa2bdf3e321e041ba9b447608842c6107d1d9e549a16d65be
MaleculeMd(In₅)
Evidence
1/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
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 "tensorflow/compiler/jit/xla_device_context.h"
17
18#include <cstddef>
19#include <functional>
20#include <memory>
21#include <optional>
22#include <string>
23#include <utility>
24#include <vector>
25
26#include "absl/log/check.h"
27#include "absl/log/log.h"
28#include "absl/status/status.h"
29#include "absl/status/statusor.h"
30#include "absl/strings/string_view.h"
31#include "absl/synchronization/mutex.h"
32#include "tensorflow/compiler/jit/xla_tensor.h"
33#include "tensorflow/compiler/tf2xla/layout_util.h"
34#include "tensorflow/compiler/tf2xla/literal_util.h"
35#include "tensorflow/compiler/tf2xla/xla_helpers.h"
36#include "xla/client/local_client.h"
37#include "xla/layout_util.h"
38#include "xla/literal.h"
39#include "xla/service/stream_pool.h"
40#include "xla/shape.h"
41#include "xla/shape_util.h"
42#include "xla/status_macros.h"
43#include "xla/stream_executor/allocator_stats.h"
44#include "xla/stream_executor/event.h"
45#include "xla/stream_executor/stream.h"
46#include "xla/stream_executor/stream_executor.h"
47#include "xla/tsl/platform/errors.h"
48#include "xla/tsl/platform/statusor.h"
49#include "tensorflow/core/common_runtime/dma_helper.h"
50#include "tensorflow/core/framework/allocator.h"
51#include "tensorflow/core/framework/device.h"
52#include "tensorflow/core/framework/tensor.h"
53#include "tensorflow/core/framework/tensor_reference.h"
54#include "tensorflow/core/platform/errors.h"
55#include "tensorflow/core/platform/status.h"
56#include "tensorflow/core/platform/threadpool.h"
57
58namespace tensorflow {
71:39… bject and ignore num_bytes here because we
72 // have control over all of the uses of this device tensor, and can lazily
73 // allocate memory when us …
173:68… ordinal()));
174
175 // The cpu_tensor and literal that we created here hold the data of host
176 // tensor in descending layout. The layout could be d …