Skip to content

Commit

Permalink
[FIX][LLVM] Workaround -mcpu=apple-latest for llvm above 18.0 (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
cbalint13 committed Nov 30, 2024
1 parent 7ae7ea8 commit 872e66f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/target/tag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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")}, \
Expand All @@ -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);
Expand Down

0 comments on commit 872e66f

Please sign in to comment.