public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Stubbs <ams@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-12] libgomp, amdgcn: Switch USM to 128-byte alignment
Date: Fri, 13 Jan 2023 17:44:32 +0000 (GMT)	[thread overview]
Message-ID: <20230113174432.B5EE93858C39@sourceware.org> (raw)

https://gcc.gnu.org/g:c9b47ccf32a91d8c851a3e20d1a2f47ed0aaa47e

commit c9b47ccf32a91d8c851a3e20d1a2f47ed0aaa47e
Author: Andrew Stubbs <ams@codesourcery.com>
Date:   Fri Jan 13 17:38:39 2023 +0000

    libgomp, amdgcn: Switch USM to 128-byte alignment
    
    This should optimize cache-lines on the AMD GPUs somewhat.
    
    libgomp/ChangeLog:
    
            * usm-allocator.c (ALIGN): Use 128-byte alignment.

Diff:
---
 libgomp/usm-allocator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libgomp/usm-allocator.c b/libgomp/usm-allocator.c
index c45109169ca..68c1ebafec2 100644
--- a/libgomp/usm-allocator.c
+++ b/libgomp/usm-allocator.c
@@ -57,7 +57,8 @@ static int usm_lock = 0;
 static struct usm_splay_tree_s usm_allocations = { NULL };
 static struct usm_splay_tree_s usm_free_space = { NULL };
 
-#define ALIGN(VAR) (((VAR) + 7) & ~7)    /* 8-byte granularity.  */
+/* 128-byte granularity means GPU cache-line aligned.  */
+#define ALIGN(VAR) (((VAR) + 127) & ~127)
 
 /* Coalesce contiguous free space into one entry.  This considers the entries
    either side of the root node only, so it should be called each time a new

                 reply	other threads:[~2023-01-13 17:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230113174432.B5EE93858C39@sourceware.org \
    --to=ams@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).