Skip to content

Commit 0ac4438

Browse files
authored
[Libomptarget] Remove unused 'SupportsEmptyImages' API function (#80316)
Summary: This function is always false in the current implementation and is not even considered required. Just remove it and if someone needs it in the future they can add it back in. This is done to simplify the interface prior to other changes
1 parent 9a87c5d commit 0ac4438

File tree

5 files changed

+1
-17
lines changed

5 files changed

+1
-17
lines changed

openmp/libomptarget/include/Shared/PluginAPI.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image);
4040
// function to move data from source device to destination device directly.
4141
int32_t __tgt_rtl_is_data_exchangable(int32_t SrcDevId, int32_t DstDevId);
4242

43-
// Return an integer other than zero if the plugin can handle images which do
44-
// not contain target regions and global variables (but can contain other
45-
// functions)
46-
int32_t __tgt_rtl_supports_empty_images();
47-
4843
// Initialize the requires flags for the device.
4944
int64_t __tgt_rtl_init_requires(int64_t RequiresFlags);
5045

openmp/libomptarget/include/Shared/PluginAPI.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ PLUGIN_API_HANDLE(launch_kernel, true);
3333
PLUGIN_API_HANDLE(init_requires, false);
3434
PLUGIN_API_HANDLE(synchronize, false);
3535
PLUGIN_API_HANDLE(query_async, false);
36-
PLUGIN_API_HANDLE(supports_empty_images, false);
3736
PLUGIN_API_HANDLE(set_info_flag, false);
3837
PLUGIN_API_HANDLE(print_device_info, false);
3938
PLUGIN_API_HANDLE(create_event, false);

openmp/libomptarget/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,9 +1048,6 @@ struct GenericPluginTy {
10481048
/// we could not move this function into GenericDeviceTy.
10491049
virtual Expected<bool> isELFCompatible(StringRef Image) const = 0;
10501050

1051-
/// Indicate whether the plugin supports empty images.
1052-
virtual bool supportsEmptyImages() const { return false; }
1053-
10541051
protected:
10551052
/// Indicate whether a device id is valid.
10561053
bool isValidDeviceId(int32_t DeviceId) const {

openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,10 +1620,6 @@ int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image) {
16201620
}
16211621
}
16221622

1623-
int32_t __tgt_rtl_supports_empty_images() {
1624-
return Plugin::get().supportsEmptyImages();
1625-
}
1626-
16271623
int32_t __tgt_rtl_init_device(int32_t DeviceId) {
16281624
auto Err = Plugin::get().initDevice(DeviceId);
16291625
if (Err) {

openmp/libomptarget/src/omptarget.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,13 @@ static int initLibrary(DeviceTy &Device) {
137137
*/
138138
int32_t DeviceId = Device.DeviceID;
139139
int Rc = OFFLOAD_SUCCESS;
140-
bool SupportsEmptyImages = Device.RTL->supports_empty_images &&
141-
Device.RTL->supports_empty_images() > 0;
142140
{
143141
std::lock_guard<decltype(PM->TrlTblMtx)> LG(PM->TrlTblMtx);
144142
for (auto *HostEntriesBegin : PM->HostEntriesBeginRegistrationOrder) {
145143
TranslationTable *TransTable =
146144
&PM->HostEntriesBeginToTransTable[HostEntriesBegin];
147145
if (TransTable->HostTable.EntriesBegin ==
148-
TransTable->HostTable.EntriesEnd &&
149-
!SupportsEmptyImages) {
146+
TransTable->HostTable.EntriesEnd) {
150147
// No host entry so no need to proceed
151148
continue;
152149
}

0 commit comments

Comments
 (0)