コード例 #1
0
ファイル: preprocess.py プロジェクト: ChrisCummins/phd
def clang_cl_args(target=CLANG_CL_TARGETS[0],
                  error_limit=0):
    """
    Get the Clang args to compile OpenCL.

    :return: Array of args.
    """
    libclc_include = fs.path(cfg.libclc(), 'generic', 'include')
    shim = smith.package_path(fs.path('share', 'include', 'opencl-shim.h'))

    # List of clang warnings to disable.
    disabled_warnings = [
        'ignored-pragmas',
        'implicit-function-declaration',
        'incompatible-library-redeclaration',
        'macro-redefined',
    ]

    return [
        '-I' + libclc_include,
        '-include', shim,
        '-target', target,
        '-ferror-limit={}'.format(error_limit),
        '-xcl'
    ] + ['-Wno-{}'.format(x) for x in disabled_warnings]
コード例 #2
0
ファイル: features.py プロジェクト: ChrisCummins/phd
def extra_args(use_shim=False):
    args = []
    if use_shim:
        args += [
            "-DSMITH_FEATURES",
            "-include",
            smith.package_path(fs.path('share', 'include', 'opencl-shim.h'))]
    return args