Skip to content

Commit

Permalink
[common] fixed some compilation warnings
Browse files Browse the repository at this point in the history
- excessive semicolons and
- unused variables
- made compiling on SLES by using UMF with fix
- use python3.6 friendly alias inestad of text param
  • Loading branch information
lslusarczyk committed Sep 10, 2024
1 parent cded5d9 commit b82b241
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion source/adapters/level_zero/v2/command_list_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void command_list_cache_t::addCommandList(const command_list_descriptor_t &desc,
raii::ze_command_list_t cmdList) {
// TODO: add a limit?
std::unique_lock<ur_mutex> Lock(ZeCommandListCacheMutex);
auto [it, _] = ZeCommandListCache.try_emplace(desc);
auto it = ZeCommandListCache.try_emplace(desc).first;
it->second.emplace(std::move(cmdList));
}

Expand Down
4 changes: 2 additions & 2 deletions source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ if (NOT DEFINED UMF_REPO)
endif()

if (NOT DEFINED UMF_TAG)
# v0.9.x 23.08.2024: Merge pull request #696 ...
set(UMF_TAG 3c340e61c197f4f9e29abd947f90ce27c571433e)
# 02 Sept 2024: Merge pull request #701
set(UMF_TAG 72e22a95f7b8a932e4eebb49e31435abaefd3b06)
endif()

message(STATUS "Will fetch Unified Memory Framework from ${UMF_REPO}")
Expand Down
12 changes: 6 additions & 6 deletions source/common/umf_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ using provider_unique_handle_t =
typename std::enable_if<HAS_OP_##op<T>::value, umf_result_t>::type \
CALL_OP_##op(T *t, Args &&...args) { \
return t->op(std::forward<Args>(args)...); \
}; \
} \
\
static inline umf_result_t CALL_OP_##op(...) { \
return UMF_RESULT_ERROR_NOT_SUPPORTED; \
}

DEFINE_CHECK_OP(get_ipc_handle_size);
DEFINE_CHECK_OP(get_ipc_handle);
DEFINE_CHECK_OP(put_ipc_handle);
DEFINE_CHECK_OP(open_ipc_handle);
DEFINE_CHECK_OP(close_ipc_handle);
DEFINE_CHECK_OP(get_ipc_handle_size)
DEFINE_CHECK_OP(get_ipc_handle)
DEFINE_CHECK_OP(put_ipc_handle)
DEFINE_CHECK_OP(open_ipc_handle)
DEFINE_CHECK_OP(close_ipc_handle)

#define UMF_ASSIGN_OP(ops, type, func, default_return) \
ops.func = [](void *obj, auto... args) { \
Expand Down
3 changes: 2 additions & 1 deletion source/loader/layers/sanitizer/asan_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) {
}

ur_result_t MemBuffer::free() {
for (const auto &[_, Ptr] : Allocations) {
for (auto &&allocation : Allocations) {
char *Ptr = allocation.second;
ur_result_t URes =
getContext()->interceptor->releaseMemory(Context, Ptr);
if (URes != UR_RESULT_SUCCESS) {
Expand Down
6 changes: 3 additions & 3 deletions source/loader/ur_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ void context_t::parseEnvEnabledLayers() {
}

void context_t::initLayers() const {
for (auto &[layer, _] : layers) {
layer->init((ur_dditable_t *)&urDdiTable, enabledLayerNames,
codelocData);
for (auto &&layer : layers) {
layer.first->init((ur_dditable_t *)&urDdiTable, enabledLayerNames,
codelocData);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/conformance/cts_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603
f'--devices_count={args.test_devices_count}',
f'--platforms_count={args.test_platforms_count}'],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)

pat = re.compile(r'\[( )*FAILED( )*\]')
output_list = []
Expand Down
2 changes: 1 addition & 1 deletion test/layers/validation/fixtures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct valAllDevicesTest : valPlatformTest {

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

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

0 comments on commit b82b241

Please sign in to comment.