Exemplo n.º 1
0
def run_models(flags, args):
    if flags.device_conf:
        device_conf = config_parser.parse_device_info(flags.device_conf)
        device.ArmLinuxDevice.set_devices(device_conf)

    run_devices = device.choose_devices(flags.target_abi, flags.target_socs)
    MaceLogger.info("Run on devices: %s" % run_devices)

    for device_id in run_devices:
        dev = device.create_device(flags.target_abi, device_id)
        run_models_for_device(flags, args, dev)
Exemplo n.º 2
0
def run_models(flags, args):
    if flags.device_conf:
        device_conf = config_parser.parse_device_info(flags.device_conf)
        device.ArmLinuxDevice.set_devices(device_conf)

    run_devices = device.choose_devices(flags.target_abi, flags.target_socs)
    MaceLogger.info("Run on devices: %s" % run_devices)

    for device_id in run_devices:
        dev = device.create_device(flags.target_abi, device_id)
        if len(flags.devices_to_run) > 0 and \
                device_id not in flags.devices_to_run.split(','):
            continue
        run_models_for_device(flags, args, dev)
Exemplo n.º 3
0
                        default="",
                        help="Environment vars: "
                        " MACE_CPP_MIN_VLOG_LEVEL=2,"
                        " MACE_OUT_OF_RANGE_CHECK=1, "
                        " MACE_OPENCL_PROFILING=1,"
                        " MACE_INTERNAL_STORAGE_PATH=/path/to,"
                        " LD_PRELOAD=/path/to")

    flgs, args = parser.parse_known_args()
    return flgs, args


if __name__ == "__main__":
    flags, args = parse_args()
    if flags.device_conf:
        device_conf = config_parser.parse_device_info(flags.device_conf)
        device.ArmLinuxDevice.set_devices(device_conf)

    target_abi = flags.target_abi.strip()
    target_name = flags.target_name.strip()
    envs = flags.envs.split(" ")

    # build
    build_dir = flags.build_dir + "/" + target_abi
    if flags.build:
        cmake_shell = os.path.abspath(os.path.dirname(
            __file__)) + "/../cmake/cmake-build-%s.sh" % target_abi
        os.environ["BUILD_DIR"] = build_dir
        device.execute("bash " + cmake_shell)

    # run