[Openmp-commits] [openmp] e4de6a6 - [OpenMP] [OMPT] A pointer to HostOpId should be passed in EMI callbacks. (#75574)
via Openmp-commits
openmp-commits at lists.llvm.org
Fri Dec 15 12:07:46 PST 2023
Author: dhruvachak
Date: 2023-12-15T12:07:42-08:00
New Revision: e4de6a602f4dbf189b0e2621b57932676300e16c
URL: https://github.com/llvm/llvm-project/commit/e4de6a602f4dbf189b0e2621b57932676300e16c
DIFF: https://github.com/llvm/llvm-project/commit/e4de6a602f4dbf189b0e2621b57932676300e16c.diff
LOG: [OpenMP] [OMPT] A pointer to HostOpId should be passed in EMI callbacks. (#75574)
With this change, TargetRegionOpId is no more used and hence deleted.
Added:
Modified:
openmp/libomptarget/include/OpenMP/OMPT/Interface.h
openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/include/OpenMP/OMPT/Interface.h b/openmp/libomptarget/include/OpenMP/OMPT/Interface.h
index 8c3ef105c49933..ed34cbed785bcf 100644
--- a/openmp/libomptarget/include/OpenMP/OMPT/Interface.h
+++ b/openmp/libomptarget/include/OpenMP/OMPT/Interface.h
@@ -195,9 +195,6 @@ class Interface {
/// Target task data representing the target task region
ompt_data_t *TargetTaskData = nullptr;
- /// Correlation id that is incremented with target operations
- uint64_t TargetRegionOpId = 1;
-
/// Used for marking begin of a data operation
void beginTargetDataOperation();
diff --git a/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp b/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
index f1a8ad0e3cafb7..da955e101956f4 100644
--- a/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
+++ b/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
@@ -86,7 +86,7 @@ void Interface::beginTargetDataAlloc(int64_t DeviceId, void *HstPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_begin, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_alloc, HstPtrBegin,
/* SrcDeviceNum */ omp_get_initial_device(), *TgtPtrBegin,
/* TgtDeviceNum */ DeviceId, Size, Code);
@@ -109,7 +109,7 @@ void Interface::endTargetDataAlloc(int64_t DeviceId, void *HstPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_end, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_alloc, HstPtrBegin,
/* SrcDeviceNum */ omp_get_initial_device(), *TgtPtrBegin,
/* TgtDeviceNum */ DeviceId, Size, Code);
@@ -125,7 +125,7 @@ void Interface::beginTargetDataSubmit(int64_t DeviceId, void *TgtPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_begin, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_transfer_to_device, HstPtrBegin,
/* SrcDeviceNum */ omp_get_initial_device(), TgtPtrBegin, DeviceId,
Size, Code);
@@ -148,7 +148,7 @@ void Interface::endTargetDataSubmit(int64_t DeviceId, void *TgtPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_end, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_transfer_to_device, HstPtrBegin,
/* SrcDeviceNum */ omp_get_initial_device(), TgtPtrBegin, DeviceId,
Size, Code);
@@ -163,7 +163,7 @@ void Interface::beginTargetDataDelete(int64_t DeviceId, void *TgtPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_begin, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_delete, TgtPtrBegin, DeviceId,
/* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ -1, /* Bytes */ 0, Code);
} else if (ompt_callback_target_data_op_fn) {
@@ -184,7 +184,7 @@ void Interface::endTargetDataDelete(int64_t DeviceId, void *TgtPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_end, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_delete, TgtPtrBegin, DeviceId,
/* TgtPtrBegin */ nullptr, /* TgtDeviceNum */ -1, /* Bytes */ 0, Code);
}
@@ -199,7 +199,7 @@ void Interface::beginTargetDataRetrieve(int64_t DeviceId, void *HstPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_begin, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_begin, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_transfer_from_device, TgtPtrBegin, DeviceId,
HstPtrBegin,
/* TgtDeviceNum */ omp_get_initial_device(), Size, Code);
@@ -222,7 +222,7 @@ void Interface::endTargetDataRetrieve(int64_t DeviceId, void *HstPtrBegin,
// HostOpId will be set by the tool. Invoke the tool supplied data op EMI
// callback
ompt_callback_target_data_op_emi_fn(
- ompt_scope_end, TargetTaskData, &TargetData, &TargetRegionOpId,
+ ompt_scope_end, TargetTaskData, &TargetData, &HostOpId,
ompt_target_data_transfer_from_device, TgtPtrBegin, DeviceId,
HstPtrBegin,
/* TgtDeviceNum */ omp_get_initial_device(), Size, Code);
@@ -364,12 +364,11 @@ void Interface::endTarget(int64_t DeviceId, void *Code) {
}
void Interface::beginTargetDataOperation() {
- DP("in ompt_target_region_begin (TargetRegionOpId = %lu)\n",
- TargetData.value);
+ DP("in ompt_target_region_begin (TargetRegionId = %lu)\n", TargetData.value);
}
void Interface::endTargetDataOperation() {
- DP("in ompt_target_region_end (TargetRegionOpId = %lu)\n", TargetData.value);
+ DP("in ompt_target_region_end (TargetRegionId = %lu)\n", TargetData.value);
}
void Interface::beginTargetRegion() {
More information about the Openmp-commits
mailing list