diff --git a/include/tvm/expr_operator.h b/include/tvm/expr_operator.h index d47759222112b..ff3b340bf1fa4 100644 --- a/include/tvm/expr_operator.h +++ b/include/tvm/expr_operator.h @@ -584,13 +584,13 @@ TVM_DLL PrimExpr nearbyint(PrimExpr x); TVM_DLL PrimExpr trunc(PrimExpr x); /*! - * \brief Construct a big uint constant by its low 32 bits and high 32bits. + * \brief Construct a large uint constant by its low 32 bits and high 32bits. * \param dtype The final data type. * \param low The lower 32 bits. * \param high The higher 32 bits. * \return The constructed expression. */ -TVM_DLL PrimExpr BigUIntImm(DataType dtype, int64_t low, int64_t high); +TVM_DLL PrimExpr LargeUIntImm(DataType dtype, int64_t low, int64_t high); // Intrinsic operators #define TVM_DECLARE_INTRIN_UNARY(OpName) \ @@ -674,7 +674,7 @@ inline PrimExpr MakeConstScalar(DataType t, ValueType value) { uint64_t mask = (static_cast(1) << 32U) - 1U; uint64_t low = uval & mask; uint64_t high = uval >> 32U; - return BigUIntImm(t, static_cast(low), static_cast(high)); + return LargeUIntImm(t, static_cast(low), static_cast(high)); } } if (t.is_float()) return ir::FloatImmNode::make(t, static_cast(value)); diff --git a/include/tvm/ir.h b/include/tvm/ir.h index 20ebd92fc4239..9c14a31be2fed 100644 --- a/include/tvm/ir.h +++ b/include/tvm/ir.h @@ -1410,11 +1410,11 @@ namespace intrinsic { * * Construct a big uint that may not be representable by int64 * - * Expr tvm_big_uint_imm(uint32_t v0, uin32_t v1) { + * Expr tvm_large_uint_imm(uint32_t v0, uin32_t v1) { * return (v1 << 32) | v0; * } */ -constexpr const char* tvm_big_uint_imm = "tvm_big_uint_imm"; +constexpr const char* tvm_large_uint_imm = "tvm_large_uint_imm"; /*! * \brief See pesudo code * diff --git a/python/tvm/api.py b/python/tvm/api.py index 9afa0cc0609e6..4bfe794c14d34 100644 --- a/python/tvm/api.py +++ b/python/tvm/api.py @@ -93,7 +93,7 @@ def const(value, dtype=None): if dtype is None: dtype = _scalar_type_inference(value) if dtype == "uint64" and value >= (1 << 63): - return _api_internal._BigUIntImm( + return _api_internal._LargeUIntImm( dtype, value & ((1 << 32) - 1), value >> 32) return _api_internal._const(value, dtype) diff --git a/src/api/api_lang.cc b/src/api/api_lang.cc index 6b0cfdd55bd64..fa7b59d36b881 100644 --- a/src/api/api_lang.cc +++ b/src/api/api_lang.cc @@ -53,8 +53,8 @@ TVM_REGISTER_GLOBAL("_const") } }); -TVM_REGISTER_GLOBAL("_BigUIntImm") -.set_body_typed(BigUIntImm); +TVM_REGISTER_GLOBAL("_LargeUIntImm") +.set_body_typed(LargeUIntImm); TVM_REGISTER_GLOBAL("_str") .set_body_typed(ir::StringImmNode::make); diff --git a/src/codegen/codegen_c.cc b/src/codegen/codegen_c.cc index 906631368f746..d9b7f7f08d123 100644 --- a/src/codegen/codegen_c.cc +++ b/src/codegen/codegen_c.cc @@ -527,7 +527,7 @@ void CodeGenC::VisitExpr_(const CallNode* op, std::ostream& os) { // NOLINT(*) os << ")"; } else if (op->is_intrinsic(CallNode::bitwise_and)) { PrintBinaryIntrinsic(op, " & ", os, this); - } else if (op->is_intrinsic(intrinsic::tvm_big_uint_imm)) { + } else if (op->is_intrinsic(intrinsic::tvm_large_uint_imm)) { CHECK_EQ(op->args.size(), 2U); uint64_t low = static_cast(Downcast(op->args[0])->value); uint64_t high = static_cast(Downcast(op->args[1])->value); diff --git a/src/codegen/llvm/codegen_llvm.cc b/src/codegen/llvm/codegen_llvm.cc index 75982cc218485..60d8146fc0e6e 100644 --- a/src/codegen/llvm/codegen_llvm.cc +++ b/src/codegen/llvm/codegen_llvm.cc @@ -720,7 +720,7 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) { return llvm::Constant::getNullValue(t_void_p_); } else if (op->is_intrinsic(intrinsic::tvm_handle_is_null)) { return builder_->CreateIsNull(MakeValue(op->args[0])); - } else if (op->is_intrinsic(intrinsic::tvm_big_uint_imm)) { + } else if (op->is_intrinsic(intrinsic::tvm_large_uint_imm)) { CHECK_EQ(op->args.size(), 2U); uint64_t low = static_cast(Downcast(op->args[0])->value); uint64_t high = static_cast(Downcast(op->args[1])->value); diff --git a/src/lang/expr_operator.cc b/src/lang/expr_operator.cc index 5f9816f6898b9..bd43d89d89d02 100644 --- a/src/lang/expr_operator.cc +++ b/src/lang/expr_operator.cc @@ -35,9 +35,9 @@ inline PrimExpr SimpleCast(const DataType& t, PrimExpr value) { return ir::CastNode::make(t, value); } -PrimExpr BigUIntImm(DataType t, int64_t low, int64_t high) { +PrimExpr LargeUIntImm(DataType t, int64_t low, int64_t high) { return ir::CallNode::make( - t, ir::intrinsic::tvm_big_uint_imm, + t, ir::intrinsic::tvm_large_uint_imm, {make_const(DataType::UInt(32), low), make_const(DataType::UInt(32), high)}, ir::CallNode::PureIntrinsic); diff --git a/tests/python/unittest/test_codegen_device.py b/tests/python/unittest/test_codegen_device.py index 592b073767a86..5a10618fb2692 100644 --- a/tests/python/unittest/test_codegen_device.py +++ b/tests/python/unittest/test_codegen_device.py @@ -18,7 +18,7 @@ from tvm.contrib import util import numpy as np -def test_big_uint_imm(): +def test_large_uint_imm(): value = (1 << 63) + 123 other = tvm.const(3, "uint64") n = 12 @@ -138,5 +138,5 @@ def check_module_save(device, host="stackvm"): if __name__ == "__main__": - test_big_uint_imm() + test_large_uint_imm() test_add_pipeline() diff --git a/tests/python/unittest/test_codegen_llvm.py b/tests/python/unittest/test_codegen_llvm.py index f21bc33dadd5d..4920206ee019f 100644 --- a/tests/python/unittest/test_codegen_llvm.py +++ b/tests/python/unittest/test_codegen_llvm.py @@ -88,7 +88,7 @@ def test_llvm_lookup_intrin(): fcode = tvm.build(func, None, "llvm") -def test_llvm_big_uintimm(): +def test_llvm_large_uintimm(): value = (1 << 63) + 123 other = tvm.const(3, "uint64") A = tvm.compute((), lambda : tvm.const(value, "uint64") + other, name='A') @@ -664,7 +664,7 @@ def vectorizer(op): tvm.testing.assert_allclose(c_.asnumpy(), (a_.asnumpy() * 2).astype('int32')) if __name__ == "__main__": - test_llvm_big_uintimm() + test_llvm_large_uintimm() test_llvm_import() test_alignment() test_rank_zero()