示例#1
0
if configuration['platform'] is CPU64:
    configuration['platform'] = 'intel64'

try:
    import yask as yc
    # YASK compiler factories
    cfac = yc.yc_factory()
    nfac = yc.yc_node_factory()
    ofac = yc.yask_output_factory()
except ImportError:
    exit("Python YASK compiler bindings")

path = os.path.dirname(os.path.dirname(yc.__file__))
namespace['path'] = path
namespace['kernel-path'] = os.path.join(path, 'src', 'kernel')
namespace['yask-output-dir'] = make_tempdir('yask')
# The YASK compiler expects the generated code under:
# $YASK_OUTPUT_DIR/build/kernel/$stencil.$arch/gen/yask_stencil_code.hpp
namespace['yask-lib'] = os.path.join(namespace['yask-output-dir'], 'lib')
namespace['yask-pylib'] = os.path.join(namespace['yask-output-dir'], 'yask')
namespace['yask-codegen'] = lambda i, j, k: os.path.join(namespace['yask-output-dir'],
                                                         'build', 'kernel',
                                                         '%s.%s.%s' % (i, j, k), 'gen')
namespace['yask-codegen-file'] = 'yask_stencil_code.hpp'

# All dynamically generated Python modules are stored here
os.makedirs(namespace['yask-pylib'], exist_ok=True)
with open(os.path.join(namespace['yask-pylib'], '__init__.py'), 'w') as f:
    f.write('')
sys.path.append(os.path.join(namespace['yask-pylib']))
示例#2
0
def get_codepy_dir():
    """
    A deterministic temporary directory for the codepy cache.
    """
    return make_tempdir('codepy')
示例#3
0
文件: compiler.py 项目: opesci/devito
def get_codepy_dir():
    """A deterministic temporary directory for the codepy cache."""
    return make_tempdir('codepy')
示例#4
0
def get_jit_dir():
    """
    A deterministic temporary directory for jit-compiled objects.
    """
    return make_tempdir('jitcache')
示例#5
0
文件: compiler.py 项目: opesci/devito
def get_jit_dir():
    """A deterministic temporary directory for jit-compiled objects."""
    return make_tempdir('jitcache')