Skip to content

Commit

Permalink
replace opengl_unary_op_type_symbol with unary_op_type_name
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Feb 26, 2020
1 parent af4e15e commit b59e047
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion taichi/backends/codegen_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class KernelGen : public IRVisitor
{
if (stmt->op_type != UnaryOpType::cast) {
emit("const {} {} = {}({});", opengl_data_type_name(stmt->element_type()),
stmt->raw_name(), opengl_unary_op_type_symbol(stmt->op_type),
stmt->raw_name(), unary_op_type_name(stmt->op_type),
stmt->operand->raw_name());
} else {
// cast
Expand Down
38 changes: 0 additions & 38 deletions taichi/platform/opengl/opengl_data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,6 @@ inline std::string opengl_data_type_name(DataType dt)
return "";
}

inline std::string opengl_unary_op_type_symbol(UnaryOpType type)
{
switch (type)
{
case UnaryOpType::neg:
return "-";
case UnaryOpType::sqrt:
return "sqrt";
case UnaryOpType::floor:
return "floor";
case UnaryOpType::ceil:
return "ceil";
case UnaryOpType::abs:
return "abs";
case UnaryOpType::sgn:
return "sign";
case UnaryOpType::sin:
return "sin";
case UnaryOpType::asin:
return "asin";
case UnaryOpType::cos:
return "cos";
case UnaryOpType::acos:
return "acos";
case UnaryOpType::tan:
return "tan";
case UnaryOpType::tanh:
return "tanh";
case UnaryOpType::exp:
return "exp";
case UnaryOpType::log:
return "log";
default:
TI_NOT_IMPLEMENTED;
}
return "";
}

inline bool is_opengl_binary_op_infix(BinaryOpType type)
{
return !((type == BinaryOpType::min) || (type == BinaryOpType::max) ||
Expand Down

0 comments on commit b59e047

Please sign in to comment.