[llvm] [OFFLOAD] Remove weak from __kmpc_* calls and gather them in one header (PR #164613)
    Alex Duran via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Oct 23 02:17:57 PDT 2025
    
    
  
================
@@ -70,10 +70,28 @@ typedef struct kmp_task {
   int32_t part_id;
 } kmp_task_t;
 
-int32_t __kmpc_global_thread_num(void *) __attribute__((weak));
-bool __kmpc_omp_has_task_team(int32_t gtid) __attribute__((weak));
-void **__kmpc_omp_get_target_async_handle_ptr(int32_t gtid)
-    __attribute__((weak));
+// Implemented in libomp, they are called from within __tgt_* functions.
+int32_t __kmpc_global_thread_num(void *);
+bool __kmpc_omp_has_task_team(int32_t gtid);
+void **__kmpc_omp_get_target_async_handle_ptr(int32_t gtid);
+int __kmpc_get_target_offload(void);
+int __kmpc_get_target_offload(void);
+kmp_task_t *__kmpc_omp_task_alloc(ident_t *loc_ref, int32_t gtid, int32_t flags,
----------------
adurang wrote:
I see it's being used in libomp_helper_task_creation in OpenMP/API.cpp
https://github.com/llvm/llvm-project/pull/164613
    
    
More information about the llvm-commits
mailing list