Skip to content

Commit ebde3f6

Browse files
committed
Chore: eliminate build warnings
1 parent 30c4d01 commit ebde3f6

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ else()
119119
endif()
120120

121121
add_library(mori_logging INTERFACE)
122-
target_include_directories(mori_logging INTERFACE include
123-
3rdparty/spdlog/include)
122+
target_include_directories(mori_logging INTERFACE include)
123+
target_include_directories(mori_logging SYSTEM INTERFACE 3rdparty/spdlog/include)
124124

125125
if(ENABLE_PROFILER)
126126
find_package(

src/io/xgmi/backend_impl.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ XgmiBackend::~XgmiBackend() {
269269
std::unique_lock<std::shared_mutex> lock(ipcMutex);
270270
for (auto& entry : remoteIpcHandles) {
271271
if (entry.second.remappedAddr != nullptr) {
272-
hipIpcCloseMemHandle(entry.second.remappedAddr);
272+
hipError_t closeErr = hipIpcCloseMemHandle(entry.second.remappedAddr);
273+
if (closeErr != hipSuccess) {
274+
MORI_IO_WARN("XGMI: Failed to close IPC mem handle: {}", hipGetErrorString(closeErr));
275+
}
273276
}
274277
}
275278
remoteIpcHandles.clear();
@@ -309,7 +312,10 @@ void XgmiBackend::InitializeP2PAccess() {
309312
if (canAccess) {
310313
hipError_t enableErr = hipDeviceEnablePeerAccess(j, 0);
311314
if (enableErr == hipErrorPeerAccessAlreadyEnabled) {
312-
hipGetLastError();
315+
hipError_t clearErr = hipGetLastError();
316+
if (clearErr != hipSuccess) {
317+
MORI_IO_WARN("XGMI: Failed to clear peer access error: {}", hipGetErrorString(clearErr));
318+
}
313319
p2pMatrix[i][j] = true;
314320
MORI_IO_TRACE("XGMI: P2P access already enabled from device {} to {}", i, j);
315321
} else if (enableErr != hipSuccess) {
@@ -401,7 +407,10 @@ void* XgmiBackend::GetRemappedAddress(const MemoryDesc& desc, int localDeviceId)
401407
void* remappedAddr = nullptr;
402408
err = hipIpcOpenMemHandle(&remappedAddr, handle, hipIpcMemLazyEnablePeerAccess);
403409
if (err != hipSuccess) {
404-
hipGetLastError();
410+
hipError_t clearErr = hipGetLastError();
411+
if (clearErr != hipSuccess) {
412+
MORI_IO_WARN("XGMI: Failed to clear IPC open error: {}", hipGetErrorString(clearErr));
413+
}
405414
if (IsP2PAccessible(localDeviceId, desc.deviceId)) {
406415
MORI_IO_TRACE("XGMI: IPC failed, using direct P2P pointer for id={}", desc.id);
407416
return reinterpret_cast<void*>(desc.data);

src/io/xgmi/hip_resource_pool.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ bool StreamPool::InitializeStreamsForDevice(int deviceId) {
8888
MORI_IO_ERROR("StreamPool: Failed to create stream for device {}: {}", deviceId,
8989
hipGetErrorString(err));
9090
for (auto s : deviceStreams) {
91-
hipStreamDestroy(s);
91+
hipError_t destroyErr = hipStreamDestroy(s);
92+
if (destroyErr != hipSuccess) {
93+
MORI_IO_ERROR("StreamPool: Failed to destroy stream: {}", hipGetErrorString(destroyErr));
94+
}
9295
}
9396
return false;
9497
}
@@ -117,7 +120,10 @@ EventPool::~EventPool() {
117120
hipEvent_t event = deviceEntry.second.front();
118121
deviceEntry.second.pop();
119122
if (event != nullptr) {
120-
hipEventDestroy(event);
123+
hipError_t destroyErr = hipEventDestroy(event);
124+
if (destroyErr != hipSuccess) {
125+
MORI_IO_ERROR("EventPool: Failed to destroy event: {}", hipGetErrorString(destroyErr));
126+
}
121127
}
122128
}
123129
}

0 commit comments

Comments
 (0)