xref: /aosp_15_r20/external/tensorflow/tensorflow/core/tfrt/gpu/gpu_shared_context.cc (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1 // Copyright 2021 The TensorFlow Runtime Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "tensorflow/core/tfrt/gpu/gpu_shared_context.h"
16 
17 #include <string>
18 #include <utility>
19 #include <vector>
20 
21 namespace tfrt {
22 namespace gpu {
23 
GpuSharedContext(int64_t run_id,absl::flat_hash_map<LocalDeviceIdentifier,int> local_ids_to_rank,std::vector<int64_t> gpu_global_device_ids,XcclUniqueIdCallback xccl_unique_id_callback,const std::string * compiled_code)24 GpuSharedContext::GpuSharedContext(
25     int64_t run_id,
26     absl::flat_hash_map<LocalDeviceIdentifier, int> local_ids_to_rank,
27     std::vector<int64_t> gpu_global_device_ids,
28     XcclUniqueIdCallback xccl_unique_id_callback,
29     const std::string* compiled_code)
30     : run_id_(run_id),
31       local_ids_to_rank_(std::move(local_ids_to_rank)),
32       gpu_global_device_ids_(std::move(gpu_global_device_ids)),
33       xccl_unique_id_callback_(std::move(xccl_unique_id_callback)),
34       compiled_code_(compiled_code) {}
35 
36 }  // namespace gpu
37 }  // namespace tfrt
38