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, )
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)
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 )