2
0

libhsakmt: Prefix global symbols with hsakmt

To support fully-static library ROCm builds, ensure that all global
symbols are prefixed with something meaningful to avoid collisions with
other libraries

A script was made using" objdump -C -t" to get a list of symbols,
then checking if the global symbols have a meaningful prefix (for thunk:
hsakmt or kmt in various cases)

Change-Id: Ifd353f64a3344eb60d1f6c4e041aa20967b38a59
Signed-off-by: Kent Russell <kent.russell@amd.com>
Este cometimento está contido em:
Kent Russell
2024-08-23 14:15:16 -04:00
ascendente a676d8639c
cometimento 3da42a0847
37 ficheiros modificados com 484 adições e 484 eliminações
+7 -7
Ver ficheiro
@@ -130,10 +130,10 @@ HSAKMT_STATUS CreateQueueTypeEvent(
return hsaKmtCreateEvent(&Descriptor, ManualReset, IsSignaled, Event);
}
static bool is_dgpu_dev = false;
static bool hsakmt_is_dgpu_dev = false;
bool is_dgpu() {
return is_dgpu_dev;
bool hsakmt_is_dgpu() {
return hsakmt_is_dgpu_dev;
}
bool hasPciAtomicsSupport(int node) {
@@ -213,9 +213,9 @@ unsigned int FamilyIdFromNode(const HsaNodeProperties *props) {
}
if (props->NumCPUCores && props->NumFComputeCores)
is_dgpu_dev = false;
hsakmt_is_dgpu_dev = false;
else
is_dgpu_dev = true;
hsakmt_is_dgpu_dev = true;
return familyId;
}
@@ -302,7 +302,7 @@ HsaMemoryBuffer::HsaMemoryBuffer(HSAuint64 size, unsigned int node, bool zero, b
EXPECT_EQ(m_Flags.ui32.HostAccess, 1);
EXPECT_SUCCESS(hsaKmtAllocMemory(m_Node, m_Size, m_Flags, &m_pBuf));
if (is_dgpu()) {
if (hsakmt_is_dgpu()) {
if (map_specific_gpu)
EXPECT_SUCCESS(hsaKmtMapMemoryToGPUNodes(m_pBuf, m_Size, NULL, mapFlags, 1, &m_Node));
else
@@ -531,7 +531,7 @@ HsaMemoryBuffer::~HsaMemoryBuffer() {
hsaKmtUnmapMemoryToGPU(m_pUser);
hsaKmtDeregisterMemory(m_pUser);
} else if (m_pBuf != NULL) {
if (is_dgpu()) {
if (hsakmt_is_dgpu()) {
if (m_MappedNodes) {
hsaKmtUnmapMemoryToGPU(m_pBuf);
}