コード例 #1
0
ファイル: environment.py プロジェクト: lizecillie/numba
    def __init__(self, name, *args, **kws):
        self.name = name
        actual_default_pipeline = pipeline.ComposedPipelineStage(
            default_pipeline_order)
        self.pipelines = {
            self.default_pipeline : actual_default_pipeline,
            'type_infer' : pipeline.ComposedPipelineStage(
                default_type_infer_pipeline_order),
            'dummy_type_infer' : pipeline.ComposedPipelineStage(
                default_dummy_type_infer_pipeline_order),
            'compile' : pipeline.ComposedPipelineStage(
                default_compile_pipeline_order),
            'wrap_func' : pipeline.ComposedPipelineStage(
                default_numba_wrapper_pipeline_order),
            }
        self.context = NumbaContext()
        self.specializations = functions.FunctionCache(env=self)
        self.exports = PyccEnvironment()
        self.translation = self.TranslationEnvironment(self)
        self.debug = logger.getEffectiveLevel() < logging.DEBUG

        # FIXME: NumbaContext has up to now been used as a stand in
        # for NumbaEnvironment, so the following member definitions
        # should be moved into the environment, and the code that uses
        # them should be updated.
        context = self.context
        context.env = self
        context.numba_pipeline = actual_default_pipeline
        context.function_cache = self.specializations
        context.intrinsic_library = default_intrinsic_library(context)
        context.external_library = default_external_library(context)
        context.utility_library = default_utility_library(context)
        self.llvm_context = translate.LLVMContextManager()
コード例 #2
0
    def __init__(self, name, *args, **kws):
        self.name = name
        actual_default_pipeline = pipeline.ComposedPipelineStage(
            default_pipeline_order)
        self.pipelines = {
            self.default_pipeline:
            actual_default_pipeline,
            'normalize':
            pipeline.ComposedPipelineStage(default_normalize_order),
            'cf':
            pipeline.ComposedPipelineStage(default_cf_pipeline_order),
            'type_infer':
            pipeline.ComposedPipelineStage(default_type_infer_pipeline_order),
            'dummy_type_infer':
            pipeline.ComposedPipelineStage(
                default_dummy_type_infer_pipeline_order),
            'compile':
            pipeline.ComposedPipelineStage(default_compile_pipeline_order),
            'wrap_func':
            pipeline.ComposedPipelineStage(
                default_numba_wrapper_pipeline_order),
            'lower':
            pipeline.ComposedPipelineStage(default_numba_lower_pipeline_order),
            'late_translate':
            pipeline.ComposedPipelineStage(
                default_numba_late_translate_pipeline_order),
            'codegen':
            pipeline.ComposedPipelineStage(default_codegen_pipeline),
            'post_codegen':
            pipeline.ComposedPipelineStage(default_post_codegen_pipeline),
        }
        self.context = NumbaContext()
        self.specializations = functions.FunctionCache(env=self)
        self.exports = PyccEnvironment()
        self.translation = self.TranslationEnvironment(self)
        self.debug = logger.getEffectiveLevel() < logging.DEBUG

        # FIXME: NumbaContext has up to now been used as a stand in
        # for NumbaEnvironment, so the following member definitions
        # should be moved into the environment, and the code that uses
        # them should be updated.
        context = self.context
        context.env = self
        context.numba_pipeline = actual_default_pipeline
        context.function_cache = self.specializations
        context.intrinsic_library = default_intrinsic_library(context)
        context.external_library = default_external_library(context)
        context.utility_library = default_utility_library(context)
        self.llvm_context = translate.LLVMContextManager()
        self.annotation_blocks = []
コード例 #3
0
ファイル: decorators.py プロジェクト: KanzhiWu/numba
from numba import  pipeline, extension_type_inference
from .minivect import minitypes
from numba.utils import debugout
from numba.intrinsic import default_intrinsic_library
from numba.external import default_external_library
from numba.external.utility import default_utility_library
from numba import double, int_
import llvm.core as _lc

context = utils.get_minivect_context()
context.llvm_context = translate.LLVMContextManager()
context.numba_pipeline = pipeline.Pipeline
function_cache = context.function_cache = functions.FunctionCache(context)
context.intrinsic_library = default_intrinsic_library(context)
context.external_library = default_external_library(context)
context.utility_library = default_utility_library(context)
pipeline_env = pipeline.PipelineEnvironment.init_env(
    context, "Top-level compilation environment (in %s).\n" % __name__)

_EXPORTS_DOC = '''pycc environment

Includes flags, and modules for exported functions.

wrap - Boolean flag used to indicate that Python wrappers should be
generated for exported functions.

function_signature_map - Map from function names to type signatures
for the translated function (used for header generation).

function_module_map - Map from function names to LLVM modules that
define the translated function.