Re: [Patch] libgomp/gcn: fix/improve struct output (was: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling)

2022-11-21 Thread Andrew Stubbs
On 21/11/2022 13:40, Tobias Burnus wrote: Working on the builtins, I realized that I mixed up (again) bits and byes. While 'uint64_t var[2]' has a size of 128 bits, 'char var[128]' has a size of 128 bytes. Thus, there is sufficient space for 16 pointer-size/uin64_t values but I only need 6. T

[Patch] libgomp/gcn: fix/improve struct output (was: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling)

2022-11-21 Thread Tobias Burnus
Working on the builtins, I realized that I mixed up (again) bits and byes. While 'uint64_t var[2]' has a size of 128 bits, 'char var[128]' has a size of 128 bytes. Thus, there is sufficient space for 16 pointer-size/uin64_t values but I only need 6. This patch now makes use of the available spa

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-11-18 Thread Andrew Stubbs
On 18/11/2022 17:41, Tobias Burnus wrote: Attached is the updated/rediffed version, which now uses the builtin instead of the 'asm("s8"). The code in principle works; that is: If no private stack variables are copied, it works. Or in other words: reverse-offload target regions that don't use

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-11-18 Thread Tobias Burnus
Attached is the updated/rediffed version, which now uses the builtin instead of the 'asm("s8"). The code in principle works; that is: If no private stack variables are copied, it works. Or in other words: reverse-offload target regions that don't use firstprivate or mapping work, the rest would

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-10-12 Thread Tobias Burnus
On 12.10.22 19:09, Andrew Stubbs wrote: On 12/10/2022 15:29, Tobias Burnus wrote: Right, sorry, the buffer is circular, but the counter is linear. It simplified reservation that way, but it does mean that there's a limit to the number of times the buffer can cycle before the counter saturates.

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-10-12 Thread Andrew Stubbs
On 12/10/2022 15:29, Tobias Burnus wrote: On 29.09.22 18:24, Andrew Stubbs wrote: On 27/09/2022 14:16, Tobias Burnus wrote: Andrew did suggest a while back to piggyback on the console_output handling, avoiding another atomic access. - If this is still wanted, I like to have some guidance rega

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-10-12 Thread Tobias Burnus
On 29.09.22 18:24, Andrew Stubbs wrote: On 27/09/2022 14:16, Tobias Burnus wrote: Andrew did suggest a while back to piggyback on the console_output handling, avoiding another atomic access. - If this is still wanted, I like to have some guidance regarding how to actually implement it. [...] Th

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-09-29 Thread Andrew Stubbs
On 27/09/2022 14:16, Tobias Burnus wrote: @@ -422,6 +428,12 @@ struct agent_info if it has been. */ bool initialized; + /* Flag whether the HSA program that consists of all the modules has been + finalized. */ + bool prog_finalized; + /* Flag whether the HSA OpenMP's requires

Re: [Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-09-27 Thread Tobias Burnus
For those without a working crystal ball, I have now also included the patch. On 27.09.22 15:15, Tobias Burnus wrote: This patch adds support to handle reverse offload to libgomp's plugin-gcn.c and to AMD GCN's libgomp target.c. In theory, that's all whats needed for GCN – in practice there a k

[Patch] libgomp/gcn: Prepare for reverse-offload callback handling

2022-09-27 Thread Tobias Burnus
This patch adds support to handle reverse offload to libgomp's plugin-gcn.c and to AMD GCN's libgomp target.c. In theory, that's all whats needed for GCN – in practice there a known issue with private stack variables which has to be addressed independently. Once this and the target.c generic cod