diff --git a/python/taichi/core/util.py b/python/taichi/core/util.py index a328680f327ed..d50d7f68bc703 100644 --- a/python/taichi/core/util.py +++ b/python/taichi/core/util.py @@ -480,6 +480,9 @@ def _print_taichi_header(): archs_str = ', '.join(sorted(supported_archs)) header += f'supported archs: [{archs_str}], ' + llvm_version = ti_core.get_llvm_version_string() + header += f'llvm {llvm_version}, ' + commit_hash = ti_core.get_commit_hash() commit_hash = commit_hash[:8] header += f'commit {commit_hash}, ' diff --git a/taichi/common/core.cpp b/taichi/common/core.cpp index 1d9407265c47f..d36934d52dd48 100644 --- a/taichi/common/core.cpp +++ b/taichi/common/core.cpp @@ -4,6 +4,9 @@ *******************************************************************************/ #include "taichi/common/core.h" + +#include "llvm/Config/llvm-config.h" + #include "taichi/common/version.h" #include "taichi/common/commit_hash.h" @@ -76,4 +79,8 @@ std::string get_cuda_version_string() { return TI_CUDAVERSION; } +std::string get_llvm_version_string() { + return LLVM_VERSION_STRING; +} + TI_NAMESPACE_END diff --git a/taichi/common/core.h b/taichi/common/core.h index 791f5b7138743..b08660ee06ddd 100644 --- a/taichi/common/core.h +++ b/taichi/common/core.h @@ -520,4 +520,5 @@ std::string get_commit_hash(); std::string get_cuda_version_string(); +std::string get_llvm_version_string(); TI_NAMESPACE_END diff --git a/taichi/python/export_lang.cpp b/taichi/python/export_lang.cpp index 1d5b1db7d5d14..6287099bca17c 100644 --- a/taichi/python/export_lang.cpp +++ b/taichi/python/export_lang.cpp @@ -537,6 +537,7 @@ void export_lang(py::module &m) { m.def("get_version_major", get_version_major); m.def("get_version_minor", get_version_minor); m.def("get_version_patch", get_version_patch); + m.def("get_llvm_version_string", get_llvm_version_string); m.def("test_printf", [] { printf("test_printf\n"); }); m.def("test_logging", [] { TI_INFO("test_logging\n"); }); m.def("trigger_crash", [] { *(int *)(1) = 0; }); diff --git a/taichi/transforms/auto_diff.cpp b/taichi/transforms/auto_diff.cpp index 93982ccdeb20b..b434629295346 100644 --- a/taichi/transforms/auto_diff.cpp +++ b/taichi/transforms/auto_diff.cpp @@ -222,7 +222,7 @@ class ReverseOuterLoops : public BasicStmtVisitor { using BasicStmtVisitor::visit; private: - ReverseOuterLoops(const std::vector &IB) : IB(IB), loop_depth(0) { + ReverseOuterLoops(const std::vector &IB) : loop_depth(0), IB(IB) { } bool is_IB(Block *block) const {