MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Backend

Method Backend

tensorflow/compiler/xla/service/backend.cc:121–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121Backend::Backend(se::Platform* platform, Compiler* compiler,
122 absl::Span<se::StreamExecutor* const> stream_executors,
123 TransferManager* transfer_manager,
124 ComputationPlacer* computation_placer,
125 int intra_op_parallelism_threads)
126 : platform_(platform),
127 compiler_(compiler),
128 transfer_manager_(transfer_manager),
129 computation_placer_(computation_placer),
130 stream_executors_(stream_executors.begin(), stream_executors.end()) {
131 // Create a memory allocator for the valid stream executors.
132 memory_allocator_ = std::make_shared<se::StreamExecutorMemoryAllocator>(
133 platform, stream_executors_);
134 CHECK(!stream_executors_.empty())
135 << "Service found no devices for backend " << platform_->Name() << '.';
136
137 if (platform->id() == se::host::kHostPlatformId) {
138 const int num_threads = intra_op_parallelism_threads > 0
139 ? intra_op_parallelism_threads
140 : tensorflow::port::MaxParallelism();
141 intra_op_thread_pool_.reset(new IntraOpThreadPool(num_threads));
142 }
143}
144
145Backend::~Backend() {
146 CHECK_EQ(memory_allocator_.use_count(), 1);

Callers

nothing calls this directly

Calls 7

MaxParallelismFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
NameMethod · 0.45
idMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected