Skip to content

Commit 7bd5c24

Browse files
committed
not using utils_log in ze_loopback
1 parent cf4254a commit 7bd5c24

File tree

2 files changed

+32
-50
lines changed

2 files changed

+32
-50
lines changed

test/common/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ if(UMF_LEVEL_ZERO_ENABLED)
4141
target_include_directories(
4242
umf_ze_loopback PRIVATE ${ZE_LOADER_INCLUDE_DIRS} ${UMF_UTILS_DIR}
4343
${UMF_SRC_DIR} ${UMF_CMAKE_SOURCE_DIR}/include)
44-
target_link_libraries(umf_ze_loopback ${UMF_UTILS_FOR_TEST})
4544
endif()

test/common/ze_loopback.cpp

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,27 @@
88
*/
99

1010
#include "ze_loopback.h"
11-
#include "utils_log.h"
1211

1312
#include <cstdlib>
13+
#include <iostream>
1414

1515
LevelZero *level_zero_mock = nullptr;
1616

17-
//
18-
// libze_ops from src/utils/utils_level_zero.cpp
19-
//
20-
21-
void check_mock_present() {
17+
static void check_mock_present() {
2218
if (level_zero_mock == nullptr) {
23-
LOG_FATAL("level_zero_mock was not set");
19+
std::cerr << "level_zero_mock was not set\n";
2420
abort();
2521
}
2622
}
2723

24+
#define FAIL_NOT_IMPLEMENTED \
25+
std::cerr << __func__ << " not implemented in ze_loopback.cpp\n"; \
26+
abort();
27+
28+
//
29+
// libze_ops from src/utils/utils_level_zero.cpp
30+
//
31+
2832
ZE_APIEXPORT ze_result_t ZE_APICALL zeInit(ze_init_flags_t flags) {
2933
(void)flags;
3034
return ZE_RESULT_SUCCESS;
@@ -34,8 +38,7 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGet(uint32_t *pCount,
3438
ze_driver_handle_t *phDrivers) {
3539
(void)phDrivers;
3640
(void)pCount;
37-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
38-
abort();
41+
FAIL_NOT_IMPLEMENTED
3942
}
4043

4144
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGet(ze_driver_handle_t hDriver,
@@ -44,8 +47,7 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGet(ze_driver_handle_t hDriver,
4447
(void)hDriver;
4548
(void)pCount;
4649
(void)phDevices;
47-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
48-
abort();
50+
FAIL_NOT_IMPLEMENTED
4951
}
5052

5153
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetProperties(
@@ -60,15 +62,13 @@ zeContextCreate(ze_driver_handle_t hDriver, const ze_context_desc_t *desc,
6062
(void)hDriver;
6163
(void)desc;
6264
(void)phContext;
63-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
64-
abort();
65+
FAIL_NOT_IMPLEMENTED
6566
}
6667

6768
ZE_APIEXPORT ze_result_t ZE_APICALL
6869
zeContextDestroy(ze_context_handle_t hContext) {
6970
(void)hContext;
70-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
71-
abort();
71+
FAIL_NOT_IMPLEMENTED;
7272
}
7373

7474
ZE_APIEXPORT ze_result_t ZE_APICALL
@@ -79,15 +79,13 @@ zeCommandQueueCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice,
7979
(void)hDevice;
8080
(void)desc;
8181
(void)phCommandQueue;
82-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
83-
abort();
82+
FAIL_NOT_IMPLEMENTED
8483
}
8584

8685
ZE_APIEXPORT ze_result_t ZE_APICALL
8786
zeCommandQueueDestroy(ze_command_queue_handle_t hCommandQueue) {
8887
(void)hCommandQueue;
89-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
90-
abort();
88+
FAIL_NOT_IMPLEMENTED
9189
}
9290

9391
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueExecuteCommandLists(
@@ -97,16 +95,14 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueExecuteCommandLists(
9795
(void)numCommandLists;
9896
(void)phCommandLists;
9997
(void)hFence;
100-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
101-
abort();
98+
FAIL_NOT_IMPLEMENTED
10299
}
103100

104101
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueSynchronize(
105102
ze_command_queue_handle_t hCommandQueue, uint64_t timeout) {
106103
(void)hCommandQueue;
107104
(void)timeout;
108-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
109-
abort();
105+
FAIL_NOT_IMPLEMENTED
110106
}
111107

112108
ZE_APIEXPORT ze_result_t ZE_APICALL
@@ -117,22 +113,19 @@ zeCommandListCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice,
117113
(void)hDevice;
118114
(void)desc;
119115
(void)phCommandList;
120-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
121-
abort();
116+
FAIL_NOT_IMPLEMENTED
122117
}
123118

124119
ZE_APIEXPORT ze_result_t ZE_APICALL
125120
zeCommandListDestroy(ze_command_list_handle_t hCommandList) {
126121
(void)hCommandList;
127-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
128-
abort();
122+
FAIL_NOT_IMPLEMENTED
129123
}
130124

131125
ZE_APIEXPORT ze_result_t ZE_APICALL
132126
zeCommandListClose(ze_command_list_handle_t hCommandList) {
133127
(void)hCommandList;
134-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
135-
abort();
128+
FAIL_NOT_IMPLEMENTED
136129
}
137130

138131
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopy(
@@ -146,8 +139,7 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopy(
146139
(void)hSignalEvent;
147140
(void)numWaitEvents;
148141
(void)phWaitEvents;
149-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
150-
abort();
142+
FAIL_NOT_IMPLEMENTED
151143
}
152144

153145
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryFill(
@@ -162,8 +154,7 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryFill(
162154
(void)hSignalEvent;
163155
(void)numWaitEvents;
164156
(void)phWaitEvents;
165-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
166-
abort();
157+
FAIL_NOT_IMPLEMENTED
167158
}
168159

169160
ZE_APIEXPORT ze_result_t ZE_APICALL
@@ -195,8 +186,7 @@ zeDeviceGetMemoryProperties(ze_device_handle_t hDevice, uint32_t *pCount,
195186
(void)hDevice;
196187
(void)pCount;
197188
(void)pMemProperties;
198-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
199-
abort();
189+
FAIL_NOT_IMPLEMENTED
200190
}
201191

202192
//
@@ -212,8 +202,7 @@ ze_result_t ZE_APICALL zeMemAllocHost(ze_context_handle_t hContext,
212202
(void)size;
213203
(void)alignment;
214204
(void)pptr;
215-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
216-
abort();
205+
FAIL_NOT_IMPLEMENTED
217206
}
218207

219208
ze_result_t ZE_APICALL zeMemAllocShared(
@@ -227,8 +216,7 @@ ze_result_t ZE_APICALL zeMemAllocShared(
227216
(void)alignment;
228217
(void)hDevice;
229218
(void)pptr;
230-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
231-
abort();
219+
FAIL_NOT_IMPLEMENTED
232220
}
233221

234222
ze_result_t ZE_APICALL zeMemGetIpcHandle(ze_context_handle_t hContext,
@@ -237,16 +225,14 @@ ze_result_t ZE_APICALL zeMemGetIpcHandle(ze_context_handle_t hContext,
237225
(void)hContext;
238226
(void)ptr;
239227
(void)pIpcHandle;
240-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
241-
abort();
228+
FAIL_NOT_IMPLEMENTED
242229
}
243230

244231
ze_result_t ZE_APICALL zeMemPutIpcHandle(ze_context_handle_t hContext,
245232
ze_ipc_mem_handle_t handle) {
246233
(void)hContext;
247234
(void)handle;
248-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
249-
abort();
235+
FAIL_NOT_IMPLEMENTED
250236
}
251237

252238
ze_result_t ZE_APICALL zeMemOpenIpcHandle(ze_context_handle_t hContext,
@@ -259,16 +245,14 @@ ze_result_t ZE_APICALL zeMemOpenIpcHandle(ze_context_handle_t hContext,
259245
(void)handle;
260246
(void)flags;
261247
(void)pptr;
262-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
263-
abort();
248+
FAIL_NOT_IMPLEMENTED
264249
}
265250

266251
ze_result_t ZE_APICALL zeMemCloseIpcHandle(ze_context_handle_t hContext,
267252
const void *ptr) {
268253
(void)hContext;
269254
(void)ptr;
270-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
271-
abort();
255+
FAIL_NOT_IMPLEMENTED
272256
}
273257

274258
ze_result_t ZE_APICALL zeContextMakeMemoryResident(ze_context_handle_t hContext,
@@ -285,6 +269,5 @@ zeMemFreeExt(ze_context_handle_t hContext,
285269
(void)hContext;
286270
(void)pMemFreeDesc;
287271
(void)ptr;
288-
LOG_FATAL("not implemented, call in ze_loader_mock not passed to gmock");
289-
abort();
272+
FAIL_NOT_IMPLEMENTED
290273
}

0 commit comments

Comments
 (0)