libgomp: Add is_integrated_apu function to plugin/plugin-{gcn,nvptx}.c

The added function is currently '#if 0' but is planned to be used to enable
self mapping automatically. Prerequisite for auto self maps is still mapping
'declare target' variables (if any, in libgomp) or converting all
'declare target' variables to 'declare target link' in the compiler
(as required for 'omp requires self_maps').

include/ChangeLog:

	* hsa_ext_amd.h (enum hsa_amd_agent_info_s): Add
	HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES.
	(enum): Add HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU.

libgomp/ChangeLog:

	* plugin/plugin-gcn.c (is_integrated_apu): New; currently '#if 0'.
	* plugin/plugin-nvptx.c (is_integrated_apu): Likewise.
This commit is contained in:
Tobias Burnus
2025-10-10 09:48:37 +02:00
parent aaa7ac48bd
commit d2ad7e9083
3 changed files with 82 additions and 1 deletions

View File

@@ -168,9 +168,17 @@ typedef enum hsa_amd_agent_info_s {
* selective workarounds for hardware errata.
* The type of this attribute is uint32_t.
*/
HSA_AMD_AGENT_INFO_ASIC_REVISION = 0xA012
HSA_AMD_AGENT_INFO_ASIC_REVISION = 0xA012,
/* Bitmask with memory properties of the agent. */
HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES = 0xA114
} hsa_amd_agent_info_t;
enum {
HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU = (1 << 0)
};
typedef struct hsa_amd_hdp_flush_s {
uint32_t* HDP_MEM_FLUSH_CNTL;
uint32_t* HDP_REG_FLUSH_CNTL;