Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions src/ascend/codegen/codegen_ascend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ bool IsSimdOp(const CallNode *op, std::string *op_name = nullptr) {
return false;
}

bool IsVmiOp(const CallNode *op, std::string *op_name = nullptr) {
if (auto opt_call_op = op->op.as<Op>()) {
const std::string &name = opt_call_op.value()->name;
if (name.rfind("tl.vmi.", 0) == 0) {
if (op_name != nullptr) {
*op_name = name;
}
return true;
}
}
return false;
}

bool IsSimdMergingCall(const CallNode *op,
std::string *intrinsic_name = nullptr) {
if (!op->dtype.is_void() || op->args.empty()) {
Expand Down Expand Up @@ -2569,6 +2582,13 @@ void CodeGenTileLangAscend::VisitExpr_(const CallNode *op, std::ostream &os) {
<< "Unsupported RNG distribution on Ascend: " << dist;
os << "tl::philox_rand_" << dist << "(&" << ascend_rng_state_var_ << ")";
} else {
std::string op_name;
// Evaluate statements print their value through this CallNode visitor, so
// statement-form VMI calls such as vstore are rejected here as well.
if (IsVmiOp(op, &op_name)) {
LOG(FATAL) << "Ascend CCE codegen does not support " << op_name
<< "; use target='pto' for T.vmi.*";
}
CodeGenC::VisitExpr_(op, os);
}
}
Expand Down
Loading
Loading