core: WIP - int64, uint32 and uint64 works now
This commit is contained in:
parent
72d04d90e0
commit
c2041e8d34
|
@ -108,15 +108,17 @@ pub fn call_int32<'ctx, G: CodeGenerator + ?Sized>(
|
|||
}
|
||||
|
||||
/// Invokes the `int64` builtin function.
|
||||
pub fn call_int64<'ctx>(
|
||||
pub fn call_int64<'ctx, G: CodeGenerator + ?Sized>(
|
||||
generator: &mut G,
|
||||
ctx: &mut CodeGenContext<'ctx, '_>,
|
||||
n: (Type, BasicValueEnum<'ctx>),
|
||||
) -> IntValue<'ctx> {
|
||||
) -> Result<BasicValueEnum<'ctx>, String> {
|
||||
let llvm_i64 = ctx.ctx.i64_type();
|
||||
let llvm_usize = generator.get_size_type(ctx.ctx);
|
||||
|
||||
let (n_ty, n) = n;
|
||||
|
||||
match n.get_type() {
|
||||
Ok(match n.get_type() {
|
||||
BasicTypeEnum::IntType(int_ty) if matches!(int_ty.get_bit_width(), 1 | 8 | 32) => {
|
||||
debug_assert!([
|
||||
ctx.primitives.bool,
|
||||
|
@ -127,10 +129,12 @@ pub fn call_int64<'ctx>(
|
|||
if ctx.unifier.unioned(n_ty, ctx.primitives.int32) {
|
||||
ctx.builder
|
||||
.build_int_s_extend(n.into_int_value(), llvm_i64, "sext")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
} else {
|
||||
ctx.builder
|
||||
.build_int_z_extend(n.into_int_value(), llvm_i64, "zext")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +145,7 @@ pub fn call_int64<'ctx>(
|
|||
ctx.primitives.uint64,
|
||||
].iter().any(|ty| ctx.unifier.unioned(n_ty, *ty)));
|
||||
|
||||
n.into_int_value()
|
||||
n
|
||||
}
|
||||
|
||||
BasicTypeEnum::FloatType(_) => {
|
||||
|
@ -149,28 +153,57 @@ pub fn call_int64<'ctx>(
|
|||
|
||||
ctx.builder
|
||||
.build_float_to_signed_int(n.into_float_value(), ctx.ctx.i64_type(), "fptosi")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
BasicTypeEnum::PointerType(_) if n_ty.obj_id(&ctx.unifier).is_some_and(|id| id == PRIMITIVE_DEF_IDS.ndarray) => {
|
||||
let (elem_ty, _) = unpack_ndarray_var_tys(&mut ctx.unifier, n_ty);
|
||||
|
||||
let ndarray = ndarray_elementwise_unaryop_impl(
|
||||
generator,
|
||||
ctx,
|
||||
ctx.primitives.int64,
|
||||
None,
|
||||
NDArrayValue::from_ptr_val(
|
||||
n.into_pointer_value(),
|
||||
llvm_usize,
|
||||
None,
|
||||
),
|
||||
|generator, ctx, val| {
|
||||
call_int64(
|
||||
generator,
|
||||
ctx,
|
||||
(elem_ty, val),
|
||||
)
|
||||
},
|
||||
)?;
|
||||
|
||||
ndarray.as_ptr_value().into()
|
||||
}
|
||||
|
||||
_ => unsupported_type(ctx, "int64", &[n_ty])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Invokes the `uint32` builtin function.
|
||||
pub fn call_uint32<'ctx>(
|
||||
pub fn call_uint32<'ctx, G: CodeGenerator + ?Sized>(
|
||||
generator: &mut G,
|
||||
ctx: &mut CodeGenContext<'ctx, '_>,
|
||||
n: (Type, BasicValueEnum<'ctx>),
|
||||
) -> IntValue<'ctx> {
|
||||
) -> Result<BasicValueEnum<'ctx>, String> {
|
||||
let llvm_i32 = ctx.ctx.i32_type();
|
||||
let llvm_usize = generator.get_size_type(ctx.ctx);
|
||||
|
||||
let (n_ty, n) = n;
|
||||
|
||||
match n.get_type() {
|
||||
Ok(match n.get_type() {
|
||||
BasicTypeEnum::IntType(int_ty) if matches!(int_ty.get_bit_width(), 1 | 8) => {
|
||||
debug_assert!(ctx.unifier.unioned(n_ty, ctx.primitives.bool));
|
||||
|
||||
ctx.builder
|
||||
.build_int_z_extend(n.into_int_value(), llvm_i32, "zext")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
|
@ -180,7 +213,7 @@ pub fn call_uint32<'ctx>(
|
|||
ctx.primitives.uint32,
|
||||
].iter().any(|ty| ctx.unifier.unioned(n_ty, *ty)));
|
||||
|
||||
n.into_int_value()
|
||||
n
|
||||
}
|
||||
|
||||
BasicTypeEnum::IntType(int_ty) if int_ty.get_bit_width() == 64 => {
|
||||
|
@ -191,6 +224,7 @@ pub fn call_uint32<'ctx>(
|
|||
|
||||
ctx.builder
|
||||
.build_int_truncate(n.into_int_value(), llvm_i32, "trunc")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
|
@ -216,24 +250,50 @@ pub fn call_uint32<'ctx>(
|
|||
to_int32,
|
||||
"conv",
|
||||
)
|
||||
.map(BasicValueEnum::into_int_value)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
BasicTypeEnum::PointerType(_) if n_ty.obj_id(&ctx.unifier).is_some_and(|id| id == PRIMITIVE_DEF_IDS.ndarray) => {
|
||||
let (elem_ty, _) = unpack_ndarray_var_tys(&mut ctx.unifier, n_ty);
|
||||
|
||||
let ndarray = ndarray_elementwise_unaryop_impl(
|
||||
generator,
|
||||
ctx,
|
||||
ctx.primitives.uint32,
|
||||
None,
|
||||
NDArrayValue::from_ptr_val(
|
||||
n.into_pointer_value(),
|
||||
llvm_usize,
|
||||
None,
|
||||
),
|
||||
|generator, ctx, val| {
|
||||
call_uint32(
|
||||
generator,
|
||||
ctx,
|
||||
(elem_ty, val),
|
||||
)
|
||||
},
|
||||
)?;
|
||||
|
||||
ndarray.as_ptr_value().into()
|
||||
}
|
||||
|
||||
_ => unsupported_type(ctx, "uint32", &[n_ty])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Invokes the `uint64` builtin function.
|
||||
pub fn call_uint64<'ctx>(
|
||||
pub fn call_uint64<'ctx, G: CodeGenerator + ?Sized>(
|
||||
generator: &mut G,
|
||||
ctx: &mut CodeGenContext<'ctx, '_>,
|
||||
n: (Type, BasicValueEnum<'ctx>),
|
||||
) -> IntValue<'ctx> {
|
||||
) -> Result<BasicValueEnum<'ctx>, String> {
|
||||
let llvm_i64 = ctx.ctx.i64_type();
|
||||
let llvm_usize = generator.get_size_type(ctx.ctx);
|
||||
|
||||
let (n_ty, n) = n;
|
||||
|
||||
match n.get_type() {
|
||||
Ok(match n.get_type() {
|
||||
BasicTypeEnum::IntType(int_ty) if matches!(int_ty.get_bit_width(), 1 | 8 | 32) => {
|
||||
debug_assert!([
|
||||
ctx.primitives.bool,
|
||||
|
@ -244,10 +304,12 @@ pub fn call_uint64<'ctx>(
|
|||
if ctx.unifier.unioned(n_ty, ctx.primitives.int32) {
|
||||
ctx.builder
|
||||
.build_int_s_extend(n.into_int_value(), llvm_i64, "sext")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
} else {
|
||||
ctx.builder
|
||||
.build_int_z_extend(n.into_int_value(), llvm_i64, "zext")
|
||||
.map(Into::into)
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
@ -258,7 +320,7 @@ pub fn call_uint64<'ctx>(
|
|||
ctx.primitives.uint64,
|
||||
].iter().any(|ty| ctx.unifier.unioned(n_ty, *ty)));
|
||||
|
||||
n.into_int_value()
|
||||
n
|
||||
}
|
||||
|
||||
BasicTypeEnum::FloatType(_) => {
|
||||
|
@ -278,12 +340,36 @@ pub fn call_uint64<'ctx>(
|
|||
|
||||
ctx.builder
|
||||
.build_select(val_gez, to_uint64, to_int64, "conv")
|
||||
.map(BasicValueEnum::into_int_value)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
BasicTypeEnum::PointerType(_) if n_ty.obj_id(&ctx.unifier).is_some_and(|id| id == PRIMITIVE_DEF_IDS.ndarray) => {
|
||||
let (elem_ty, _) = unpack_ndarray_var_tys(&mut ctx.unifier, n_ty);
|
||||
|
||||
let ndarray = ndarray_elementwise_unaryop_impl(
|
||||
generator,
|
||||
ctx,
|
||||
ctx.primitives.uint64,
|
||||
None,
|
||||
NDArrayValue::from_ptr_val(
|
||||
n.into_pointer_value(),
|
||||
llvm_usize,
|
||||
None,
|
||||
),
|
||||
|generator, ctx, val| {
|
||||
call_uint64(
|
||||
generator,
|
||||
ctx,
|
||||
(elem_ty, val),
|
||||
)
|
||||
},
|
||||
)?;
|
||||
|
||||
ndarray.as_ptr_value().into()
|
||||
}
|
||||
|
||||
_ => unsupported_type(ctx, "uint64", &[n_ty])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Invokes the `float` builtin function.
|
||||
|
|
|
@ -589,8 +589,8 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
name: "int64".into(),
|
||||
simple_name: "int64".into(),
|
||||
signature: primitives.1.add_ty(TypeEnum::TFunc(FunSignature {
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_ty.0, default_value: None }],
|
||||
ret: int64,
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_or_ndarray_ty.0, default_value: None }],
|
||||
ret: num_or_ndarray_ty.0,
|
||||
vars: var_map.clone(),
|
||||
})),
|
||||
var_id: Vec::default(),
|
||||
|
@ -602,7 +602,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
let arg_ty = fun.0.args[0].ty;
|
||||
let arg = args[0].1.clone().to_basic_value_enum(ctx, generator, arg_ty)?;
|
||||
|
||||
Ok(Some(builtin_fns::call_int64(ctx, (arg_ty, arg)).into()))
|
||||
Ok(Some(builtin_fns::call_int64(generator, ctx, (arg_ty, arg))?))
|
||||
},
|
||||
)))),
|
||||
loc: None,
|
||||
|
@ -611,8 +611,8 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
name: "uint32".into(),
|
||||
simple_name: "uint32".into(),
|
||||
signature: primitives.1.add_ty(TypeEnum::TFunc(FunSignature {
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_ty.0, default_value: None }],
|
||||
ret: uint32,
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_or_ndarray_ty.0, default_value: None }],
|
||||
ret: num_or_ndarray_ty.0,
|
||||
vars: var_map.clone(),
|
||||
})),
|
||||
var_id: Vec::default(),
|
||||
|
@ -624,7 +624,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
let arg_ty = fun.0.args[0].ty;
|
||||
let arg = args[0].1.clone().to_basic_value_enum(ctx, generator, arg_ty)?;
|
||||
|
||||
Ok(Some(builtin_fns::call_uint32(ctx, (arg_ty, arg)).into()))
|
||||
Ok(Some(builtin_fns::call_uint32(generator, ctx, (arg_ty, arg))?))
|
||||
},
|
||||
)))),
|
||||
loc: None,
|
||||
|
@ -633,8 +633,8 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
name: "uint64".into(),
|
||||
simple_name: "uint64".into(),
|
||||
signature: primitives.1.add_ty(TypeEnum::TFunc(FunSignature {
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_ty.0, default_value: None }],
|
||||
ret: uint64,
|
||||
args: vec![FuncArg { name: "n".into(), ty: num_or_ndarray_ty.0, default_value: None }],
|
||||
ret: num_or_ndarray_ty.0,
|
||||
vars: var_map.clone(),
|
||||
})),
|
||||
var_id: Vec::default(),
|
||||
|
@ -646,7 +646,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
|
|||
let arg_ty = fun.0.args[0].ty;
|
||||
let arg = args[0].1.clone().to_basic_value_enum(ctx, generator, arg_ty)?;
|
||||
|
||||
Ok(Some(builtin_fns::call_uint64(ctx, (arg_ty, arg)).into()))
|
||||
Ok(Some(builtin_fns::call_uint64(generator, ctx, (arg_ty, arg))?))
|
||||
},
|
||||
)))),
|
||||
loc: None,
|
||||
|
|
|
@ -14,17 +14,7 @@ use crate::{
|
|||
},
|
||||
};
|
||||
use itertools::{Itertools, izip};
|
||||
use nac3parser::ast::{
|
||||
self,
|
||||
fold::{self, Fold},
|
||||
Arguments,
|
||||
Comprehension,
|
||||
ExprContext,
|
||||
ExprKind,
|
||||
Located,
|
||||
Location,
|
||||
StrRef
|
||||
};
|
||||
use nac3parser::ast::{self, fold::{self, Fold}, Arguments, Comprehension, ExprContext, ExprKind, Located, Location, StrRef};
|
||||
|
||||
#[cfg(test)]
|
||||
mod test;
|
||||
|
@ -862,20 +852,17 @@ impl<'a> Inferencer<'a> {
|
|||
}
|
||||
|
||||
if id == &"int32".into() && args.len() == 1 {
|
||||
let int32_ty = self.primitives.int32;
|
||||
|
||||
let arg0 = self.fold_expr(args.remove(0))?;
|
||||
let arg0_ty = arg0.custom.unwrap();
|
||||
|
||||
let ret = if arg0_ty.obj_id(self.unifier).is_some_and(|id| id == PRIMITIVE_DEF_IDS.ndarray) {
|
||||
let (_, ndarray_ndims) = unpack_ndarray_var_tys(self.unifier, arg0_ty);
|
||||
|
||||
make_ndarray_ty(
|
||||
self.unifier,
|
||||
self.primitives,
|
||||
Some(self.primitives.int32),
|
||||
Some(ndarray_ndims),
|
||||
)
|
||||
make_ndarray_ty(self.unifier, self.primitives, Some(int32_ty), Some(ndarray_ndims))
|
||||
} else {
|
||||
self.primitives.int32
|
||||
int32_ty
|
||||
};
|
||||
|
||||
let custom = self.unifier.add_ty(TypeEnum::TFunc(FunSignature {
|
||||
|
@ -905,66 +892,83 @@ impl<'a> Inferencer<'a> {
|
|||
}))
|
||||
}
|
||||
|
||||
// int64 is special because its argument can be a constant larger than int32
|
||||
if id == &"int64".into() && args.len() == 1 {
|
||||
if let ExprKind::Constant { value: ast::Constant::Int(val), kind } =
|
||||
&args[0].node
|
||||
{
|
||||
let custom = Some(self.primitives.int64);
|
||||
let v: Result<i64, _> = (*val).try_into();
|
||||
return if v.is_ok() {
|
||||
Ok(Some(Located {
|
||||
location: args[0].location,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
value: ast::Constant::Int(*val),
|
||||
kind: kind.clone(),
|
||||
},
|
||||
}))
|
||||
} else {
|
||||
report_error("Integer out of bound", args[0].location)
|
||||
// int64, uint32 and uint64 are special because their argument can be a constant outside the
|
||||
// range of int32s
|
||||
if [
|
||||
"int64",
|
||||
"uint32",
|
||||
"uint64",
|
||||
].iter().any(|fun_id| id == &(*fun_id).into()) && args.len() == 1 {
|
||||
let target_ty = if id == &"int64".into() {
|
||||
self.primitives.int64
|
||||
} else if id == &"uint32".into() {
|
||||
self.primitives.uint32
|
||||
} else if id == &"uint64".into() {
|
||||
self.primitives.uint64
|
||||
} else { unreachable!() };
|
||||
|
||||
let arg0 = self.fold_expr(args.remove(0))?;
|
||||
let arg0_ty = arg0.custom.unwrap();
|
||||
|
||||
let ret = if arg0_ty.obj_id(self.unifier).is_some_and(|id| id == PRIMITIVE_DEF_IDS.ndarray) {
|
||||
let (_, ndarray_ndims) = unpack_ndarray_var_tys(self.unifier, arg0_ty);
|
||||
|
||||
make_ndarray_ty(self.unifier, self.primitives, Some(target_ty), Some(ndarray_ndims))
|
||||
} else {
|
||||
if let ExprKind::Constant {
|
||||
value: ast::Constant::Int(val),
|
||||
kind
|
||||
} = &arg0.node {
|
||||
let conv_is_ok = if self.unifier.unioned(target_ty, self.primitives.int64) {
|
||||
i64::try_from(*val).is_ok()
|
||||
} else if self.unifier.unioned(target_ty, self.primitives.uint32) {
|
||||
u32::try_from(*val).is_ok()
|
||||
} else if self.unifier.unioned(target_ty, self.primitives.uint64) {
|
||||
u64::try_from(*val).is_ok()
|
||||
} else { unreachable!() };
|
||||
|
||||
return if conv_is_ok {
|
||||
Ok(Some(Located {
|
||||
location: arg0.location,
|
||||
custom: Some(target_ty),
|
||||
node: ExprKind::Constant {
|
||||
value: ast::Constant::Int(*val),
|
||||
kind: kind.clone(),
|
||||
},
|
||||
}))
|
||||
} else {
|
||||
report_error("Integer out of bound", arg0.location)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if id == &"uint32".into() && args.len() == 1 {
|
||||
if let ExprKind::Constant { value: ast::Constant::Int(val), kind } =
|
||||
&args[0].node
|
||||
{
|
||||
let custom = Some(self.primitives.uint32);
|
||||
let v: Result<u32, _> = (*val).try_into();
|
||||
return if v.is_ok() {
|
||||
Ok(Some(Located {
|
||||
location: args[0].location,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
value: ast::Constant::Int(*val),
|
||||
kind: kind.clone(),
|
||||
},
|
||||
}))
|
||||
} else {
|
||||
report_error("Integer out of bound", args[0].location)
|
||||
}
|
||||
}
|
||||
}
|
||||
if id == &"uint64".into() && args.len() == 1 {
|
||||
if let ExprKind::Constant { value: ast::Constant::Int(val), kind } =
|
||||
&args[0].node
|
||||
{
|
||||
let custom = Some(self.primitives.uint64);
|
||||
let v: Result<u64, _> = (*val).try_into();
|
||||
return if v.is_ok() {
|
||||
Ok(Some(Located {
|
||||
location: args[0].location,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
value: ast::Constant::Int(*val),
|
||||
kind: kind.clone(),
|
||||
},
|
||||
}))
|
||||
} else {
|
||||
report_error("Integer out of bound", args[0].location)
|
||||
}
|
||||
}
|
||||
|
||||
target_ty
|
||||
};
|
||||
|
||||
let custom = self.unifier.add_ty(TypeEnum::TFunc(FunSignature {
|
||||
args: vec![
|
||||
FuncArg {
|
||||
name: "n".into(),
|
||||
ty: arg0.custom.unwrap(),
|
||||
default_value: None,
|
||||
},
|
||||
],
|
||||
ret,
|
||||
vars: VarMap::new(),
|
||||
}));
|
||||
|
||||
return Ok(Some(Located {
|
||||
location,
|
||||
custom: Some(ret),
|
||||
node: ExprKind::Call {
|
||||
func: Box::new(Located {
|
||||
custom: Some(custom),
|
||||
location: func.location,
|
||||
node: ExprKind::Name { id: *id, ctx: ctx.clone() },
|
||||
}),
|
||||
args: vec![arg0],
|
||||
keywords: vec![],
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
// 1-argument ndarray n-dimensional creation functions
|
||||
|
|
|
@ -6,6 +6,18 @@ def output_bool(x: bool):
|
|||
def output_int32(x: int32):
|
||||
...
|
||||
|
||||
@extern
|
||||
def output_int64(x: int64):
|
||||
...
|
||||
|
||||
@extern
|
||||
def output_uint32(x: uint32):
|
||||
...
|
||||
|
||||
@extern
|
||||
def output_uint64(x: uint64):
|
||||
...
|
||||
|
||||
@extern
|
||||
def output_float64(x: float):
|
||||
...
|
||||
|
@ -24,6 +36,21 @@ def output_ndarray_int32_2(n: ndarray[int32, Literal[2]]):
|
|||
for c in range(len(n[r])):
|
||||
output_int32(n[r][c])
|
||||
|
||||
def output_ndarray_int64_2(n: ndarray[int64, Literal[2]]):
|
||||
for r in range(len(n)):
|
||||
for c in range(len(n[r])):
|
||||
output_int64(n[r][c])
|
||||
|
||||
def output_ndarray_uint32_2(n: ndarray[uint32, Literal[2]]):
|
||||
for r in range(len(n)):
|
||||
for c in range(len(n[r])):
|
||||
output_uint32(n[r][c])
|
||||
|
||||
def output_ndarray_uint64_2(n: ndarray[uint64, Literal[2]]):
|
||||
for r in range(len(n)):
|
||||
for c in range(len(n[r])):
|
||||
output_uint64(n[r][c])
|
||||
|
||||
def output_ndarray_float_1(n: ndarray[float, Literal[1]]):
|
||||
for i in range(len(n)):
|
||||
output_float64(n[i])
|
||||
|
@ -656,96 +683,120 @@ def test_ndarray_int32():
|
|||
output_ndarray_float_2(x)
|
||||
output_ndarray_int32_2(y)
|
||||
|
||||
def test_ndarray_int64():
|
||||
x = np_identity(2)
|
||||
y = int64(x)
|
||||
|
||||
output_ndarray_float_2(x)
|
||||
output_ndarray_int64_2(y)
|
||||
|
||||
def test_ndarray_uint32():
|
||||
x = np_identity(2)
|
||||
y = uint32(x)
|
||||
|
||||
output_ndarray_float_2(x)
|
||||
output_ndarray_uint32_2(y)
|
||||
|
||||
def test_ndarray_uint64():
|
||||
x = np_identity(2)
|
||||
y = uint64(x)
|
||||
|
||||
output_ndarray_float_2(x)
|
||||
output_ndarray_uint64_2(y)
|
||||
|
||||
def run() -> int32:
|
||||
# test_ndarray_ctor()
|
||||
# test_ndarray_empty()
|
||||
# test_ndarray_zeros()
|
||||
# test_ndarray_ones()
|
||||
# test_ndarray_full()
|
||||
# test_ndarray_eye()
|
||||
# test_ndarray_identity()
|
||||
# test_ndarray_fill()
|
||||
# test_ndarray_copy()
|
||||
# test_ndarray_neg_idx()
|
||||
# test_ndarray_add()
|
||||
# test_ndarray_add_broadcast()
|
||||
# test_ndarray_add_broadcast_lhs_scalar()
|
||||
# test_ndarray_add_broadcast_rhs_scalar()
|
||||
# test_ndarray_iadd()
|
||||
# test_ndarray_iadd_broadcast()
|
||||
# test_ndarray_iadd_broadcast_scalar()
|
||||
# test_ndarray_sub()
|
||||
# test_ndarray_sub_broadcast()
|
||||
# test_ndarray_sub_broadcast_lhs_scalar()
|
||||
# test_ndarray_sub_broadcast_rhs_scalar()
|
||||
# test_ndarray_isub()
|
||||
# test_ndarray_isub_broadcast()
|
||||
# test_ndarray_isub_broadcast_scalar()
|
||||
# test_ndarray_mul()
|
||||
# test_ndarray_mul_broadcast()
|
||||
# test_ndarray_mul_broadcast_lhs_scalar()
|
||||
# test_ndarray_mul_broadcast_rhs_scalar()
|
||||
# test_ndarray_imul()
|
||||
# test_ndarray_imul_broadcast()
|
||||
# test_ndarray_imul_broadcast_scalar()
|
||||
# test_ndarray_truediv()
|
||||
# test_ndarray_truediv_broadcast()
|
||||
# test_ndarray_truediv_broadcast_lhs_scalar()
|
||||
# test_ndarray_truediv_broadcast_rhs_scalar()
|
||||
# test_ndarray_itruediv()
|
||||
# test_ndarray_itruediv_broadcast()
|
||||
# test_ndarray_itruediv_broadcast_scalar()
|
||||
# test_ndarray_floordiv()
|
||||
# test_ndarray_floordiv_broadcast()
|
||||
# test_ndarray_floordiv_broadcast_lhs_scalar()
|
||||
# test_ndarray_floordiv_broadcast_rhs_scalar()
|
||||
# test_ndarray_ifloordiv()
|
||||
# test_ndarray_ifloordiv_broadcast()
|
||||
# test_ndarray_ifloordiv_broadcast_scalar()
|
||||
# test_ndarray_mod()
|
||||
# test_ndarray_mod_broadcast()
|
||||
# test_ndarray_mod_broadcast_lhs_scalar()
|
||||
# test_ndarray_mod_broadcast_rhs_scalar()
|
||||
# test_ndarray_imod()
|
||||
# test_ndarray_imod_broadcast()
|
||||
# test_ndarray_imod_broadcast_scalar()
|
||||
# test_ndarray_pow()
|
||||
# test_ndarray_pow_broadcast()
|
||||
# test_ndarray_pow_broadcast_lhs_scalar()
|
||||
# test_ndarray_pow_broadcast_rhs_scalar()
|
||||
# test_ndarray_ipow()
|
||||
# test_ndarray_ipow_broadcast()
|
||||
# test_ndarray_ipow_broadcast_scalar()
|
||||
# test_ndarray_matmul()
|
||||
# test_ndarray_imatmul()
|
||||
# test_ndarray_pos()
|
||||
# test_ndarray_neg()
|
||||
# test_ndarray_inv()
|
||||
# test_ndarray_eq()
|
||||
# test_ndarray_eq_broadcast()
|
||||
# test_ndarray_eq_broadcast_lhs_scalar()
|
||||
# test_ndarray_eq_broadcast_rhs_scalar()
|
||||
# test_ndarray_ne()
|
||||
# test_ndarray_ne_broadcast()
|
||||
# test_ndarray_ne_broadcast_lhs_scalar()
|
||||
# test_ndarray_ne_broadcast_rhs_scalar()
|
||||
# test_ndarray_lt()
|
||||
# test_ndarray_lt_broadcast()
|
||||
# test_ndarray_lt_broadcast_lhs_scalar()
|
||||
# test_ndarray_lt_broadcast_rhs_scalar()
|
||||
# test_ndarray_lt()
|
||||
# test_ndarray_le_broadcast()
|
||||
# test_ndarray_le_broadcast_lhs_scalar()
|
||||
# test_ndarray_le_broadcast_rhs_scalar()
|
||||
# test_ndarray_gt()
|
||||
# test_ndarray_gt_broadcast()
|
||||
# test_ndarray_gt_broadcast_lhs_scalar()
|
||||
# test_ndarray_gt_broadcast_rhs_scalar()
|
||||
# test_ndarray_gt()
|
||||
# test_ndarray_ge_broadcast()
|
||||
# test_ndarray_ge_broadcast_lhs_scalar()
|
||||
# test_ndarray_ge_broadcast_rhs_scalar()
|
||||
test_ndarray_ctor()
|
||||
test_ndarray_empty()
|
||||
test_ndarray_zeros()
|
||||
test_ndarray_ones()
|
||||
test_ndarray_full()
|
||||
test_ndarray_eye()
|
||||
test_ndarray_identity()
|
||||
test_ndarray_fill()
|
||||
test_ndarray_copy()
|
||||
test_ndarray_neg_idx()
|
||||
test_ndarray_add()
|
||||
test_ndarray_add_broadcast()
|
||||
test_ndarray_add_broadcast_lhs_scalar()
|
||||
test_ndarray_add_broadcast_rhs_scalar()
|
||||
test_ndarray_iadd()
|
||||
test_ndarray_iadd_broadcast()
|
||||
test_ndarray_iadd_broadcast_scalar()
|
||||
test_ndarray_sub()
|
||||
test_ndarray_sub_broadcast()
|
||||
test_ndarray_sub_broadcast_lhs_scalar()
|
||||
test_ndarray_sub_broadcast_rhs_scalar()
|
||||
test_ndarray_isub()
|
||||
test_ndarray_isub_broadcast()
|
||||
test_ndarray_isub_broadcast_scalar()
|
||||
test_ndarray_mul()
|
||||
test_ndarray_mul_broadcast()
|
||||
test_ndarray_mul_broadcast_lhs_scalar()
|
||||
test_ndarray_mul_broadcast_rhs_scalar()
|
||||
test_ndarray_imul()
|
||||
test_ndarray_imul_broadcast()
|
||||
test_ndarray_imul_broadcast_scalar()
|
||||
test_ndarray_truediv()
|
||||
test_ndarray_truediv_broadcast()
|
||||
test_ndarray_truediv_broadcast_lhs_scalar()
|
||||
test_ndarray_truediv_broadcast_rhs_scalar()
|
||||
test_ndarray_itruediv()
|
||||
test_ndarray_itruediv_broadcast()
|
||||
test_ndarray_itruediv_broadcast_scalar()
|
||||
test_ndarray_floordiv()
|
||||
test_ndarray_floordiv_broadcast()
|
||||
test_ndarray_floordiv_broadcast_lhs_scalar()
|
||||
test_ndarray_floordiv_broadcast_rhs_scalar()
|
||||
test_ndarray_ifloordiv()
|
||||
test_ndarray_ifloordiv_broadcast()
|
||||
test_ndarray_ifloordiv_broadcast_scalar()
|
||||
test_ndarray_mod()
|
||||
test_ndarray_mod_broadcast()
|
||||
test_ndarray_mod_broadcast_lhs_scalar()
|
||||
test_ndarray_mod_broadcast_rhs_scalar()
|
||||
test_ndarray_imod()
|
||||
test_ndarray_imod_broadcast()
|
||||
test_ndarray_imod_broadcast_scalar()
|
||||
test_ndarray_pow()
|
||||
test_ndarray_pow_broadcast()
|
||||
test_ndarray_pow_broadcast_lhs_scalar()
|
||||
test_ndarray_pow_broadcast_rhs_scalar()
|
||||
test_ndarray_ipow()
|
||||
test_ndarray_ipow_broadcast()
|
||||
test_ndarray_ipow_broadcast_scalar()
|
||||
test_ndarray_matmul()
|
||||
test_ndarray_imatmul()
|
||||
test_ndarray_pos()
|
||||
test_ndarray_neg()
|
||||
test_ndarray_inv()
|
||||
test_ndarray_eq()
|
||||
test_ndarray_eq_broadcast()
|
||||
test_ndarray_eq_broadcast_lhs_scalar()
|
||||
test_ndarray_eq_broadcast_rhs_scalar()
|
||||
test_ndarray_ne()
|
||||
test_ndarray_ne_broadcast()
|
||||
test_ndarray_ne_broadcast_lhs_scalar()
|
||||
test_ndarray_ne_broadcast_rhs_scalar()
|
||||
test_ndarray_lt()
|
||||
test_ndarray_lt_broadcast()
|
||||
test_ndarray_lt_broadcast_lhs_scalar()
|
||||
test_ndarray_lt_broadcast_rhs_scalar()
|
||||
test_ndarray_lt()
|
||||
test_ndarray_le_broadcast()
|
||||
test_ndarray_le_broadcast_lhs_scalar()
|
||||
test_ndarray_le_broadcast_rhs_scalar()
|
||||
test_ndarray_gt()
|
||||
test_ndarray_gt_broadcast()
|
||||
test_ndarray_gt_broadcast_lhs_scalar()
|
||||
test_ndarray_gt_broadcast_rhs_scalar()
|
||||
test_ndarray_gt()
|
||||
test_ndarray_ge_broadcast()
|
||||
test_ndarray_ge_broadcast_lhs_scalar()
|
||||
test_ndarray_ge_broadcast_rhs_scalar()
|
||||
|
||||
test_ndarray_int32()
|
||||
test_ndarray_int64()
|
||||
test_ndarray_uint32()
|
||||
test_ndarray_uint64()
|
||||
|
||||
return 0
|
||||
|
|
Loading…
Reference in New Issue