Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/xtc/backends/tvm/TVMCompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,18 @@ def build(
cmd = (
f"{cc_command(self._arch)} {sh_opts} {opts} "
f"{' '.join(object_fnames)} "
f"{packed_lib_fname}.a "
f"{relative_to(packed_lib_fname, output_dir)}.a "
f"-o {unpacked_lib_base}{ext}"
)
p = subprocess.run(
shlex.split(cmd),
text=True,
capture_output=True,
cwd=unpacked_lib_dir,
cwd=output_dir,
)
if p.returncode != 0:
raise RuntimeError(
f"Failed command {cmd} (cwd: {unpacked_lib_dir}:\n"
f"Failed command {cmd} (cwd: {output_dir}:\n"
f"{p.stdout}\n"
f"{p.stderr}\n"
)
Expand Down
7 changes: 7 additions & 0 deletions src/xtc/cli/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ def main():
parser.add_argument(
"--batch", type=int, default=defaults.batch, help="batch size for optimizer"
)
parser.add_argument(
"--module-type",
type=str,
choices=["shlib", "arlib", "csrc"],
default=defaults.module_type,
help="type of module",
)
parser.add_argument(
"--debug",
action=argparse.BooleanOptionalAction,
Expand Down
9 changes: 8 additions & 1 deletion src/xtc/search/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class ExplorationConfig:
descript: str | None = None
use_tensors: bool = False
progress_cls: str = "tqdm"
module_type: str = "shlib"

def __post_init__(self):
if self.graph_file is not None:
Expand Down Expand Up @@ -366,11 +367,17 @@ def compile_one(
if dump_file is None:
dump_file = f"{args.explore_dir}/payload_{ident}"
compile_args = dict(
shared_lib=True,
dump_file=dump_file,
bare_ptr=args.bare_ptr,
debug=args.debug_compile,
)
if args.module_type == "shlib":
compile_args.update(dict(shared_lib=True))
elif args.module_type == "arlib":
compile_args.update(dict(ar_lib=True))
else:
assert args.module_type == "csrc"
compile_args.update(dict(emit_c=True))
if args.dump:
compile_args.update(
dict(
Expand Down
Loading