12 Commits

Author SHA1 Message Date
nicebert
20f5bcfb1a
[OpenMP] Add OpenMP extension API to dump mapping tables (#85381)
This adds an API call ompx_dump_mapping_tables.
This allows users to debug the mapping tables and can be especially
useful for unified shared memory applications to check if the code
behaves in the way it should. The implementation reuses code already
present to dump mapping tables (in a debug setting).

---------

Co-authored-by: Joseph Huber <huberjn@outlook.com>
2024-03-18 14:09:20 -05:00
Michael Halkenhäuser
e521752c04
[OpenMP][OMPT] Add OMPT callback for device data exchange 'Device-to-Device' (#81991)
Since there's no `ompt_target_data_transfer_tofrom_device` (within
ompt_target_data_op_t enum) or something other that conveys the meaning
of inter-device data exchange we decided to indicate a Device-to-Device
transfer by using: optype == ompt_target_data_transfer_from_device (=3)

Hence, a device transfer may be identified e.g. by checking for: (optype
== 3) &&
(src_device_num < omp_get_num_devices()) &&
(dest_device_num < omp_get_num_devices())

Fixes: #66478
2024-02-26 11:16:25 +01:00
dhruvachak
0d7f232baf
[libomptarget] [OMPT] Fixed return address computation for OMPT events. (#80498)
Currently, __builtin_return_address is used to generate the return
address when the callback invoker is created. However, this may result
in the return address pointing to an internal runtime function. This is
not what a tool would typically want. A tool would want to know the
corresponding user code from where the runtime entry point is invoked.

This change adds a thread local variable that is assigned the return
address at the OpenMP runtime entry points. An RAII is used to manage
the modifications to the thread local variable. Whenever the return
address is required for OMPT events, it is read from the thread local
variable.
2024-02-07 17:29:08 -08:00
dhruvachak
e4de6a602f
[OpenMP] [OMPT] A pointer to HostOpId should be passed in EMI callbacks. (#75574)
With this change, TargetRegionOpId is no more used and hence deleted.
2023-12-15 12:07:42 -08:00
Johannes Doerfert
fe6f137e48
[OpenMP][NFC] Move mapping related code into OpenMP/Mapping.cpp (#75239)
DeviceTy provides an abstraction for "middle-level" operations that can
be done with a offload device. Mapping was tied into it but is not
strictly necessary. Other languages do not track mapping, and even
OpenMP can be used completely without mapping. This simply moves the
relevant code into the OpenMP/Mapping.cpp as part of a new class
MappingInfoTy. Each device still has one, but it does not clutter the
device.cpp anymore.
2023-12-12 12:49:46 -08:00
Johannes Doerfert
cee6918d87 [OpenMP][NFC] Move api.cpp to OpenMP/API.cpp 2023-12-11 17:30:34 -08:00
Johannes Doerfert
51fc8544c7
[OpenMP][NFC] Move mapping related logic into Mapping.h (#74009) 2023-11-30 17:08:41 -08:00
Johannes Doerfert
40422bf150
[OpenMP][NFC] Separate OpenMP/OpenACC specific mapping code (#73817)
While this does not really encapsulate the mapping code, it at least
moves most of the declarations out of the way.
2023-11-29 10:29:54 -08:00
Johannes Doerfert
8391bb3f5c
[OpenMP][NFC] Move more declarations out of private.h (#73823) 2023-11-29 09:22:03 -08:00
Johannes Doerfert
fd2d0bf90e
[OpenMP][NFC] Replace unnecessary typedefs (#73815) 2023-11-29 08:40:41 -08:00
Johannes Doerfert
e2299e8d9d
[OpenMP][NFC] Move OMPT headers into OpenMP/OMPT (#73718) 2023-11-29 08:29:41 -08:00
Johannes Doerfert
d1057014a1
[OpenMP][NFC] Create an "OpenMP" folder in the include folder (#73713)
Not everything in libomptarget (include) is "OpenMP", but some things
most certainly are. This commit moves some code around to start making
this distinction without the intention to change functionality.
2023-11-28 15:41:31 -08:00