@@ -128,10 +128,10 @@ void PluginManager::registerLib(__tgt_bin_desc *Desc) {
128128 PM->RTLsMtx .lock ();
129129
130130 // Add in all the OpenMP requirements associated with this binary.
131- for (__tgt_offload_entry &Entry :
131+ for (llvm::offloading::EntryTy &Entry :
132132 llvm::make_range (Desc->HostEntriesBegin , Desc->HostEntriesEnd ))
133- if (Entry.flags == OMP_REGISTER_REQUIRES)
134- PM->addRequirements (Entry.data );
133+ if (Entry.Flags == OMP_REGISTER_REQUIRES)
134+ PM->addRequirements (Entry.Data );
135135
136136 // Extract the exectuable image and extra information if availible.
137137 for (int32_t i = 0 ; i < Desc->NumDeviceImages ; ++i)
@@ -268,9 +268,9 @@ void PluginManager::unregisterLib(__tgt_bin_desc *Desc) {
268268
269269 // Remove entries from PM->HostPtrToTableMap
270270 PM->TblMapMtx .lock ();
271- for (__tgt_offload_entry *Cur = Desc->HostEntriesBegin ;
271+ for (llvm::offloading::EntryTy *Cur = Desc->HostEntriesBegin ;
272272 Cur < Desc->HostEntriesEnd ; ++Cur) {
273- PM->HostPtrToTableMap .erase (Cur->addr );
273+ PM->HostPtrToTableMap .erase (Cur->Address );
274274 }
275275
276276 // Remove translation table for this descriptor.
@@ -336,35 +336,36 @@ static int loadImagesOntoDevice(DeviceTy &Device) {
336336 }
337337
338338 // 3) Create the translation table.
339- llvm::SmallVector<__tgt_offload_entry > &DeviceEntries =
339+ llvm::SmallVector<llvm::offloading::EntryTy > &DeviceEntries =
340340 TransTable->TargetsEntries [DeviceId];
341- for (__tgt_offload_entry &Entry :
341+ for (llvm::offloading::EntryTy &Entry :
342342 llvm::make_range (Img->EntriesBegin , Img->EntriesEnd )) {
343343 __tgt_device_binary &Binary = *BinaryOrErr;
344344
345- __tgt_offload_entry DeviceEntry = Entry;
346- if (Entry.size ) {
347- if (Device.RTL ->get_global (Binary, Entry.size , Entry.name ,
348- &DeviceEntry.addr ) != OFFLOAD_SUCCESS)
349- REPORT (" Failed to load symbol %s\n " , Entry.name );
345+ llvm::offloading::EntryTy DeviceEntry = Entry;
346+ if (Entry.Size ) {
347+ if (Device.RTL ->get_global (Binary, Entry.Size , Entry.SymbolName ,
348+ &DeviceEntry.Address ) != OFFLOAD_SUCCESS)
349+ REPORT (" Failed to load symbol %s\n " , Entry.SymbolName );
350350
351351 // If unified memory is active, the corresponding global is a device
352352 // reference to the host global. We need to initialize the pointer on
353353 // the device to point to the memory on the host.
354354 if ((PM->getRequirements () & OMP_REQ_UNIFIED_SHARED_MEMORY) ||
355355 (PM->getRequirements () & OMPX_REQ_AUTO_ZERO_COPY)) {
356- if (Device.RTL ->data_submit (DeviceId, DeviceEntry.addr , Entry.addr ,
357- Entry.size ) != OFFLOAD_SUCCESS)
358- REPORT (" Failed to write symbol for USM %s\n " , Entry.name );
356+ if (Device.RTL ->data_submit (DeviceId, DeviceEntry.Address ,
357+ Entry.Address ,
358+ Entry.Size ) != OFFLOAD_SUCCESS)
359+ REPORT (" Failed to write symbol for USM %s\n " , Entry.SymbolName );
359360 }
360- } else if (Entry.addr ) {
361- if (Device.RTL ->get_function (Binary, Entry.name , &DeviceEntry. addr ) !=
362- OFFLOAD_SUCCESS)
363- REPORT (" Failed to load kernel %s\n " , Entry.name );
361+ } else if (Entry.Address ) {
362+ if (Device.RTL ->get_function (Binary, Entry.SymbolName ,
363+ &DeviceEntry. Address ) != OFFLOAD_SUCCESS)
364+ REPORT (" Failed to load kernel %s\n " , Entry.SymbolName );
364365 }
365366 DP (" Entry point " DPxMOD " maps to%s %s (" DPxMOD " )\n " ,
366- DPxPTR (Entry.addr ), (Entry.size ) ? " global" : " " , Entry. name ,
367- DPxPTR (DeviceEntry.addr ));
367+ DPxPTR (Entry.Address ), (Entry.Size ) ? " global" : " " ,
368+ Entry. SymbolName , DPxPTR (DeviceEntry.Address ));
368369
369370 DeviceEntries.emplace_back (DeviceEntry);
370371 }
@@ -396,30 +397,31 @@ static int loadImagesOntoDevice(DeviceTy &Device) {
396397 Device.getMappingInfo ().HostDataToTargetMap .getExclusiveAccessor ();
397398
398399 __tgt_target_table *HostTable = &TransTable->HostTable ;
399- for (__tgt_offload_entry *CurrDeviceEntry = TargetTable->EntriesBegin ,
400- *CurrHostEntry = HostTable->EntriesBegin ,
401- *EntryDeviceEnd = TargetTable->EntriesEnd ;
400+ for (llvm::offloading::EntryTy *
401+ CurrDeviceEntry = TargetTable->EntriesBegin ,
402+ *CurrHostEntry = HostTable->EntriesBegin ,
403+ *EntryDeviceEnd = TargetTable->EntriesEnd ;
402404 CurrDeviceEntry != EntryDeviceEnd;
403405 CurrDeviceEntry++, CurrHostEntry++) {
404- if (CurrDeviceEntry->size == 0 )
406+ if (CurrDeviceEntry->Size == 0 )
405407 continue ;
406408
407- assert (CurrDeviceEntry->size == CurrHostEntry->size &&
409+ assert (CurrDeviceEntry->Size == CurrHostEntry->Size &&
408410 " data size mismatch" );
409411
410412 // Fortran may use multiple weak declarations for the same symbol,
411413 // therefore we must allow for multiple weak symbols to be loaded from
412414 // the fat binary. Treat these mappings as any other "regular"
413415 // mapping. Add entry to map.
414- if (Device.getMappingInfo ().getTgtPtrBegin (HDTTMap, CurrHostEntry-> addr ,
415- CurrHostEntry->size ))
416+ if (Device.getMappingInfo ().getTgtPtrBegin (
417+ HDTTMap, CurrHostEntry-> Address , CurrHostEntry->Size ))
416418 continue ;
417419
418- void *CurrDeviceEntryAddr = CurrDeviceEntry->addr ;
420+ void *CurrDeviceEntryAddr = CurrDeviceEntry->Address ;
419421
420422 // For indirect mapping, follow the indirection and map the actual
421423 // target.
422- if (CurrDeviceEntry->flags & OMP_DECLARE_TARGET_INDIRECT) {
424+ if (CurrDeviceEntry->Flags & OMP_DECLARE_TARGET_INDIRECT) {
423425 AsyncInfoTy AsyncInfo (Device);
424426 void *DevPtr;
425427 Device.retrieveData (&DevPtr, CurrDeviceEntryAddr, sizeof (void *),
@@ -431,19 +433,21 @@ static int loadImagesOntoDevice(DeviceTy &Device) {
431433
432434 DP (" Add mapping from host " DPxMOD " to device " DPxMOD " with size %zu"
433435 " , name \" %s\"\n " ,
434- DPxPTR (CurrHostEntry->addr ), DPxPTR (CurrDeviceEntry->addr ),
435- CurrDeviceEntry->size , CurrDeviceEntry->name );
436+ DPxPTR (CurrHostEntry->Address ), DPxPTR (CurrDeviceEntry->Address ),
437+ CurrDeviceEntry->Size , CurrDeviceEntry->SymbolName );
436438 HDTTMap->emplace (new HostDataToTargetTy (
437- (uintptr_t )CurrHostEntry->addr /* HstPtrBase*/ ,
438- (uintptr_t )CurrHostEntry->addr /* HstPtrBegin*/ ,
439- (uintptr_t )CurrHostEntry->addr + CurrHostEntry->size /* HstPtrEnd*/ ,
439+ (uintptr_t )CurrHostEntry->Address /* HstPtrBase*/ ,
440+ (uintptr_t )CurrHostEntry->Address /* HstPtrBegin*/ ,
441+ (uintptr_t )CurrHostEntry->Address +
442+ CurrHostEntry->Size /* HstPtrEnd*/ ,
440443 (uintptr_t )CurrDeviceEntryAddr /* TgtAllocBegin*/ ,
441444 (uintptr_t )CurrDeviceEntryAddr /* TgtPtrBegin*/ ,
442- false /* UseHoldRefCount*/ , CurrHostEntry->name ,
445+ false /* UseHoldRefCount*/ , CurrHostEntry->SymbolName ,
443446 true /* IsRefCountINF*/ ));
444447
445448 // Notify about the new mapping.
446- if (Device.notifyDataMapped (CurrHostEntry->addr , CurrHostEntry->size ))
449+ if (Device.notifyDataMapped (CurrHostEntry->Address ,
450+ CurrHostEntry->Size ))
447451 return OFFLOAD_FAIL;
448452 }
449453 }
0 commit comments