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

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

commit cb41a9ae655bb66d8eb822cc5f79b4a09a1cc4da
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/ChangeLog.omp   | 4 ++++
 libgomp/usm-allocator.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index a7127aa0635..150eb7e8eac 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,7 @@
+2023-01-13  Andrew Stubbs  <ams@codesourcery.com>
+
+	* usm-allocator.c (ALIGN): Use 128-byte alignment.
+
 2023-01-11  Andrew Stubbs  <ams@codesourcery.com>
 
 	* plugin/plugin-gcn.c: Include sys/mman.h and unistd.h.
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-05-19 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 16:50 [gcc/devel/omp/gcc-13] libgomp, amdgcn: Switch USM to 128-byte alignment Kwok Yeung

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