diff --git a/hpvm/tools/hpvm-clang/main.py.in b/hpvm/tools/hpvm-clang/main.py.in index 9d327ff74d940675eb17c3db92871a2172989617..810cc575e63a820b4388780e45b47a5177df0df3 100644 --- a/hpvm/tools/hpvm-clang/main.py.in +++ b/hpvm/tools/hpvm-clang/main.py.in @@ -98,12 +98,16 @@ def compile_hpvm_c( _run_opt(hpvm_ll_file, llvm_ll_file, passes, pass_flags), link_hpvm_rt(link_bitcode_ + [llvm_ll_file], hpvm_rt_linked_file), ] - - if tensor_target != "nvdla": + if tensor_target == "nvdla": + # This doesn't generate a bitcode at all. + # Instead it generates hpvm-mod.nvdla and output.protobuf in *current* directory. + # We move them to the working directory. + commands.append(["mv", "hpvm-mod.nvdla", working_dir.as_posix()]) + commands.append(["mv", "output.protobuf", working_dir.as_posix()]) + else: commands.append( link_binary(hpvm_rt_linked_file, output_file, link_dirs, link_libs) ) - for command in commands: if verbose: print(" ".join(command))