Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-11-26 Thread Jakub Jelinek
On Tue, Nov 10, 2015 at 11:39:36AM +0100, Jakub Jelinek wrote: > On Tue, Nov 03, 2015 at 05:25:53PM +0300, Alexander Monakov wrote: > > Here's an alternative patch that does not depend on exposure of > > shared-memory > > address space, and does not try to use pass_late_lower_omp. It's based on >

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-11-10 Thread Jakub Jelinek
On Tue, Nov 03, 2015 at 05:25:53PM +0300, Alexander Monakov wrote: > Here's an alternative patch that does not depend on exposure of shared-memory > address space, and does not try to use pass_late_lower_omp. It's based on > Bernd's suggestion to transform FYI, I've committed a new testcase to go

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-11-06 Thread Jakub Jelinek
On Fri, Nov 06, 2015 at 03:00:30PM +0100, Bernd Schmidt wrote: > >Sanity-checked by running the libgomp testsuite. I realize the #ifdef in > >internal-fn.c is not appropriate: it's there to make the patch smaller, I'll > >replace it with a target hook if otherwise this approach is ok. > > FWIW, n

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-11-06 Thread Bernd Schmidt
Sanity-checked by running the libgomp testsuite. I realize the #ifdef in internal-fn.c is not appropriate: it's there to make the patch smaller, I'll replace it with a target hook if otherwise this approach is ok. FWIW, no objections from me regarding the approach. Bernd

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-11-03 Thread Alexander Monakov
Hello, Here's an alternative patch that does not depend on exposure of shared-memory address space, and does not try to use pass_late_lower_omp. It's based on Bernd's suggestion to transform (use .omp_data_o) GOMP_parallel (fn, &omp_data_o, ...); .omp_data_o = {CLOBBER}; to .omp_data_o

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-21 Thread Alexander Monakov
On Wed, 21 Oct 2015, Bernd Schmidt wrote: > On 10/21/2015 11:07 AM, Alexander Monakov wrote: > > > In PTX, stack storage is in .local address space -- and that memory is > > thread-private. A thread can make a pointer to its own stack memory and > > successfully dereference it, but dereferencing

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-21 Thread Bernd Schmidt
On 10/21/2015 11:07 AM, Alexander Monakov wrote: In PTX, stack storage is in .local address space -- and that memory is thread-private. A thread can make a pointer to its own stack memory and successfully dereference it, but dereferencing that pointer from other threads does not work (I observe

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-21 Thread Jakub Jelinek
On Wed, Oct 21, 2015 at 12:07:22PM +0300, Alexander Monakov wrote: > On Wed, 21 Oct 2015, Jakub Jelinek wrote: > > > On Tue, Oct 20, 2015 at 09:34:28PM +0300, Alexander Monakov wrote: > > > (This patch serves as a straw man proposal to have something concrete for > > > discussion and further patch

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-21 Thread Alexander Monakov
On Wed, 21 Oct 2015, Jakub Jelinek wrote: > On Tue, Oct 20, 2015 at 09:34:28PM +0300, Alexander Monakov wrote: > > (This patch serves as a straw man proposal to have something concrete for > > discussion and further patches) > > > > On PTX, stack memory is private to each thread. When master t

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-21 Thread Jakub Jelinek
On Tue, Oct 20, 2015 at 09:34:28PM +0300, Alexander Monakov wrote: > (This patch serves as a straw man proposal to have something concrete for > discussion and further patches) > > On PTX, stack memory is private to each thread. When master thread constructs > 'omp_data_o' on its own stack and pa

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-20 Thread Alexander Monakov
On Wed, 21 Oct 2015, Bernd Schmidt wrote: > On 10/20/2015 08:34 PM, Alexander Monakov wrote: > > (This patch serves as a straw man proposal to have something concrete for > > discussion and further patches) > > > > On PTX, stack memory is private to each thread. When master thread > > construct

Re: [gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-20 Thread Bernd Schmidt
On 10/20/2015 08:34 PM, Alexander Monakov wrote: (This patch serves as a straw man proposal to have something concrete for discussion and further patches) On PTX, stack memory is private to each thread. When master thread constructs 'omp_data_o' on its own stack and passes it to other threads v

[gomp4 06/14] omp-low: copy omp_data_o to shared memory on NVPTX

2015-10-20 Thread Alexander Monakov
(This patch serves as a straw man proposal to have something concrete for discussion and further patches) On PTX, stack memory is private to each thread. When master thread constructs 'omp_data_o' on its own stack and passes it to other threads via GOMP_parallel by reference, other threads cannot