[Openmp-commits] [openmp] [libomptarget] [OMPT] Fixed return address computation for OMPT events. (PR #80498)
via Openmp-commits
openmp-commits at lists.llvm.org
Tue Feb 6 16:30:29 PST 2024
================
@@ -85,52 +93,70 @@ EXTERN int omp_get_initial_device(void) {
EXTERN void *omp_target_alloc(size_t Size, int DeviceNum) {
TIMESCOPE_WITH_DETAILS("dst_dev=" + std::to_string(DeviceNum) +
";size=" + std::to_string(Size));
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetAllocExplicit(Size, DeviceNum, TARGET_ALLOC_DEFAULT, __func__);
}
EXTERN void *llvm_omp_target_alloc_device(size_t Size, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetAllocExplicit(Size, DeviceNum, TARGET_ALLOC_DEVICE, __func__);
}
EXTERN void *llvm_omp_target_alloc_host(size_t Size, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetAllocExplicit(Size, DeviceNum, TARGET_ALLOC_HOST, __func__);
}
EXTERN void *llvm_omp_target_alloc_shared(size_t Size, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetAllocExplicit(Size, DeviceNum, TARGET_ALLOC_SHARED, __func__);
}
EXTERN void omp_target_free(void *Ptr, int DeviceNum) {
TIMESCOPE();
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetFreeExplicit(Ptr, DeviceNum, TARGET_ALLOC_DEFAULT, __func__);
}
EXTERN void llvm_omp_target_free_device(void *Ptr, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetFreeExplicit(Ptr, DeviceNum, TARGET_ALLOC_DEVICE, __func__);
}
EXTERN void llvm_omp_target_free_host(void *Ptr, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetFreeExplicit(Ptr, DeviceNum, TARGET_ALLOC_HOST, __func__);
}
EXTERN void llvm_omp_target_free_shared(void *Ptre, int DeviceNum) {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
return targetFreeExplicit(Ptre, DeviceNum, TARGET_ALLOC_SHARED, __func__);
}
-EXTERN void *llvm_omp_target_dynamic_shared_alloc() { return nullptr; }
-EXTERN void *llvm_omp_get_dynamic_shared() { return nullptr; }
+EXTERN void *llvm_omp_target_dynamic_shared_alloc() {
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
----------------
dhruvachak wrote:
> The lifetime ends with the next statement does it make sense here?
I agree but it's mostly to future-proof the entry point. If you definitely want me to remove it, let me know. I can then add a comment and remove it.
https://github.com/llvm/llvm-project/pull/80498
More information about the Openmp-commits
mailing list