Пример #1
0
def func(ctx, clean=False):
    wasm_cmake(EXPERIMENTS_FUNC_DIR,
               EXPERIMENTS_FUNC_BUILD_DIR,
               "mapper",
               clean=clean)

    wasm_file = join(EXPERIMENTS_FUNC_BUILD_DIR, "gene", "mapper.wasm")
    wasm_copy_upload("gene", "mapper", wasm_file)
Пример #2
0
def func(ctx, clean=False):
    wasm_cmake(EXPERIMENTS_FUNC_DIR,
               EXPERIMENTS_FUNC_BUILD_DIR,
               "image",
               clean=clean)

    wasm_file = join(EXPERIMENTS_FUNC_BUILD_DIR, "tf", "image.wasm")
    wasm_copy_upload("tf", "image", wasm_file)
Пример #3
0
def compile(ctx, user, func, clean=False, debug=False):
    """
    Compile a function
    """
    # Build the function (gets written to the build dir)
    # Will fail if compilation fails
    target = func
    wasm_cmake(FUNC_DIR, FUNC_BUILD_DIR, target, clean, debug)

    _copy_built_function(user, func)
Пример #4
0
def compile(ctx, user, func, clean=False, debug=False, ts=False, sgx=False):
    """
    Compile a function
    """

    # Typescript compilation
    if ts:
        return _ts_compile(func)

    # Build the function (gets written to the build dir)
    # Will fail if compilation fails
    target = func
    wasm_cmake(FUNC_DIR, FUNC_BUILD_DIR, target, clean, debug, sgx=sgx)

    _copy_built_function(user, func)
Пример #5
0
def user(ctx, user, clean=False, debug=False):
    """
    Compile all functions belonging to the given user
    """

    # Build all funcs for this user (will fail if any builds fail)
    target = "{}_all_funcs".format(user)
    wasm_cmake(FUNC_DIR, FUNC_BUILD_DIR, target, clean, debug)

    # Work out all the functions for this user (that we assume will have been built)
    for func_file in listdir(join(FUNC_BUILD_DIR, user)):
        name, ext = splitext(func_file)
        if ext != ".wasm":
            continue

        _copy_built_function(user, name)
Пример #6
0
def func(ctx, clean=False):
    wasm_cmake(
        EXPERIMENTS_FUNC_DIR,
        EXPERIMENTS_FUNC_BUILD_DIR,
        "polybench_all_funcs",
        clean=clean,
    )

    build_dir = join(EXPERIMENTS_FUNC_BUILD_DIR, "polybench")
    all_files = listdir(build_dir)
    wasm_files = [f for f in all_files if f.endswith(".wasm")]

    for wasm_file in wasm_files:
        func_name = wasm_file.replace(".wasm", "")
        full_file = join(build_dir, wasm_file)
        print("Uploading polybench/{} ({})".format(func_name, full_file))

        wasm_copy_upload("polybench", func_name, full_file)