Пример #1
0
yask_configuration.add('folding', (), callback=callback, impacts_jit=False)
yask_configuration.add('blockshape', (), callback=callback, impacts_jit=False)
yask_configuration.add('clustering', (), callback=callback, impacts_jit=False)
yask_configuration.add('options', None, impacts_jit=False)
yask_configuration.add('dump', None, impacts_jit=False)

env_vars_mapper = {
    'DEVITO_YASK_FOLDING': 'folding',
    'DEVITO_YASK_BLOCKING': 'blockshape',
    'DEVITO_YASK_CLUSTERING': 'clustering',
    'DEVITO_YASK_OPTIONS': 'options',
    'DEVITO_YASK_DUMP': 'dump'
}

add_sub_configuration(yask_configuration, env_vars_mapper)

# Add YASK-specific DLE modes
modes.add(
    Cpu64, {
        'noop': PlatformRewriter,
        'advanced': YaskRewriter,
        'speculative': YaskRewriter
    })

# The following used by backends.backendSelector
from devito.types import SparseFunction, SparseTimeFunction  # noqa
from devito.yask.types import CacheManager, Grid, Constant, Function, TimeFunction  # noqa
from devito.yask.operator import OperatorYASK as Operator  # noqa

log("Backend successfully initialized!")
Пример #2
0
yask_configuration = Parameters('yask')
yask_configuration.add('compiler', YaskCompiler())
callback = lambda i: eval(i) if i else ()
yask_configuration.add('folding', (), callback=callback, impacts_jit=False)
yask_configuration.add('blockshape', (), callback=callback, impacts_jit=False)
yask_configuration.add('clustering', (), callback=callback, impacts_jit=False)
yask_configuration.add('options', None, impacts_jit=False)
yask_configuration.add('dump', None, impacts_jit=False)

env_vars_mapper = {
    'DEVITO_YASK_FOLDING': 'folding',
    'DEVITO_YASK_BLOCKING': 'blockshape',
    'DEVITO_YASK_CLUSTERING': 'clustering',
    'DEVITO_YASK_OPTIONS': 'options',
    'DEVITO_YASK_DUMP': 'dump'
}

add_sub_configuration(yask_configuration, env_vars_mapper)

# Add YASK-specific DLE modes
modes.add(Cpu64, {'advanced': YaskRewriter,
                  'speculative': YaskRewriter})

# The following used by backends.backendSelector
from devito.types import SparseFunction, SparseTimeFunction  # noqa
from devito.yask.types import CacheManager, Grid, Constant, Function, TimeFunction  # noqa
from devito.yask.operator import OperatorYASK as Operator  # noqa

log("Backend successfully initialized!")
Пример #3
0
The ``core`` Devito backend is simply a "shadow" of the ``base`` backend,
common to all other backends. The ``core`` backend (and therefore the ``base``
backend as well) are used to run Devito on standard CPU architectures.
"""

from devito.archinfo import Cpu64, Intel64, Arm, Power, Device
from devito.dle import (CPU64Rewriter, Intel64Rewriter, ArmRewriter, PowerRewriter,
                        SpeculativeRewriter, DeviceOffloadingRewriter, modes)
from devito.parameters import Parameters, add_sub_configuration

core_configuration = Parameters('core')
env_vars_mapper = {}
add_sub_configuration(core_configuration, env_vars_mapper)

# Add core-specific DLE modes
modes.add(Cpu64, {'advanced': CPU64Rewriter,
                  'speculative': SpeculativeRewriter})
modes.add(Intel64, {'advanced': Intel64Rewriter,
                    'speculative': SpeculativeRewriter})
modes.add(Arm, {'advanced': ArmRewriter,
                'speculative': SpeculativeRewriter})
modes.add(Power, {'advanced': PowerRewriter,
                  'speculative': SpeculativeRewriter})
modes.add(Device, {'advanced': DeviceOffloadingRewriter,
                   'speculative': DeviceOffloadingRewriter})

# The following used by backends.backendSelector
from devito.core.operator import OperatorCore as Operator  # noqa
from devito.types.constant import *  # noqa
from devito.types.dense import *  # noqa
from devito.types.sparse import *  # noqa
from devito.types.basic import CacheManager  # noqa