From 10d85dbc99610c2200bccb4e88014a2bedcc1aa8 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 28 Aug 2020 16:39:22 +0800 Subject: [PATCH] [skip ci] revert --- python/taichi/lang/ops.py | 1 - taichi/python/export_lang.cpp | 2 ++ taichi/transforms/type_check.cpp | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/taichi/lang/ops.py b/python/taichi/lang/ops.py index 00e25bc1fcd01..d4d36f9acda73 100644 --- a/python/taichi/lang/ops.py +++ b/python/taichi/lang/ops.py @@ -300,7 +300,6 @@ def mul(a, b): @binary def mod(a, b): def expr_python_mod(a, b): - # a % b = (a // b) * b - a quotient = Expr(ti_core.expr_floordiv(a, b)) multiply = Expr(ti_core.expr_mul(b, quotient.ptr)) return ti_core.expr_sub(a, multiply.ptr) diff --git a/taichi/python/export_lang.cpp b/taichi/python/export_lang.cpp index e853e72bee8cc..20deadcc5a7a7 100644 --- a/taichi/python/export_lang.cpp +++ b/taichi/python/export_lang.cpp @@ -575,9 +575,11 @@ void export_lang(py::module &m) { m.def("host_arch", host_arch); m.def("set_lib_dir", [&](const std::string &dir) { + TI_INFO("set_lib_dir: [{}]", dir); compiled_lib_dir = dir; }); m.def("set_tmp_dir", [&](const std::string &dir) { + TI_INFO("set_tmp_dir: [{}]", dir); runtime_tmp_dir = dir; }); m.def("get_runtime_dir", get_runtime_dir); diff --git a/taichi/transforms/type_check.cpp b/taichi/transforms/type_check.cpp index d29140c8d9cc8..3450a78f6d508 100644 --- a/taichi/transforms/type_check.cpp +++ b/taichi/transforms/type_check.cpp @@ -40,9 +40,7 @@ class TypeCheck : public IRVisitor { void visit(IfStmt *if_stmt) { // TODO: use DataType::u1 when it's supported - TI_ASSERT_INFO(if_stmt->cond->ret_type.data_type == DataType::i32, - "`if` conditions must be of type int32, consider using `if x != 0:` " - "instead of `if x:` for float values."); + TI_ASSERT(if_stmt->cond->ret_type.data_type == DataType::i32); if (if_stmt->true_statements) if_stmt->true_statements->accept(this); if (if_stmt->false_statements) {