public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] libgomp, amdgcn: Switch USM to 128-byte alignment
@ 2023-01-13 17:44 Andrew Stubbs
  0 siblings, 0 replies; only message in thread
From: Andrew Stubbs @ 2023-01-13 17:44 UTC (permalink / raw)
  To: gcc-cvs

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-13 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 17:44 [gcc/devel/omp/gcc-12] libgomp, amdgcn: Switch USM to 128-byte alignment Andrew Stubbs

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).