[libc-commits] [PATCH] D146256: [libc] Enable integration tests targeting the GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Mar 17 10:31:19 PDT 2023


jhuber6 added a comment.

In D146256#4202584 <https://reviews.llvm.org/D146256#4202584>, @JonChesterfield wrote:

> Global ctor/dtor is tricky. I have a suspicion hip and openmp have done different things there. When to run the dtor is a challenge, and how many threads the ctors run with may have implementation divergence.

I guess in the context of the `loader` launching the kernel, a device constructor would just be a kernel called before the `main` and a destructor is after. The problem with HIP and OpenMP is that they want to do host stuff as well, so the ordering is weird since we need to run the "device" constructors after `main` has been called. It's certainly possible to implement, but it would need to be exported as a list of kernels to call, which is somewhat reinventing OpenMP and HIP.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146256



More information about the libc-commits mailing list