This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP50]Mapping of the subcomponents with the 'default' mappers.
ClosedPublic

Authored by ABataev on Nov 26 2020, 1:55 PM.

Details

Summary

If the mapped structure has data members, which have 'default' mappers,
need to map these members individually using their 'default' mappers.

Diff Detail

Event Timeline

ABataev created this revision.Nov 26 2020, 1:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 26 2020, 1:55 PM
ABataev requested review of this revision.Nov 26 2020, 1:55 PM
ye-luo added a subscriber: ye-luo.Dec 4 2020, 4:36 PM

The patch currently asserts for the following:

#include <stdio.h>
                                                                
typedef struct { int a; double *b; } C;                         
#pragma omp declare mapper(default: C s) map(s.a, s.b[0:2])     

int main() {
C s;                                                            
s.a = 10;                                                       
double x[2]; x[0] = 20;                                         
s.b = &x[0];
C* sp = &s;                                                     
C** spp = &sp;

printf("%d %lf %p\n", spp[0][0].a, spp[0][0].b[0], spp[0][0].b);
                                                                
#pragma omp target map(tofrom:spp[0][0])
printf("%d %lf %p\n", spp[0][0].a, spp[0][0].b[0], spp[0][0].b);
}

Note that this doesn't work correctly before this patch either. This changes it from a runfail to a compfail.

cchen added a subscriber: cchen.Jan 25 2021, 10:23 AM
ABataev updated this revision to Diff 325425.Feb 22 2021, 5:38 AM

Temp update, not finished yet. Still WIP.

ABataev updated this revision to Diff 326144.Feb 24 2021, 10:36 AM

Fixes and updates

ABataev updated this revision to Diff 326445.Feb 25 2021, 10:57 AM

Removed unnecessary changes.

grokos accepted this revision.Feb 25 2021, 2:42 PM
grokos added a reviewer: grokos.

Libomptarget changes look good, I'll let @jdoerfert provide feedback for the clang part.

This revision is now accepted and ready to land.Feb 25 2021, 2:43 PM
This revision was landed with ongoing or failed builds.Mar 2 2021, 7:14 AM
This revision was automatically updated to reflect the committed changes.