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>
This commit is contained in:
Kent Russell
2024-08-23 14:15:16 -04:00
parent a676d8639c
commit 3da42a0847
37 changed files with 484 additions and 484 deletions
@@ -51,7 +51,7 @@ TEST_F(KFDLocalMemoryTest, AccessLocalMem) {
ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node";
/* Skip test if not on dGPU path, which the test depends on */
if (!is_dgpu()) {
if (!hsakmt_is_dgpu()) {
LOG() << "Not dGPU path, skipping the test" << std::endl;
return;
}
@@ -163,7 +163,7 @@ TEST_F(KFDLocalMemoryTest, VerifyContentsAfterUnmapAndMap) {
ASSERT_SUCCESS(queue.Create(defaultGPUNode));
queue.SetSkipWaitConsump(0);
if (!is_dgpu())
if (!hsakmt_is_dgpu())
ASSERT_SUCCESS(hsaKmtMapMemoryToGPUNodes(LocalBuffer.As<void*>(), LocalBuffer.Size(), &AlternateVAGPU,
mapFlags, 1, reinterpret_cast<HSAuint32 *>(&defaultGPUNode)));
@@ -183,7 +183,7 @@ TEST_F(KFDLocalMemoryTest, VerifyContentsAfterUnmapAndMap) {
EXPECT_SUCCESS(queue.Destroy());
EXPECT_EQ(SysBufferB.As<unsigned int*>()[0], 0x01010101);
if (!is_dgpu())
if (!hsakmt_is_dgpu())
EXPECT_SUCCESS(hsaKmtUnmapMemoryToGPU(LocalBuffer.As<void*>()));
TEST_END
@@ -285,7 +285,7 @@ TEST_F(KFDLocalMemoryTest, Fragmentation) {
* workaround. Also nicely matches the 8x bigger GPUVM address
* space on AMDGPU compared to RADEON.
*/
unsigned pageSize = is_dgpu() ? PAGE_SIZE*8 : PAGE_SIZE;
unsigned pageSize = hsakmt_is_dgpu() ? PAGE_SIZE*8 : PAGE_SIZE;
fbSize /= pageSize;
unsigned maxOrder = 0;
// Limit maxOrder up to 14 so this test doesn't run longer than 10 mins