Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
strongoier committed Sep 13, 2022
1 parent 1430a9f commit c1f1674
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions taichi/codegen/cuda/codegen_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ class TaskCodeGenCUDA : public TaskCodeGenLLVM {
TI_NOT_IMPLEMENTED
}
} else {
// Note that ret_type here cannot be integral because pow with an
// integral exponent has been demoted in the demote_operations pass
if (ret_type->is_primitive(PrimitiveTypeID::f32)) {
llvm_val[stmt] = create_call("__nv_powf", {lhs, rhs});
} else if (ret_type->is_primitive(PrimitiveTypeID::f64)) {
Expand Down
2 changes: 2 additions & 0 deletions taichi/codegen/llvm/codegen_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ void TaskCodeGenLLVM::visit(BinaryOpStmt *stmt) {
}
} else if (op == BinaryOpType::pow) {
if (arch_is_cpu(current_arch())) {
// Note that ret_type here cannot be integral because pow with an
// integral exponent has been demoted in the demote_operations pass
if (ret_type->is_primitive(PrimitiveTypeID::f32)) {
llvm_val[stmt] = create_call("pow_f32", {lhs, rhs});
} else if (ret_type->is_primitive(PrimitiveTypeID::f64)) {
Expand Down

0 comments on commit c1f1674

Please sign in to comment.