From 1024c508f891c7072bb1b6d3eda8d15b8c4c098b Mon Sep 17 00:00:00 2001 From: Stella Laurenzo Date: Mon, 29 Jun 2020 13:02:34 -0700 Subject: [PATCH] Move numpy compiler support to new directory. --- python/npcomp/compiler/extensions/__init__.py | 0 python/npcomp/compiler/extensions/numpy/__init__.py | 5 +++++ .../numpy/value_coder.py} | 4 ++-- python/npcomp/compiler/test_config.py | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 python/npcomp/compiler/extensions/__init__.py create mode 100644 python/npcomp/compiler/extensions/numpy/__init__.py rename python/npcomp/compiler/{value_coder_numpy.py => extensions/numpy/value_coder.py} (95%) diff --git a/python/npcomp/compiler/extensions/__init__.py b/python/npcomp/compiler/extensions/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/python/npcomp/compiler/extensions/numpy/__init__.py b/python/npcomp/compiler/extensions/numpy/__init__.py new file mode 100644 index 000000000..0f521b9f0 --- /dev/null +++ b/python/npcomp/compiler/extensions/numpy/__init__.py @@ -0,0 +1,5 @@ +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from .value_coder import * diff --git a/python/npcomp/compiler/value_coder_numpy.py b/python/npcomp/compiler/extensions/numpy/value_coder.py similarity index 95% rename from python/npcomp/compiler/value_coder_numpy.py rename to python/npcomp/compiler/extensions/numpy/value_coder.py index d3c8e3d2a..8add16666 100644 --- a/python/npcomp/compiler/value_coder_numpy.py +++ b/python/npcomp/compiler/extensions/numpy/value_coder.py @@ -8,8 +8,8 @@ from typing import Union from _npcomp.mlir import ir -from . import logging -from .interfaces import * +from ... import logging +from ...interfaces import * __all__ = [ "CreateNumpyValueCoder", diff --git a/python/npcomp/compiler/test_config.py b/python/npcomp/compiler/test_config.py index d63c85cb0..969a1ba5b 100644 --- a/python/npcomp/compiler/test_config.py +++ b/python/npcomp/compiler/test_config.py @@ -11,7 +11,7 @@ from .interfaces import * from .partial_eval_base import * from .target import * from .value_coder_base import * -from .value_coder_numpy import * +from .extensions import numpy as npc def create_import_dump_decorator(*, @@ -33,7 +33,7 @@ def create_import_dump_decorator(*, def create_test_config(target_factory: TargetFactory = GenericTarget64): value_coder = ValueCoderChain([ BuiltinsValueCoder(), - CreateNumpyValueCoder(), + npc.CreateNumpyValueCoder(), ]) pe_hook = build_default_partial_eval_hook()