Skip to content

Instantly share code, notes, and snippets.

@BruceDai003
Created May 9, 2024 05:57
Show Gist options
  • Save BruceDai003/734d40517adcb5ab070e254c5de4eadc to your computer and use it in GitHub Desktop.
Save BruceDai003/734d40517adcb5ab070e254c5de4eadc to your computer and use it in GitHub Desktop.
bash script to compile and run using iree
out=notes/mlir/mul_2
file=mul_2
iree-compile ${out}/${file}.mlir \
--iree-hal-target-backends=llvm-cpu \
--iree-hal-dump-executable-files-to=${out} \
-o ${out}/${file}.vmfb
# --iree-hal-cuda-llvm-target-arch=sm_80 \
# --dump-compilation-phases-to=${out} \
# nsys nvprof --print-gpu-trace \
iree-run-module \
--device=local-task \
--module=${out}/${file}.vmfb \
--function=main \
--input="4xf32=@${out}/input.npy" \
# --output="@${out}/output_cuda.npy"
# --input="4xf32=[0,1,2,3]" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment