[PATCH] D105191: [Clang][OpenMP] Add support for Static Device Libraries
Saiyedul Islam via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 14 04:26:31 PDT 2021
saiislam added a comment.
In D105191#2998372 <https://reviews.llvm.org/D105191#2998372>, @ye-luo wrote:
> the modf test still doesn't work. The issue was from unbundle.
> case 1 works.
>
> clang++ -fopenmp -fopenmp-targets=nvptx64 modf.cpp -c
> clang++ -fopenmp -fopenmp-targets=nvptx64 modf.o
>
> case 2
>
> clang++ -fopenmp -fopenmp-targets=nvptx64 -Xopenmp-target=nvptx64 -march=sm_80 modf.cpp -c
> clang++ -fopenmp -fopenmp-targets=nvptx64 -Xopenmp-target=nvptx64 -march=sm_80 modf.o
>
> doesn't work. The issue was a failure in unbundling
>
> "/soft/llvm/main-patched/bin/clang-offload-bundler" -type=o -targets=host-x86_64-unknown-linux-gnu,openmp-nvptx64-sm_80 -inputs=modf.o -outputs=/tmp/modf-99be57.o,/tmp/modf-88a9eb.cubin -unbundle -allow-missing-bundles
>
> ends up an empty cubin file. If I remove -sm_80 on the unbundle line
> It seems that we need to have sm_80 when the object file is created.
>
> When clang is compiled CLANG_OPENMP_NVPTX_DEFAULT_ARCH can be used to set the default sm_XX so it doesn't needs to be provided at compile time. If not set default is sm_35.
> So in general sm_XX is always known when the compiler is used for compiling.
Both cases 1 and 2 are working fine in my setup using these commands. I have sm_50, though.
If you think unbundler is the the issue, can you please tell what all bundles are inside modf.o in both cases with following command:
> clang-offload-bundler -type=o --inputs=modf.o --list
In my case it prints the following for case 2:
> /work/saiyedul/openmp-target/tests/math$ clang-offload-bundler -type=o --inputs=modf.o --list
> openmp-nvptx64-sm_50
> host-x86_64-unknown-linux-gnu
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105191/new/
https://reviews.llvm.org/D105191
More information about the cfe-commits
mailing list