Samuel, this is true for device part of codegen. But what about host? If this code must be executed on host, will it be handled correctly?
Best regards, Alexey Bataev ============= Software Engineer Intel Compiler Team 18.03.2016 23:03, Samuel Antao пишет: > sfantao added a comment. > > Hi Alexey, > > I am sorry but I don't think I am following. So in your example: > > #pragma omp target map(to: this->A) > []()->void {++A}(); > > the map clause is going to make sure the runtime library allocates the > section of `this` that contains A and that is what is used in the device. > There are no new instances of A created inside the kernel. If you do: > > #pragma omp target > []()->void {++A}(); > > what the lambda is going to get would be the same (except that runtime had > eventually to copy more data to the device), so the map clause has no effect > in how captures are dealt with inside. All the map clause does is to inform > the runtime about sizes and addresses and change the captures to byCopy when > necessary, it does not create new instances of data inside the kernel. Maybe > what you are proposing is meant for (first)private? > > Thanks, > Samuel > > > http://reviews.llvm.org/D16749 > > > _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits