[PATCH] D105191: [Clang][OpenMP] Add support for Static Device Libraries

Saiyedul Islam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 15 05:29:15 PDT 2021


saiislam added a comment.

In D105191#3001056 <https://reviews.llvm.org/D105191#3001056>, @ye-luo wrote:

> 1. modf works now.
>
> 2. if I modify the complile.sh
>
>   clang++ -fopenmp -fopenmp-targets=nvptx64 -c classA.cpp
>   rm -f libmylib.a
>   ar qc libmylib.a classA.o
>   ranlib libmylib.a
>   clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp -L. -lmylib
>   ./a.out
>
> doesn't work. I think the solution is adding sm_XX to the module name regardless of user command line.
>
> 3,  directly linking static archive doesn't work.
>
>   clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp libmylib.a
>
> CMake generates this style of link line. So this really needs to work.
>
> only the following case works right now.
>
>   clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp -L. -lmylib

Thanks for confirming that modf and this patch works with -l/-L options.

The option of adding sm_XX in Bundle Entry ID when user hasn't used -march flag, comes under command line simplification. I have a bunch of upcoming patches which will significantly simplify OpenMP command line for GPU offloading. But, don't you think this feature is different than supporting static device libraries and should be dealt separately?

Our plan was always to support SDLs using -l and -L options, as described in Greg Rodgers's presentation about static device libraries <https://www.youtube.com/watch?v=3FsYwEhtCaM> in last year's LLVM-CTH Workshop. It was also discussed in multi company meetings. We can explore supporting direct linking of SDLs as described by you, but it seems to me that it is out of scope of this patch. What do you think?

PS: We (mulit-company OpenMP-dev meetings) have been tracking this feature for a while and we would very much like it to be picked for llvm-13.


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