Skip to content

Commit

Permalink
[Target] Add tag for Metal - Apple M1 Max (tlc-pack#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterJH5574 committed Jan 28, 2023
1 parent f1bd8a9 commit 4b0874a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/target/tag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,19 @@ TVM_REGISTER_TAG_AWS_C5("aws/cpu/c5.24xlarge", 48, "cascadelake");

#undef TVM_REGISTER_TAG_AWS_C5

#define TVM_REGISTER_METAL_TAG(Name, ThreadsPerBlock, SharedMem, WarpSize) \
TVM_REGISTER_TARGET_TAG(Name).set_config( \
{{"kind", String("metal")}, \
{"max_threads_per_block", Integer(ThreadsPerBlock)}, \
{"max_shared_memory_per_block", Integer(SharedMem)}, \
{"thread_warp_size", Integer(WarpSize)}, \
{"host", Map<String, ObjectRef>{{"kind", String("llvm")}, \
{"mtriple", String("arm64-apple-macos")}, \
{"mcpu", String("apple-latest")}}}});

TVM_REGISTER_METAL_TAG("apple/m1", 1024, 32768, 32);
TVM_REGISTER_METAL_TAG("apple/m1-max", 1024, 32768, 32);

#undef TVM_REGISTER_METAL_TAG

} // namespace tvm

0 comments on commit 4b0874a

Please sign in to comment.