[Openmp-commits] [openmp] c9733b8 - [libomptarget][NFC]Rename targetDataMapper to targetDat in interface.cpp (#65915)
via Openmp-commits
openmp-commits at lists.llvm.org
Sun Sep 10 19:08:15 PDT 2023
Author: Ye Luo
Date: 2023-09-10T21:08:11-05:00
New Revision: c9733b8a9efe39ec1daf20d16352657390019d86
URL: https://github.com/llvm/llvm-project/commit/c9733b8a9efe39ec1daf20d16352657390019d86
DIFF: https://github.com/llvm/llvm-project/commit/c9733b8a9efe39ec1daf20d16352657390019d86.diff
LOG: [libomptarget][NFC]Rename targetDataMapper to targetDat in interface.cpp (#65915)
In omptarget.cpp, there is a targetDataMapper which does mapper related
operations.
In interface.cpp, targetDataMapper function template is simply needed
for handling TargetAsyncInfoTy. Thus it is better to name it as simple
as targetData similar to targetKernel.
Added:
Modified:
openmp/libomptarget/src/interface.cpp
openmp/libomptarget/src/private.h
Removed:
################################################################################
diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp
index 0f5faf3d4f89b04..5f21b16b3fbfb1e 100644
--- a/openmp/libomptarget/src/interface.cpp
+++ b/openmp/libomptarget/src/interface.cpp
@@ -74,11 +74,11 @@ EXTERN void __tgt_unregister_lib(__tgt_bin_desc *Desc) {
template <typename TargetAsyncInfoTy>
static inline void
-targetDataMapper(ident_t *Loc, int64_t DeviceId, int32_t ArgNum,
- void **ArgsBase, void **Args, int64_t *ArgSizes,
- int64_t *ArgTypes, map_var_info_t *ArgNames, void **ArgMappers,
- TargetDataFuncPtrTy TargetDataFunction,
- const char *RegionTypeMsg, const char *RegionName) {
+targetData(ident_t *Loc, int64_t DeviceId, int32_t ArgNum, void **ArgsBase,
+ void **Args, int64_t *ArgSizes, int64_t *ArgTypes,
+ map_var_info_t *ArgNames, void **ArgMappers,
+ TargetDataFuncPtrTy TargetDataFunction, const char *RegionTypeMsg,
+ const char *RegionName) {
static_assert(std::is_convertible_v<TargetAsyncInfoTy, AsyncInfoTy>,
"TargetAsyncInfoTy must be convertible to AsyncInfoTy.");
@@ -113,7 +113,7 @@ targetDataMapper(ident_t *Loc, int64_t DeviceId, int32_t ArgNum,
TargetDataFunction == targetDataEnd ||
TargetDataFunction == targetDataUpdate) &&
"Encountered unexpected TargetDataFunction during "
- "execution of targetDataMapper");
+ "execution of targetData");
auto CallbackFunctions =
(TargetDataFunction == targetDataBegin)
? RegionInterface.getCallbacks<ompt_target_enter_data>()
@@ -144,10 +144,10 @@ EXTERN void __tgt_target_data_begin_mapper(ident_t *Loc, int64_t DeviceId,
map_var_info_t *ArgNames,
void **ArgMappers) {
- targetDataMapper<AsyncInfoTy>(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes,
- ArgTypes, ArgNames, ArgMappers, targetDataBegin,
- "Entering OpenMP data region with being_mapper",
- "begin");
+ targetData<AsyncInfoTy>(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes,
+ ArgTypes, ArgNames, ArgMappers, targetDataBegin,
+ "Entering OpenMP data region with being_mapper",
+ "begin");
}
EXTERN void __tgt_target_data_begin_nowait_mapper(
@@ -156,7 +156,7 @@ EXTERN void __tgt_target_data_begin_nowait_mapper(
void **ArgMappers, int32_t DepNum, void *DepList, int32_t NoAliasDepNum,
void *NoAliasDepList) {
- targetDataMapper<TaskAsyncInfoWrapperTy>(
+ targetData<TaskAsyncInfoWrapperTy>(
Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames,
ArgMappers, targetDataBegin,
"Entering OpenMP data region with being_nowait_mapper", "begin");
@@ -172,10 +172,9 @@ EXTERN void __tgt_target_data_end_mapper(ident_t *Loc, int64_t DeviceId,
map_var_info_t *ArgNames,
void **ArgMappers) {
- targetDataMapper<AsyncInfoTy>(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes,
- ArgTypes, ArgNames, ArgMappers, targetDataEnd,
- "Exiting OpenMP data region with end_mapper",
- "end");
+ targetData<AsyncInfoTy>(Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes,
+ ArgTypes, ArgNames, ArgMappers, targetDataEnd,
+ "Exiting OpenMP data region with end_mapper", "end");
}
EXTERN void __tgt_target_data_end_nowait_mapper(
@@ -184,7 +183,7 @@ EXTERN void __tgt_target_data_end_nowait_mapper(
void **ArgMappers, int32_t DepNum, void *DepList, int32_t NoAliasDepNum,
void *NoAliasDepList) {
- targetDataMapper<TaskAsyncInfoWrapperTy>(
+ targetData<TaskAsyncInfoWrapperTy>(
Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames,
ArgMappers, targetDataEnd,
"Exiting OpenMP data region with end_nowait_mapper", "end");
@@ -197,7 +196,7 @@ EXTERN void __tgt_target_data_update_mapper(ident_t *Loc, int64_t DeviceId,
map_var_info_t *ArgNames,
void **ArgMappers) {
- targetDataMapper<AsyncInfoTy>(
+ targetData<AsyncInfoTy>(
Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames,
ArgMappers, targetDataUpdate,
"Updating data within the OpenMP data region with update_mapper",
@@ -209,7 +208,7 @@ EXTERN void __tgt_target_data_update_nowait_mapper(
void **Args, int64_t *ArgSizes, int64_t *ArgTypes, map_var_info_t *ArgNames,
void **ArgMappers, int32_t DepNum, void *DepList, int32_t NoAliasDepNum,
void *NoAliasDepList) {
- targetDataMapper<TaskAsyncInfoWrapperTy>(
+ targetData<TaskAsyncInfoWrapperTy>(
Loc, DeviceId, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames,
ArgMappers, targetDataUpdate,
"Updating data within the OpenMP data region with update_nowait_mapper",
diff --git a/openmp/libomptarget/src/private.h b/openmp/libomptarget/src/private.h
index ae6e4b15b62ce42..cbce15b63a3eba2 100644
--- a/openmp/libomptarget/src/private.h
+++ b/openmp/libomptarget/src/private.h
@@ -438,6 +438,6 @@ class ExponentialBackoff {
#define TIMESCOPE()
#define TIMESCOPE_WITH_IDENT(IDENT)
#define TIMESCOPE_WITH_NAME_AND_IDENT(NAME, IDENT)
-#define TIMESCOPE_WITH_RTM_AND_IDENT(RegionTypeMsg, IDENT)
+#define TIMESCOPE_WITH_RTM_AND_IDENT(RegionTypeMsg, IDENT)
#endif
More information about the Openmp-commits
mailing list