This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Don't allow mixed component and non-component accesses for OpenACC/Fortran


Hi Julian,

please hold back the commit.

Actually, it does not seem to work if one modifies the test
case a bit. The following code compiles – but I think it
should not:

type one
  integer i, j
end type
type two
  type(one)  A, B
end type

type(two) x
!$acc enter data copyin(x%A, x%A%i)
!$acc enter data copyin(x%A, x%A%i, x%A%i)
end

At least the last line has x%A%i twice but it is accepted.

I am not sure whether the line before is valid or not
(x%A%i is copied twice; might make a difference if it were
a pointer but it isn't a pointer here.) – In C/C++, with OpenMP
and, hence, OpenACC, the first one is accepted but the second
one is rejected. C example:

struct one {
  int i, j;
};

struct two {
  struct one  A, B;
};

void foo() {
  struct two x;
/* Accepted: x.A + x.A.i, even though both map 'x.A.i'.  */
#pragma omp target enter data map(to:x.A, x.A.i)
#pragma acc enter data copyin(x.A, x.A.i)

/* Rejected: 'x.A.i' mapped twice */
#pragma omp target enter data map(to:x.A, x.A.i, x.A.i)
#pragma acc enter data copyin(x.A, x.A.i, x.A.i)
}


Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]