Esempio n. 1
0
 def visit_NativeFuncCall(self, node: gtir.NativeFuncCall) -> oir.NativeFuncCall:
     return oir.NativeFuncCall(
         func=node.func,
         args=self.visit(node.args),
         dtype=node.dtype,
         kind=node.kind,
         loc=node.loc,
     )
Esempio n. 2
0
def test_native_func_call():
    oir_node = oir.NativeFuncCall(
        func=common.NativeFunction.SQRT,
        args=[
            oir.FieldAccess(
                name="a",
                offset=common.CartesianOffset.zero(),
                dtype=common.DataType.FLOAT64,
            ),
        ],
    )
    result = OirToNpir().visit(
        oir_node,
        parallel_k=True,
        ctx=OirToNpir.ComputationContext(),
    )
    assert isinstance(result, npir.VectorExpression)
Esempio n. 3
0
 def visit_NativeFuncCall(self, node: gtir.NativeFuncCall, **kwargs: Any) -> oir.NativeFuncCall:
     return oir.NativeFuncCall(
         func=node.func, args=self.visit(node.args), dtype=node.dtype, kind=node.kind
     )