]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn, libgomp: USM allocation update
authorAndrew Stubbs <ams@codesourcery.com>
Sat, 15 Oct 2022 22:38:50 +0000 (23:38 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Mon, 24 Oct 2022 16:18:17 +0000 (17:18 +0100)
commit6ec2c29dbbc19e7d2a8f991a5848e10c65c7c74c
treea0f767a2fc6660b571e89da7766b8cc8f01459b7
parentc682c50354d95a5b118bbedb5eba8d222ada268b
amdgcn, libgomp: USM allocation update

Allocate Unified Shared Memory via malloc and hsa_amd_svm_attributes_set,
instead of hsa_allocate_memory.  This scheme should be more efficient for
for memory that is first accessed by the CPU.

libgomp/ChangeLog:

* plugin/plugin-gcn.c (HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED): New.
(HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT): New.
(HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG): New.
(HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED): New.
(hsa_amd_svm_attribute_pair_t): New.
(struct hsa_runtime_fn_info): Add hsa_amd_svm_attributes_set_fn.
(dump_hsa_system_info): Dump HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED and
HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT.
(DLSYM_OPT_FN): New.
(init_hsa_runtime_functions): Add hsa_amd_svm_attributes_set.
(GOMP_OFFLOAD_usm_alloc): Use malloc and hsa_amd_svm_attributes_set.
(GOMP_OFFLOAD_usm_free): Use regular free.
* testsuite/libgomp.c/usm-1.c: Add -mxnack=on for amdgcn.
* testsuite/libgomp.c/usm-2.c: Likewise.
* testsuite/libgomp.c/usm-3.c: Likewise.
* testsuite/libgomp.c/usm-4.c: Likewise.
gcc/ChangeLog.omp
libgomp/plugin/plugin-gcn.c
libgomp/testsuite/libgomp.c/usm-1.c
libgomp/testsuite/libgomp.c/usm-2.c
libgomp/testsuite/libgomp.c/usm-3.c
libgomp/testsuite/libgomp.c/usm-4.c