Skip to content

Commit

Permalink
rename big->large
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Jan 14, 2020
1 parent 501a099 commit 004896e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions include/tvm/expr_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -674,7 +674,7 @@ inline PrimExpr MakeConstScalar(DataType t, ValueType value) {
uint64_t mask = (static_cast<uint64_t>(1) << 32U) - 1U;
uint64_t low = uval & mask;
uint64_t high = uval >> 32U;
return BigUIntImm(t, static_cast<int64_t>(low), static_cast<int64_t>(high));
return LargeUIntImm(t, static_cast<int64_t>(low), static_cast<int64_t>(high));
}
}
if (t.is_float()) return ir::FloatImmNode::make(t, static_cast<double>(value));
Expand Down
4 changes: 2 additions & 2 deletions include/tvm/ir.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/api/api_lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/codegen_c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(Downcast<IntImm>(op->args[0])->value);
uint64_t high = static_cast<uint64_t>(Downcast<IntImm>(op->args[1])->value);
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(Downcast<IntImm>(op->args[0])->value);
uint64_t high = static_cast<uint64_t>(Downcast<IntImm>(op->args[1])->value);
Expand Down
4 changes: 2 additions & 2 deletions src/lang/expr_operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/python/unittest/test_codegen_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
4 changes: 2 additions & 2 deletions tests/python/unittest/test_codegen_llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 004896e

Please sign in to comment.