Skip to content

Commit 9f1c588

Browse files
committed
applied Lukasz S. comments
1 parent 4f75bca commit 9f1c588

7 files changed

Lines changed: 20 additions & 27 deletions

File tree

src/provider/provider_level_zero.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,12 +1001,7 @@ static int ze_memory_provider_resident_device_change_helper(uintptr_t key,
10011001
return 0;
10021002
}
10031003

1004-
// TODO: add assertions to UMF and change it to be an assertion
1005-
if (info->props.base != (void *)key) {
1006-
LOG_FATAL("key:%p is different than base:%p", (void *)key,
1007-
info->props.base);
1008-
abort();
1009-
}
1004+
assert(info->props.base == (void *)key);
10101005

10111006
ze_result_t result;
10121007
if (change_data->is_adding) {
@@ -1258,9 +1253,10 @@ const umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void) {
12581253
umf_result_t umfLevelZeroMemoryProviderResidentDeviceChange(
12591254
umf_memory_provider_handle_t provider, ze_device_handle_t device,
12601255
bool is_adding) {
1261-
(void)provider(void) device,
1262-
(void)is_adding LOG_ERR(
1263-
"L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is "
1256+
(void)provider;
1257+
(void)device;
1258+
(void)is_adding;
1259+
LOG_ERR("L0 memory provider is disabled! (UMF_BUILD_LEVEL_ZERO_PROVIDER is "
12641260
"OFF)");
12651261
return UMF_RESULT_ERROR_NOT_SUPPORTED;
12661262
}

test/common/level_zero_mocks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2023-2025 Intel Corporation
3+
* Copyright (C) 2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

test/common/level_zero_mocks.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
*
3-
* Copyright (C) 2023-2025 Intel Corporation
3+
* Copyright (C) 2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77
*
88
*/
99

10-
#ifndef UMF_PROVIDER_LEVEL_ZERO_MOCKS_H
11-
#define UMF_PROVIDER_LEVEL_ZERO_MOCKS_H
10+
#ifndef UMF_TEST_PROVIDER_LEVEL_ZERO_MOCKS_H
11+
#define UMF_TEST_PROVIDER_LEVEL_ZERO_MOCKS_H
1212

1313
#include "utils/utils_log.h"
1414
#include "ze_loopback.h"
@@ -66,7 +66,8 @@ class LevelZeroMock : public LevelZero {
6666
MOCK_METHOD2(zeMemFree,
6767
ze_result_t(ze_context_handle_t hContext, void *ptr));
6868

69-
// helper setting all expects related to successful l0 provider creation & initialization and calling its creation & initialization
69+
// helper setting all expects related to successful l0 provider creation
70+
// and initialization and calling its creation and initialization
7071
umf_memory_provider_handle_t initializeMemoryProviderWithResidentDevices(
7172
ze_device_handle_t device,
7273
std::vector<ze_device_handle_t> residentDevices,
@@ -83,4 +84,4 @@ class MockedLevelZeroTestEnvironment : public ::testing::Environment {
8384
void TearDown() override;
8485
};
8586

86-
#endif //UMF_PROVIDER_LEVEL_ZERO_MOCKS_H
87+
#endif //UMF_TEST_PROVIDER_LEVEL_ZERO_MOCKS_H

test/common/ze_loopback.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2023-2025 Intel Corporation
3+
* Copyright (C) 2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@@ -288,7 +288,3 @@ zeMemFreeExt(ze_context_handle_t hContext,
288288
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
289289
abort();
290290
}
291-
292-
// defined in both libze_ops from src/utils/utils_level_zero.cpp and
293-
// ze_ops_t operations from src/provider/provider_level_zero.c
294-
// zeDeviceGetProperties, zeMemFree, zeMemGetAllocProperties, zeMemFree, zeMemAllocDevice, find them in the former ones

test/common/ze_loopback.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright (C) 2024-2025 Intel Corporation
1+
// Copyright (C) 2025 Intel Corporation
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#ifndef UMF_ZE_LOOPBACK_H
6-
#define UMF_ZE_LOOPBACK_H
5+
#ifndef UMF_TEST_ZE_LOOPBACK_H
6+
#define UMF_TEST_ZE_LOOPBACK_H
77

88
#include <level_zero/ze_api.h>
99

@@ -32,4 +32,4 @@ class LevelZero {
3232

3333
extern LevelZero *level_zero_mock;
3434

35-
#endif //UMF_ZE_LOOPBACK_H
35+
#endif //UMF_TEST_ZE_LOOPBACK_H

test/pools/pool_residency.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2024-2025 Intel Corporation
1+
// Copyright (C) 2025 Intel Corporation
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -151,4 +151,4 @@ int main(int argc, char **argv) {
151151
InitGoogleTest(&argc, argv);
152152
AddGlobalTestEnvironment(new MockedLevelZeroTestEnvironment);
153153
return RUN_ALL_TESTS();
154-
}
154+
}

test/providers/provider_level_zero_residency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2024-2025 Intel Corporation
1+
// Copyright (C) 2025 Intel Corporation
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

0 commit comments

Comments
 (0)