Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Show LLVM version on startup #1294

Merged
merged 5 commits into from
Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/taichi/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_version_llvm()
FantasyVR marked this conversation as resolved.
Show resolved Hide resolved
header += f'llvm {llvm_version}, '

commit_hash = ti_core.get_commit_hash()
commit_hash = commit_hash[:8]
header += f'commit {commit_hash}, '
Expand Down
5 changes: 5 additions & 0 deletions taichi/common/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "taichi/common/core.h"
#include "taichi/common/version.h"
#include "taichi/common/commit_hash.h"
#include "llvm/Config/llvm-config.h"
FantasyVR marked this conversation as resolved.
Show resolved Hide resolved

TI_NAMESPACE_BEGIN

Expand Down Expand Up @@ -76,4 +77,8 @@ std::string get_cuda_version_string() {
return TI_CUDAVERSION;
}

std::string get_llvm_version_string() {
return LLVM_VERSION_STRING;
}

TI_NAMESPACE_END
1 change: 1 addition & 0 deletions taichi/common/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,4 +520,5 @@ std::string get_commit_hash();

std::string get_cuda_version_string();

std::string get_llvm_version_string();
TI_NAMESPACE_END
1 change: 1 addition & 0 deletions taichi/python/export_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_version_llvm", get_llvm_version_string);
FantasyVR marked this conversation as resolved.
Show resolved Hide resolved
m.def("test_printf", [] { printf("test_printf\n"); });
m.def("test_logging", [] { TI_INFO("test_logging\n"); });
m.def("trigger_crash", [] { *(int *)(1) = 0; });
Expand Down