[libc-commits] [PATCH] D146994: [libc] Support setting 'native' GPU architecture for libc

Artem Belevich via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Mar 28 11:29:26 PDT 2023


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM in general.



================
Comment at: libc/cmake/modules/prepare_libc_gpu_build.cmake:76
+set(gpu_test_architecture "")
+if(LIBC_GPU_TEST_ARCHITECTURE)
+  set(gpu_test_architecture ${LIBC_GPU_TEST_ARCHITECTURE})
----------------
jhuber6 wrote:
> tra wrote:
> > Is that a singular architecture, or can we supply a list? 
> > 
> > We may want to be able to build for a set of user-specified GPUs and, if I can dream out loud, allow specifying which GPU to run them on, so I could just do `niunja check-libc-sm_70` and it would run the tests with CUDA_VISIBLE_DEVICES=<ID of sm_70 GPU>
> > 
> > 
> > 
> Right now it's a singular architecture. The reason for this is because the internal objects used for testing and the ones that will be exported via the `libcgpu.a` library are separate compilations. Since the existing `libc` testing architecture only ever expected a single executable, it was easiest to implement it this way. Basically, the `libcgpu.a` library contains `N` architectures packed into a single file and the internal testing implementation just builds for one. I don't think it's impossible to support what you're asking, it would just require a lot more CMake.
Can we build a set of per-GPU test executables and then just pick one of them to run libc tests? 






Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146994/new/

https://reviews.llvm.org/D146994



More information about the libc-commits mailing list