Skip to content

Is it possible to take MLIR generated by CUDA-to-CPU flow to the cpu-openmp executable? #406

Open
@ericxu233

Description

@ericxu233

I want to modify the MLIR generated by --cuda-lower --cpuify and then take it back to the compiler and generate the opemp executable. Is there a way to do that?

I tried the cgeist command like this:

/home/xuhanya1/CUDAtoX/Polygeist/build/bin/cgeist -fopenmp -O2 --function=* -c -O2 -I/home/xuhanya1/CUDAtoX/Polygeist/build/projects/openmp/runtime/src/ -resource-dir=/home/xuhanya1/CUDAtoX/Polygeist/build/lib/clang/18/ -I/home/xuhanya1/CUDAtoX/Polygeist/build/projects/openmp/runtime/src/ -I/usr/local/cuda/include/ --cuda-gpu-arch=sm_75 --cuda-path=/usr/local/cuda/ --polygeist-alternatives-mode=static -std=c++17 -I/home/xuhanya1/CUDAtoX/rodinia/common// -include my_timing.h -include my_verification.h -D_MY_COMPILER_NAME_=\"c7094f0e7bca.polygeist.mincut.inner-serialize=1.raise-scf-to-affine.scal-rep=0\" -DMY_VERIFICATION_DISABLE pathfinder.sme.no-opt.conf1.mlir -o pathfinder.o -I../util -v

However, it seems that it does nothing and the -v output looks like this:

clang version 18.0.0 (https://github.com/llvm/llvm-project.git 26eb4285b56edd8c897642078d91f16ff0fd3472)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/xuhanya1/CUDAtoX/Polygeist/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda/, version 12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions