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

Method BuildExecutable

tensorflow/compiler/jit/xla_compilation_cache.cc:144–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144Status XlaCompilationCache::BuildExecutable(
145 const XlaCompiler::Options& options,
146 const XlaCompiler::CompilationResult& result,
147 std::unique_ptr<xla::LocalExecutable>* executable) {
148 VLOG(2) << "Compiling to local executable";
149
150 std::vector<const xla::Shape*> argument_layouts(
151 result.xla_input_shapes.size());
152 for (int i = 0; i < result.xla_input_shapes.size(); ++i) {
153 argument_layouts[i] = &result.xla_input_shapes[i];
154 }
155 xla::ExecutableBuildOptions build_options;
156 build_options.set_device_ordinal(options.device_ordinal != -1
157 ? options.device_ordinal
158 : client_->default_device_ordinal());
159 build_options.set_result_layout(result.xla_output_shape);
160 build_options.set_device_allocator(options.device_allocator.get());
161
162 TF_ASSIGN_OR_RETURN(
163 auto executables,
164 client_->Compile(*result.computation, argument_layouts, build_options));
165 TF_RET_CHECK(executables.size() == 1);
166 *executable = std::move(executables[0]);
167 return Status::OK();
168}
169
170Status XlaCompilationCache::Compile(
171 const XlaCompiler::Options& options, const NameAttrList& function,

Callers

nothing calls this directly

Calls 4

set_device_allocatorMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected