On 29/10/2024 11:44, Tobias Burnus wrote:
While users can set HSA_XNACK themselves, it is much more convenient if
the compiler sets it for them (at least if it is overriddable).

Some systems don't have XNACK, but for those that have it, the somewhat
newisher object code versions support three modes: unset (GCC: '- mxnack=any'; supporting both XNACK and not), set and unset; the last two only work if the
compiled-for mode matches the actual mode in which the GPU is running.
Therefore, setting HSA_XNACK in this case makes sense.

XNACK (when available) also needs to be enabled in order to have a working
unified-shared memory access, hence, setting it in that case also makes sense.
Therefore, this patch sets HSA_XNACK to 0 or 1.

This somewhat matches what is done in OG13 and in Andrew's patch at
https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655951.html
albeit the code is somewhat different.
[For some reasons, this code is not in OG14 ?!?]

While doing so, I also updated the documentation and moved the code from
the existing stack-size constructor in the existing 'init' constructor to
reduce the number of used constructors.

OK for mainline?

This conflicts with my patch that already does (some of) this that is submitted as part of the USM series that is still awaiting review.

https://patchwork.sourceware.org/project/gcc/patch/20240628102449.562467-6-...@baylibre.com/

Andrew

Reply via email to