This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new d94f1159f0 [FIX][LLVM] Workaround -mcpu=apple-latest for llvm above
18.0 (#17492) (#17549)
d94f1159f0 is described below
commit d94f1159f0ae7f8f84c45da66602d301c9d07a21
Author: Balint Cristian <[email protected]>
AuthorDate: Sat Nov 30 15:08:02 2024 +0200
[FIX][LLVM] Workaround -mcpu=apple-latest for llvm above 18.0 (#17492)
(#17549)
---
src/target/tag.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/target/tag.cc b/src/target/tag.cc
index d45bf61a38..52fbe4d7bb 100644
--- a/src/target/tag.cc
+++ b/src/target/tag.cc
@@ -429,6 +429,17 @@ TVM_REGISTER_TAG_AWS_C5("aws/cpu/c5.24xlarge", 48,
"cascadelake");
#undef TVM_REGISTER_TAG_AWS_C5
+#if TVM_LLVM_VERSION >= 190
+#define TVM_REGISTER_METAL_GPU_TAG(Name, ThreadsPerBlock, SharedMem, WarpSize)
\
+ TVM_REGISTER_TARGET_TAG(Name).set_config(
\
+ {{"kind", String("metal")},
\
+ {"max_threads_per_block", runtime::Int(ThreadsPerBlock)},
\
+ {"max_shared_memory_per_block", runtime::Int(SharedMem)},
\
+ {"thread_warp_size", runtime::Int(WarpSize)},
\
+ {"host", Map<String, ObjectRef>{{"kind", String("llvm")},
\
+ {"mtriple",
String("arm64-apple-macos")}, \
+ {"mcpu", String("apple-m4")}}}});
+#else
#define TVM_REGISTER_METAL_GPU_TAG(Name, ThreadsPerBlock, SharedMem, WarpSize)
\
TVM_REGISTER_TARGET_TAG(Name).set_config(
\
{{"kind", String("metal")},
\
@@ -438,6 +449,7 @@ TVM_REGISTER_TAG_AWS_C5("aws/cpu/c5.24xlarge", 48,
"cascadelake");
{"host", Map<String, ObjectRef>{{"kind", String("llvm")},
\
{"mtriple",
String("arm64-apple-macos")}, \
{"mcpu", String("apple-latest")}}}});
+#endif
#if TVM_LLVM_HAS_AARCH64_TARGET
TVM_REGISTER_METAL_GPU_TAG("apple/m1-gpu", 1024, 32768, 32);