[clang] [HIP] Move HIP to the new driver by default (PR #123359)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 17 12:23:26 PST 2025


jhuber6 wrote:

@yxsamliu Here's the general problem, the `__hipRegisterManagedVar` call takes the following arguments.
```c
 __hipRegisterManagedVar(void ** handle, char *ManagedVarPtr, char *VarPtr, const char *VarName, size_t Size, unsigned Alignment)
```

But the struct that we store this information is (inherited from OpenMP) just the following:
```c
struct __tgt_offload_entry {                                                                                                                                                                             
   void    *addr;        
   char    *name;                                                                                                                           
   size_t  size;                                                                                                                   
   int32_t flags;                                                                                                                                                                                              
   int32_t data;                  
};
```
I'd like to avoid modifying this struct to avoid breaking ABI with OpenMP. Perhaps I should make `addr` a pointer to a struct and just GEP the two values.

https://github.com/llvm/llvm-project/pull/123359


More information about the cfe-commits mailing list