lriggs commented on code in PR #55506:
URL: https://github.com/apache/arrow/pull/55506#discussion_r4747378828
##########
cpp/src/gandiva/engine.cc:
##########
@@ -330,25 +365,15 @@ void Engine::InitOnce() {
llvm::InitializeNativeTargetDisassembler();
llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
- cpu_name = llvm::sys::getHostCPUName();
-#if LLVM_VERSION_MAJOR >= 19
- auto host_features = llvm::sys::getHostCPUFeatures();
- const bool have_host_features = true;
-#else
- llvm::StringMap<bool> host_features;
- const auto have_host_features = llvm::sys::getHostCPUFeatures(host_features);
-#endif
- std::string cpu_attrs_str;
- if (have_host_features) {
- for (auto& f : host_features) {
- std::string attr = f.second ? std::string("+") + f.first().str()
- : std::string("-") + f.first().str();
- cpu_attrs.push_back(attr);
- cpu_attrs_str += " " + attr;
- }
+ host_target = DetectHostTarget();
+ if (host_target.ok()) {
+ ARROW_LOG(INFO) << "Detected target triple: " <<
host_target->getTargetTriple().str();
+ ARROW_LOG(INFO) << "Detected CPU Name : " << host_target->getCPU();
+ ARROW_LOG(INFO) << "Detected CPU Features: ["
Review Comment:
I doubt it matters
##########
cpp/src/gandiva/engine_llvm_test.cc:
##########
@@ -133,4 +133,19 @@ TEST_F(TestEngine, TestAddOptimised) {
EXPECT_EQ(add_func(my_array, 5), 17);
}
+TEST_F(TestEngine, TestAddWithoutHostCpu) {
+ // target_host_cpu=false compiles for the generic CPU of the host triple
+ auto conf = TestConfiguration();
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]