Skip to content

Commit b82b241

Browse files
committed
[common] fixed some compilation warnings
- excessive semicolons and - unused variables - made compiling on SLES by using UMF with fix - use python3.6 friendly alias inestad of text param
1 parent cded5d9 commit b82b241

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

source/adapters/level_zero/v2/command_list_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void command_list_cache_t::addCommandList(const command_list_descriptor_t &desc,
142142
raii::ze_command_list_t cmdList) {
143143
// TODO: add a limit?
144144
std::unique_lock<ur_mutex> Lock(ZeCommandListCacheMutex);
145-
auto [it, _] = ZeCommandListCache.try_emplace(desc);
145+
auto it = ZeCommandListCache.try_emplace(desc).first;
146146
it->second.emplace(std::move(cmdList));
147147
}
148148

source/common/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ if (NOT DEFINED UMF_REPO)
2424
endif()
2525

2626
if (NOT DEFINED UMF_TAG)
27-
# v0.9.x 23.08.2024: Merge pull request #696 ...
28-
set(UMF_TAG 3c340e61c197f4f9e29abd947f90ce27c571433e)
27+
# 02 Sept 2024: Merge pull request #701
28+
set(UMF_TAG 72e22a95f7b8a932e4eebb49e31435abaefd3b06)
2929
endif()
3030

3131
message(STATUS "Will fetch Unified Memory Framework from ${UMF_REPO}")

source/common/umf_helpers.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ using provider_unique_handle_t =
5050
typename std::enable_if<HAS_OP_##op<T>::value, umf_result_t>::type \
5151
CALL_OP_##op(T *t, Args &&...args) { \
5252
return t->op(std::forward<Args>(args)...); \
53-
}; \
53+
} \
5454
\
5555
static inline umf_result_t CALL_OP_##op(...) { \
5656
return UMF_RESULT_ERROR_NOT_SUPPORTED; \
5757
}
5858

59-
DEFINE_CHECK_OP(get_ipc_handle_size);
60-
DEFINE_CHECK_OP(get_ipc_handle);
61-
DEFINE_CHECK_OP(put_ipc_handle);
62-
DEFINE_CHECK_OP(open_ipc_handle);
63-
DEFINE_CHECK_OP(close_ipc_handle);
59+
DEFINE_CHECK_OP(get_ipc_handle_size)
60+
DEFINE_CHECK_OP(get_ipc_handle)
61+
DEFINE_CHECK_OP(put_ipc_handle)
62+
DEFINE_CHECK_OP(open_ipc_handle)
63+
DEFINE_CHECK_OP(close_ipc_handle)
6464

6565
#define UMF_ASSIGN_OP(ops, type, func, default_return) \
6666
ops.func = [](void *obj, auto... args) { \

source/loader/layers/sanitizer/asan_buffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) {
164164
}
165165

166166
ur_result_t MemBuffer::free() {
167-
for (const auto &[_, Ptr] : Allocations) {
167+
for (auto &&allocation : Allocations) {
168+
char *Ptr = allocation.second;
168169
ur_result_t URes =
169170
getContext()->interceptor->releaseMemory(Context, Ptr);
170171
if (URes != UR_RESULT_SUCCESS) {

source/loader/ur_lib.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ void context_t::parseEnvEnabledLayers() {
5050
}
5151

5252
void context_t::initLayers() const {
53-
for (auto &[layer, _] : layers) {
54-
layer->init((ur_dditable_t *)&urDdiTable, enabledLayerNames,
55-
codelocData);
53+
for (auto &&layer : layers) {
54+
layer.first->init((ur_dditable_t *)&urDdiTable, enabledLayerNames,
55+
codelocData);
5656
}
5757
}
5858

test/conformance/cts_exe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603
2929
f'--devices_count={args.test_devices_count}',
3030
f'--platforms_count={args.test_platforms_count}'],
31-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
31+
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
3232

3333
pat = re.compile(r'\[( )*FAILED( )*\]')
3434
output_list = []

test/layers/validation/fixtures.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct valAllDevicesTest : valPlatformTest {
128128

129129
// We use this to avoid segfaults in the mock adapter when we're doing stuff
130130
// like double releases in the leak detection tests.
131-
inline ur_result_t genericSuccessCallback(void *) { return UR_RESULT_SUCCESS; };
131+
inline ur_result_t genericSuccessCallback(void *) { return UR_RESULT_SUCCESS; }
132132

133133
// This returns valid (non-null) handles that we can safely leak.
134134
inline ur_result_t fakeContext_urContextCreate(void *pParams) {

0 commit comments

Comments
 (0)