MCPcopy Create free account
hub / github.com/apache/arrow / InitOnce

Method InitOnce

cpp/src/gandiva/engine.cc:319–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319void Engine::InitOnce() {
320 DCHECK_EQ(llvm_init, false);
321
322 llvm::InitializeNativeTarget();
323 llvm::InitializeNativeTargetAsmPrinter();
324 llvm::InitializeNativeTargetAsmParser();
325 llvm::InitializeNativeTargetDisassembler();
326 llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
327
328 cpu_name = llvm::sys::getHostCPUName();
329#if LLVM_VERSION_MAJOR >= 19
330 auto host_features = llvm::sys::getHostCPUFeatures();
331 const bool have_host_features = true;
332#else
333 llvm::StringMap<bool> host_features;
334 const auto have_host_features = llvm::sys::getHostCPUFeatures(host_features);
335#endif
336 std::string cpu_attrs_str;
337 if (have_host_features) {
338 for (auto& f : host_features) {
339 std::string attr = f.second ? std::string("+") + f.first().str()
340 : std::string("-") + f.first().str();
341 cpu_attrs.push_back(attr);
342 cpu_attrs_str += " " + attr;
343 }
344 }
345 ARROW_LOG(INFO) << "Detected CPU Name : " << cpu_name.str();
346 ARROW_LOG(INFO) << "Detected CPU Features: [" << cpu_attrs_str << "]";
347 llvm_init = true;
348}
349
350Engine::Engine(const std::shared_ptr<Configuration>& conf,
351 std::unique_ptr<llvm::orc::LLJIT> lljit,

Callers

nothing calls this directly

Calls 2

strMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected