]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp, amdgcn: Switch USM to 128-byte alignment
authorAndrew Stubbs <ams@codesourcery.com>
Fri, 13 Jan 2023 17:38:39 +0000 (17:38 +0000)
committerAndrew Stubbs <ams@codesourcery.com>
Fri, 13 Jan 2023 17:38:39 +0000 (17:38 +0000)
This should optimize cache-lines on the AMD GPUs somewhat.

libgomp/ChangeLog:

* usm-allocator.c (ALIGN): Use 128-byte alignment.

libgomp/usm-allocator.c

index c45109169ca365238c16f7bd0d5505e4304b769e..68c1ebafec288f34ccdf344410ce5e3aaa44353b 100644 (file)
@@ -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