Skip to content

Commit c1f1674

Browse files
committed
Add comments
1 parent 1430a9f commit c1f1674

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

taichi/codegen/cuda/codegen_cuda.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ class TaskCodeGenCUDA : public TaskCodeGenLLVM {
663663
TI_NOT_IMPLEMENTED
664664
}
665665
} else {
666+
// Note that ret_type here cannot be integral because pow with an
667+
// integral exponent has been demoted in the demote_operations pass
666668
if (ret_type->is_primitive(PrimitiveTypeID::f32)) {
667669
llvm_val[stmt] = create_call("__nv_powf", {lhs, rhs});
668670
} else if (ret_type->is_primitive(PrimitiveTypeID::f64)) {

taichi/codegen/llvm/codegen_llvm.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ void TaskCodeGenLLVM::visit(BinaryOpStmt *stmt) {
658658
}
659659
} else if (op == BinaryOpType::pow) {
660660
if (arch_is_cpu(current_arch())) {
661+
// Note that ret_type here cannot be integral because pow with an
662+
// integral exponent has been demoted in the demote_operations pass
661663
if (ret_type->is_primitive(PrimitiveTypeID::f32)) {
662664
llvm_val[stmt] = create_call("pow_f32", {lhs, rhs});
663665
} else if (ret_type->is_primitive(PrimitiveTypeID::f64)) {

0 commit comments

Comments
 (0)