• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpctl / 16270219306

14 Jul 2025 02:53PM UTC coverage: 85.89%. Remained the same
16270219306

Pull #2123

github

web-flow
Merge 4947f5cfd into e2789db9a
Pull Request #2123: Allow type casting of zero-sized array to any dtype

3227 of 3878 branches covered (83.21%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

12235 of 14124 relevant lines covered (86.63%)

6889.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.66
/libsyclinterface/helper/source/dpctl_utils_helper.cpp
1
//===- dpctl_utils_helper.cpp - Implementation of enum to string helpers   ===//
2
//
3
//                      Data Parallel Control (dpctl)
4
//
5
// Copyright 2020-2025 Intel Corporation
6
//
7
// Licensed under the Apache License, Version 2.0 (the "License");
8
// you may not use this file except in compliance with the License.
9
// You may obtain a copy of the License at
10
//
11
//    http://www.apache.org/licenses/LICENSE-2.0
12
//
13
// Unless required by applicable law or agreed to in writing, software
14
// distributed under the License is distributed on an "AS IS" BASIS,
15
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
// See the License for the specific language governing permissions and
17
// limitations under the License.
18
//
19
//===----------------------------------------------------------------------===//
20
///
21
/// \file
22
/// This file implements the helper functions defined in dpctl_utils_helper.h.
23
///
24
//===----------------------------------------------------------------------===//
25

26
#include "dpctl_utils_helper.h"
27
#include "Config/dpctl_config.h"
28
#include <sstream>
29
#include <string>
30

31
using namespace sycl;
32

33
/*!
34
 * Transforms enum info::device_type to string.
35
 */
36
std::string DPCTL_DeviceTypeToStr(info::device_type devTy)
37
{
32✔
38
    std::stringstream ss;
32✔
39
    switch (devTy) {
32✔
40
    case info::device_type::cpu:
28✔
41
        ss << "cpu";
28✔
42
        break;
28✔
43
    case info::device_type::gpu:
1✔
44
        ss << "gpu";
1✔
45
        break;
1✔
46
    case info::device_type::accelerator:
1✔
47
        ss << "accelerator";
1✔
48
        break;
1✔
49
    case info::device_type::custom:
1✔
50
        ss << "custom";
1✔
51
        break;
1✔
52
    default:
1✔
53
        ss << "unknown";
1✔
54
    }
32✔
55
    return ss.str();
32✔
56
}
32✔
57

58
/*!
59
 * Transforms string to enum info::device_type.
60
 */
61
info::device_type DPCTL_StrToDeviceType(const std::string &devTyStr)
62
{
5✔
63
    info::device_type devTy;
5✔
64
    if (devTyStr == "cpu") {
5✔
65
        devTy = info::device_type::cpu;
1✔
66
    }
1✔
67
    else if (devTyStr == "gpu") {
4✔
68
        devTy = info::device_type::gpu;
1✔
69
    }
1✔
70
    else if (devTyStr == "accelerator") {
3✔
71
        devTy = info::device_type::accelerator;
1✔
72
    }
1✔
73
    else if (devTyStr == "custom") {
2✔
74
        devTy = info::device_type::custom;
1✔
75
    }
1✔
76
    else {
1✔
77
        // \todo handle the error
78
        throw std::runtime_error("Unknown device type.");
1✔
79
    }
1✔
80
    return devTy;
4✔
81
}
5✔
82

83
backend DPCTL_DPCTLBackendTypeToSyclBackend(DPCTLSyclBackendType BeTy)
84
{
10✔
85
    switch (BeTy) {
10✔
86
    case DPCTLSyclBackendType::DPCTL_CUDA:
2✔
87
        return backend::ext_oneapi_cuda;
2✔
88
    case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO:
2✔
89
        return backend::ext_oneapi_level_zero;
2✔
90
    case DPCTLSyclBackendType::DPCTL_OPENCL:
2✔
91
        return backend::opencl;
2✔
92
    case DPCTLSyclBackendType::DPCTL_ALL_BACKENDS:
1✔
93
        return backend::all;
1✔
94
    case DPCTLSyclBackendType::DPCTL_HIP:
2✔
95
        return backend::ext_oneapi_hip;
2✔
96
    default:
1✔
97
        throw std::runtime_error("Unsupported backend type");
1✔
98
    }
10✔
99
}
10✔
100

101
DPCTLSyclBackendType DPCTL_SyclBackendToDPCTLBackendType(backend B)
102
{
1,752✔
103
    switch (B) {
1,752✔
104
    case backend::ext_oneapi_cuda:
1✔
105
        return DPCTLSyclBackendType::DPCTL_CUDA;
1✔
106
    case backend::ext_oneapi_level_zero:
1✔
107
        return DPCTLSyclBackendType::DPCTL_LEVEL_ZERO;
1✔
108
    case backend::opencl:
1,748✔
109
        return DPCTLSyclBackendType::DPCTL_OPENCL;
1,748✔
110
    case backend::ext_oneapi_hip:
1✔
111
        return DPCTLSyclBackendType::DPCTL_HIP;
1✔
112
    default:
1✔
113
        return DPCTLSyclBackendType::DPCTL_UNKNOWN_BACKEND;
1✔
114
    }
1,752✔
115
}
1,752✔
116

117
info::device_type DPCTL_DPCTLDeviceTypeToSyclDeviceType(DPCTLSyclDeviceType DTy)
118
{
25✔
119
    switch (DTy) {
25✔
120
    case DPCTLSyclDeviceType::DPCTL_ACCELERATOR:
4✔
121
        return info::device_type::accelerator;
4✔
122
    case DPCTLSyclDeviceType::DPCTL_ALL:
10✔
123
        return info::device_type::all;
10✔
124
    case DPCTLSyclDeviceType::DPCTL_AUTOMATIC:
1✔
125
        return info::device_type::automatic;
1✔
126
    case DPCTLSyclDeviceType::DPCTL_CPU:
5✔
127
        return info::device_type::cpu;
5✔
128
    case DPCTLSyclDeviceType::DPCTL_CUSTOM:
1✔
129
        return info::device_type::custom;
1✔
130
    case DPCTLSyclDeviceType::DPCTL_GPU:
4✔
131
        return info::device_type::gpu;
4✔
132
    default:
×
133
        throw std::runtime_error("Unsupported device type");
×
134
    }
25✔
135
}
25✔
136

137
DPCTLSyclDeviceType DPCTL_SyclDeviceTypeToDPCTLDeviceType(info::device_type D)
138
{
1,738✔
139
    switch (D) {
1,738✔
140
    case info::device_type::accelerator:
1✔
141
        return DPCTLSyclDeviceType::DPCTL_ACCELERATOR;
1✔
142
    case info::device_type::all:
1✔
143
        return DPCTLSyclDeviceType::DPCTL_ALL;
1✔
144
    case info::device_type::automatic:
1✔
145
        return DPCTLSyclDeviceType::DPCTL_AUTOMATIC;
1✔
146
    case info::device_type::cpu:
1,733✔
147
        return DPCTLSyclDeviceType::DPCTL_CPU;
1,733✔
148
    case info::device_type::custom:
1✔
149
        return DPCTLSyclDeviceType::DPCTL_CUSTOM;
1✔
150
    case info::device_type::gpu:
1✔
151
        return DPCTLSyclDeviceType::DPCTL_GPU;
1✔
152
    default:
×
153
        return DPCTLSyclDeviceType::DPCTL_UNKNOWN_DEVICE;
×
154
    }
1,738✔
155
}
1,738✔
156

157
/*!
158
 * Transforms sycl::aspect to string.
159
 */
160
std::string DPCTL_AspectToStr(aspect aspectTy)
161
{
×
162
    std::stringstream ss;
×
163
    switch (aspectTy) {
×
164
    case aspect::cpu:
×
165
        ss << "cpu";
×
166
        break;
×
167
    case aspect::gpu:
×
168
        ss << "gpu";
×
169
        break;
×
170
    case aspect::accelerator:
×
171
        ss << "accelerator";
×
172
        break;
×
173
    case aspect::custom:
×
174
        ss << "custom";
×
175
        break;
×
176
    case aspect::fp16:
×
177
        ss << "fp16";
×
178
        break;
×
179
    case aspect::fp64:
×
180
        ss << "fp64";
×
181
        break;
×
182
    case aspect::atomic64:
×
183
        ss << "atomic64";
×
184
        break;
×
185
    case aspect::image:
×
186
        ss << "image";
×
187
        break;
×
188
    case aspect::online_compiler:
×
189
        ss << "online_compiler";
×
190
        break;
×
191
    case aspect::online_linker:
×
192
        ss << "online_linker";
×
193
        break;
×
194
    case aspect::queue_profiling:
×
195
        ss << "queue_profiling";
×
196
        break;
×
197
    case aspect::usm_device_allocations:
×
198
        ss << "usm_device_allocations";
×
199
        break;
×
200
    case aspect::usm_host_allocations:
×
201
        ss << "usm_host_allocations";
×
202
        break;
×
203
    case aspect::usm_shared_allocations:
×
204
        ss << "usm_shared_allocations";
×
205
        break;
×
206
    case aspect::usm_system_allocations:
×
207
        ss << "usm_system_allocations";
×
208
        break;
×
209
    case aspect::usm_atomic_host_allocations:
×
210
        ss << "usm_atomic_host_allocations";
×
211
        break;
×
212
    case aspect::usm_atomic_shared_allocations:
×
213
        ss << "usm_atomic_shared_allocations";
×
214
        break;
×
215
    case aspect::host_debuggable:
×
216
        ss << "host_debuggable";
×
217
        break;
×
218
    case aspect::emulated:
×
219
        ss << "emulated";
×
220
        break;
×
221
    case aspect::ext_oneapi_is_component:
×
222
        ss << "is_component";
×
223
        break;
×
224
    case aspect::ext_oneapi_is_composite:
×
225
        ss << "is_composite";
×
226
        break;
×
227
    default:
×
228
        throw std::runtime_error("Unsupported aspect type");
×
229
    }
×
230
    return ss.str();
×
231
}
×
232

233
/*!
234
 * Transforms string to sycl::aspect.
235
 */
236
aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
237
{
109✔
238
    aspect aspectTy;
109✔
239
    if (aspectTyStr == "cpu") {
109✔
240
        aspectTy = aspect::cpu;
1✔
241
    }
1✔
242
    else if (aspectTyStr == "gpu") {
108✔
243
        aspectTy = aspect::gpu;
1✔
244
    }
1✔
245
    else if (aspectTyStr == "accelerator") {
107✔
246
        aspectTy = aspect::accelerator;
1✔
247
    }
1✔
248
    else if (aspectTyStr == "custom") {
106✔
249
        aspectTy = aspect::custom;
1✔
250
    }
1✔
251
    else if (aspectTyStr == "fp16") {
105✔
252
        aspectTy = aspect::fp16;
17✔
253
    }
17✔
254
    else if (aspectTyStr == "fp64") {
88✔
255
        aspectTy = aspect::fp64;
18✔
256
    }
18✔
257
    else if (aspectTyStr == "atomic64") {
70✔
258
        aspectTy = aspect::atomic64;
1✔
259
    }
1✔
260
    else if (aspectTyStr == "image") {
69✔
261
        aspectTy = aspect::image;
56✔
262
    }
56✔
263
    else if (aspectTyStr == "online_compiler") {
13✔
264
        aspectTy = aspect::online_compiler;
1✔
265
    }
1✔
266
    else if (aspectTyStr == "online_linker") {
12✔
267
        aspectTy = aspect::online_linker;
1✔
268
    }
1✔
269
    else if (aspectTyStr == "queue_profiling") {
11✔
270
        aspectTy = aspect::queue_profiling;
1✔
271
    }
1✔
272
    else if (aspectTyStr == "usm_device_allocations") {
10✔
273
        aspectTy = aspect::usm_device_allocations;
1✔
274
    }
1✔
275
    else if (aspectTyStr == "usm_host_allocations") {
9✔
276
        aspectTy = aspect::usm_host_allocations;
1✔
277
    }
1✔
278
    else if (aspectTyStr == "usm_shared_allocations") {
8✔
279
        aspectTy = aspect::usm_shared_allocations;
1✔
280
    }
1✔
281
    else if (aspectTyStr == "usm_system_allocations") {
7✔
282
        aspectTy = aspect::usm_system_allocations;
1✔
283
    }
1✔
284
    else if (aspectTyStr == "usm_atomic_host_allocations") {
6✔
285
        aspectTy = aspect::usm_atomic_host_allocations;
1✔
286
    }
1✔
287
    else if (aspectTyStr == "usm_atomic_shared_allocations") {
5✔
288
        aspectTy = aspect::usm_atomic_shared_allocations;
1✔
289
    }
1✔
290
    else if (aspectTyStr == "host_debuggable") {
4✔
291
        aspectTy = aspect::host_debuggable;
1✔
292
    }
1✔
293
    else if (aspectTyStr == "emulated") {
3✔
294
        aspectTy = aspect::emulated;
1✔
295
    }
1✔
296
    else if (aspectTyStr == "is_component") {
2✔
297
        aspectTy = aspect::ext_oneapi_is_component;
1✔
298
    }
1✔
299
    else if (aspectTyStr == "is_composite") {
1!
300
        aspectTy = aspect::ext_oneapi_is_composite;
1✔
301
    }
1✔
302
    else {
×
303
        // \todo handle the error
304
        throw std::runtime_error("Unsupported aspect type");
×
305
    }
×
306
    return aspectTy;
109✔
307
}
109✔
308

309
aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
310
{
376,454✔
311
    switch (AspectTy) {
376,454✔
312
    case DPCTLSyclAspectType::cpu:
24✔
313
        return aspect::cpu;
24✔
314
    case DPCTLSyclAspectType::gpu:
20✔
315
        return aspect::gpu;
20✔
316
    case DPCTLSyclAspectType::accelerator:
18✔
317
        return aspect::accelerator;
18✔
318
    case DPCTLSyclAspectType::custom:
18✔
319
        return aspect::custom;
18✔
320
    case DPCTLSyclAspectType::fp16:
123,917✔
321
        return aspect::fp16;
123,917✔
322
    case DPCTLSyclAspectType::fp64:
252,143✔
323
        return aspect::fp64;
252,143✔
324
    case DPCTLSyclAspectType::atomic64:
19✔
325
        return aspect::atomic64;
19✔
326
    case DPCTLSyclAspectType::image:
73✔
327
        return aspect::image;
73✔
328
    case DPCTLSyclAspectType::online_compiler:
19✔
329
        return aspect::online_compiler;
19✔
330
    case DPCTLSyclAspectType::online_linker:
19✔
331
        return aspect::online_linker;
19✔
332
    case DPCTLSyclAspectType::queue_profiling:
19✔
333
        return aspect::queue_profiling;
19✔
334
    case DPCTLSyclAspectType::usm_device_allocations:
19✔
335
        return aspect::usm_device_allocations;
19✔
336
    case DPCTLSyclAspectType::usm_host_allocations:
19✔
337
        return aspect::usm_host_allocations;
19✔
338
    case DPCTLSyclAspectType::usm_shared_allocations:
19✔
339
        return aspect::usm_shared_allocations;
19✔
340
    case DPCTLSyclAspectType::usm_system_allocations:
19✔
341
        return aspect::usm_system_allocations;
19✔
342
    case DPCTLSyclAspectType::usm_atomic_host_allocations:
19✔
343
        return aspect::usm_atomic_host_allocations;
19✔
344
    case DPCTLSyclAspectType::usm_atomic_shared_allocations:
19✔
345
        return aspect::usm_atomic_shared_allocations;
19✔
346
    case DPCTLSyclAspectType::host_debuggable:
18✔
347
        return aspect::host_debuggable;
18✔
348
    case DPCTLSyclAspectType::emulated:
18✔
349
        return aspect::emulated;
18✔
350
    case DPCTLSyclAspectType::is_component:
12✔
351
        return aspect::ext_oneapi_is_component;
12✔
352
    case DPCTLSyclAspectType::is_composite:
3✔
353
        return aspect::ext_oneapi_is_composite;
3✔
354
    default:
×
355
        throw std::runtime_error("Unsupported aspect type");
×
356
    }
376,454✔
357
}
376,454✔
358

359
DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
360
{
109✔
361
    switch (Aspect) {
109✔
362
    case aspect::cpu:
1✔
363
        return DPCTLSyclAspectType::cpu;
1✔
364
    case aspect::gpu:
1✔
365
        return DPCTLSyclAspectType::gpu;
1✔
366
    case aspect::accelerator:
1✔
367
        return DPCTLSyclAspectType::accelerator;
1✔
368
    case aspect::custom:
1✔
369
        return DPCTLSyclAspectType::custom;
1✔
370
    case aspect::fp16:
17✔
371
        return DPCTLSyclAspectType::fp16;
17✔
372
    case aspect::fp64:
18✔
373
        return DPCTLSyclAspectType::fp64;
18✔
374
    case aspect::atomic64:
1✔
375
        return DPCTLSyclAspectType::atomic64;
1✔
376
    case aspect::image:
56✔
377
        return DPCTLSyclAspectType::image;
56✔
378
    case aspect::online_compiler:
1✔
379
        return DPCTLSyclAspectType::online_compiler;
1✔
380
    case aspect::online_linker:
1✔
381
        return DPCTLSyclAspectType::online_linker;
1✔
382
    case aspect::queue_profiling:
1✔
383
        return DPCTLSyclAspectType::queue_profiling;
1✔
384
    case aspect::usm_device_allocations:
1✔
385
        return DPCTLSyclAspectType::usm_device_allocations;
1✔
386
    case aspect::usm_host_allocations:
1✔
387
        return DPCTLSyclAspectType::usm_host_allocations;
1✔
388
    case aspect::usm_shared_allocations:
1✔
389
        return DPCTLSyclAspectType::usm_shared_allocations;
1✔
390
    case aspect::usm_system_allocations:
1✔
391
        return DPCTLSyclAspectType::usm_system_allocations;
1✔
392
    case aspect::usm_atomic_host_allocations:
1✔
393
        return DPCTLSyclAspectType::usm_atomic_host_allocations;
1✔
394
    case aspect::usm_atomic_shared_allocations:
1✔
395
        return DPCTLSyclAspectType::usm_atomic_shared_allocations;
1✔
396
    case aspect::host_debuggable:
1✔
397
        return DPCTLSyclAspectType::host_debuggable;
1✔
398
    case aspect::emulated:
1✔
399
        return DPCTLSyclAspectType::emulated;
1✔
400
    case aspect::ext_oneapi_is_composite:
1✔
401
        return DPCTLSyclAspectType::is_composite;
1✔
402
    case aspect::ext_oneapi_is_component:
1✔
403
        return DPCTLSyclAspectType::is_component;
1✔
404
    default:
×
405
        throw std::runtime_error("Unsupported aspect type");
×
406
    }
109✔
407
}
109✔
408

409
info::partition_affinity_domain DPCTL_DPCTLPartitionAffinityDomainTypeToSycl(
410
    DPCTLPartitionAffinityDomainType PartitionAffinityDomainTy)
411
{
×
412
    switch (PartitionAffinityDomainTy) {
×
413
    case DPCTLPartitionAffinityDomainType::not_applicable:
×
414
        return info::partition_affinity_domain::not_applicable;
×
415
    case DPCTLPartitionAffinityDomainType::numa:
×
416
        return info::partition_affinity_domain::numa;
×
417
    case DPCTLPartitionAffinityDomainType::L4_cache:
×
418
        return info::partition_affinity_domain::L4_cache;
×
419
    case DPCTLPartitionAffinityDomainType::L3_cache:
×
420
        return info::partition_affinity_domain::L3_cache;
×
421
    case DPCTLPartitionAffinityDomainType::L2_cache:
×
422
        return info::partition_affinity_domain::L2_cache;
×
423
    case DPCTLPartitionAffinityDomainType::L1_cache:
×
424
        return info::partition_affinity_domain::L1_cache;
×
425
    case DPCTLPartitionAffinityDomainType::next_partitionable:
×
426
        return info::partition_affinity_domain::next_partitionable;
×
427
    default:
×
428
        throw std::runtime_error("Unsupported partition_affinity_domain type");
×
429
    }
×
430
}
×
431

432
DPCTLPartitionAffinityDomainType DPCTL_SyclPartitionAffinityDomainToDPCTLType(
433
    sycl::info::partition_affinity_domain PartitionAffinityDomain)
434
{
56✔
435
    switch (PartitionAffinityDomain) {
56✔
436
    case info::partition_affinity_domain::not_applicable:
8✔
437
        return DPCTLPartitionAffinityDomainType::not_applicable;
8✔
438
    case info::partition_affinity_domain::numa:
8✔
439
        return DPCTLPartitionAffinityDomainType::numa;
8✔
440
    case info::partition_affinity_domain::L4_cache:
8✔
441
        return DPCTLPartitionAffinityDomainType::L4_cache;
8✔
442
    case info::partition_affinity_domain::L3_cache:
8✔
443
        return DPCTLPartitionAffinityDomainType::L3_cache;
8✔
444
    case info::partition_affinity_domain::L2_cache:
8✔
445
        return DPCTLPartitionAffinityDomainType::L2_cache;
8✔
446
    case info::partition_affinity_domain::L1_cache:
8✔
447
        return DPCTLPartitionAffinityDomainType::L1_cache;
8✔
448
    case info::partition_affinity_domain::next_partitionable:
8✔
449
        return DPCTLPartitionAffinityDomainType::next_partitionable;
8✔
450
    default:
×
451
        throw std::runtime_error("Unsupported partition_affinity_domain type");
×
452
    }
56✔
453
}
56✔
454

455
ext::oneapi::peer_access
456
DPCTL_DPCTLPeerAccessTypeToSycl(DPCTLPeerAccessType PeerAccessTy)
457
{
2✔
458
    switch (PeerAccessTy) {
2✔
459
    case DPCTLPeerAccessType::access_supported:
1✔
460
        return ext::oneapi::peer_access::access_supported;
1✔
461
    case DPCTLPeerAccessType::atomics_supported:
1✔
462
        return ext::oneapi::peer_access::atomics_supported;
1✔
463
    default:
×
464
        throw std::runtime_error("Unsupported peer_access type");
×
465
    }
2✔
466
}
2✔
467

468
DPCTLPeerAccessType
469
DPCTL_SyclPeerAccessToDPCTLType(ext::oneapi::peer_access PeerAccess)
470
{
2✔
471
    switch (PeerAccess) {
2✔
472
    case ext::oneapi::peer_access::access_supported:
1✔
473
        return DPCTLPeerAccessType::access_supported;
1✔
474
    case ext::oneapi::peer_access::atomics_supported:
1✔
475
        return DPCTLPeerAccessType::atomics_supported;
1✔
476
    default:
×
477
        throw std::runtime_error("Unsupported peer_access type");
×
478
    }
2✔
479
}
2✔
480

481
int64_t DPCTL_GetRelativeDeviceId(const device &Device)
482
{
36✔
483
    auto relid = -1;
36✔
484
    auto p = Device.get_platform();
36✔
485
    auto be = p.get_backend();
36✔
486
    auto dt = Device.get_info<sycl::info::device::device_type>();
36✔
487
    auto dev_vec = device::get_devices(dt);
36✔
488
    int64_t id = 0;
36✔
489
    for (const auto &d_i : dev_vec) {
36!
490
        if (Device == d_i) {
36!
491
            relid = id;
36✔
492
            break;
36✔
493
        }
36✔
494
        if (d_i.get_platform().get_backend() == be)
×
495
            ++id;
×
496
    }
×
497
    return relid;
36✔
498
}
36✔
499

500
std::string DPCTL_GetDeviceFilterString(const device &Device)
501
{
26✔
502
    std::stringstream ss;
26✔
503
    static constexpr const char *filter_string_separator = ":";
26✔
504

505
    auto be = Device.get_platform().get_backend();
26✔
506

507
    switch (be) {
26✔
508
    case backend::ext_oneapi_level_zero:
×
509
        ss << "level_zero";
×
510
        break;
×
511
    case backend::ext_oneapi_cuda:
×
512
        ss << "cuda";
×
513
        break;
×
514
    case backend::opencl:
26!
515
        ss << "opencl";
26✔
516
        break;
26✔
517
    case backend::ext_oneapi_hip:
×
518
        ss << "hip";
×
519
        break;
×
520
    default:
×
521
        ss << "unknown";
×
522
    };
26✔
523

524
    ss << filter_string_separator;
26✔
525
    ss << DPCTL_DeviceTypeToStr(Device.get_info<info::device::device_type>());
26✔
526
    ss << filter_string_separator;
26✔
527
    ss << DPCTL_GetRelativeDeviceId(Device);
26✔
528

529
    return ss.str();
26✔
530
}
26✔
531

532
DPCTLSyclEventStatusType
533
DPCTL_SyclEventStatusToDPCTLEventStatusType(info::event_command_status E)
534
{
6✔
535
    switch (E) {
6✔
536
    case info::event_command_status::submitted:
2✔
537
        return DPCTLSyclEventStatusType::DPCTL_SUBMITTED;
2✔
538
    case info::event_command_status::running:
1✔
539
        return DPCTLSyclEventStatusType::DPCTL_RUNNING;
1✔
540
    case info::event_command_status::complete:
3✔
541
        return DPCTLSyclEventStatusType::DPCTL_COMPLETE;
3✔
542
    default:
×
543
        return DPCTLSyclEventStatusType::DPCTL_UNKNOWN_STATUS;
×
544
    }
6✔
545
}
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc