From 4280678c4119e81ae04158f9763b0464885c8cba Mon Sep 17 00:00:00 2001 From: PENGUINLIONG Date: Wed, 15 Mar 2023 15:32:11 +0800 Subject: [PATCH] [lang] Fixed useless serial shader to blit ExternalTensorShapeAlongAxisStmt on Metal (#7562) Issue: # ### Brief Summary It's already fixed in other SPIR-V powered archs tho. Could we come up with a better way than this sequence of arch checks? --- taichi/transforms/offload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taichi/transforms/offload.cpp b/taichi/transforms/offload.cpp index 6423f79c21c48..01ca782862210 100644 --- a/taichi/transforms/offload.cpp +++ b/taichi/transforms/offload.cpp @@ -113,7 +113,7 @@ class Offloader { offloaded->end_value = val->val.val_int32(); } else { if ((arch == Arch::opengl || arch == Arch::vulkan || - arch == Arch::gles) && + arch == Arch::gles || arch == Arch::metal) && demotable_axis_load(s->end)) { // TODO: We need to update codegen for each backend gradually so // let's limit it to opengl backend for now. @@ -387,7 +387,7 @@ class IdentifyValuesUsedInOtherOffloads : public BasicStmtVisitor { (stmt->is() && stmt->as()->is_ptr)) return; if ((config_.arch == Arch::opengl || config_.arch == Arch::vulkan || - config_.arch == Arch::gles) && + config_.arch == Arch::gles || config_.arch == Arch::metal) && demotable_axis_load(stmt)) return; // Not yet allocated