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

IntelPython / dpctl / 47405022849

04 Dec 2026 07:07PM UTC coverage: 76.45% (+1.3%) from 75.182%
47405022849

Pull #2440

github

web-flow
Merge 90ec03eae into aacf76633
Pull Request #2440: Add kernel bundle states, kernel ids and SYCL library loading

1203 of 1660 branches covered (72.47%)

Branch coverage included in aggregate %.

761 of 957 new or added lines in 4 files covered. (79.52%)

13 existing lines in 2 files now uncovered.

4809 of 6204 relevant lines covered (77.51%)

281.06 hits per line

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

90.74
/libsyclinterface/source/dpctl_sycl_kernel_bundle_state_interface.cpp
1
//===- dpctl_sycl_kernel_bundle_state_interface.cpp - Implements C API for
2
//     sycl::kernel_bundle states and sycl::kernel_id         -*-C++-*- ===//
3
//
4
//                      Data Parallel Control (dpctl)
5
//
6
// Copyright 2026 Intel Corporation
7
//
8
// Licensed under the Apache License, Version 2.0 (the "License");
9
// you may not use this file except in compliance with the License.
10
// You may obtain a copy of the License at
11
//
12
//    http://www.apache.org/licenses/LICENSE-2.0
13
//
14
// Unless required by applicable law or agreed to in writing, software
15
// distributed under the License is distributed on an "AS IS" BASIS,
16
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
// See the License for the specific language governing permissions and
18
// limitations under the License.
19
//
20
//===----------------------------------------------------------------------===//
21
///
22
/// \file
23
/// This file implements the kernel_id functions and the kernel_bundle
24
/// functions for the input, object and executable bundle states declared in
25
/// dpctl_sycl_kernel_bundle_interface.h.
26
///
27
//===----------------------------------------------------------------------===//
28

29
#include "dpctl_sycl_kernel_bundle_interface.h"
30

31
#include "Config/dpctl_config.h"
32
#include "dpctl_error_handlers.h"
33
#include "dpctl_string_utils.hpp"
34
#include "dpctl_sycl_type_casters.hpp"
35
#include "dpctl_utils_helper.h"
36
#include <cstddef>
37
#include <functional>
38
#include <iterator>
39
#include <memory>
40
#include <mutex>
41
#include <stdexcept>
42
#include <string>
43
#include <sycl/sycl.hpp>
44
#include <unordered_map>
45
#include <unordered_set>
46
#include <utility>
47
#include <vector>
48

49
#ifdef _WIN32
50
#define NOMINMAX
51
#include <windows.h>
52
#else
53
#include <dlfcn.h>
54
#endif
55

56
#ifndef __ADAPTIVECPP__
57

58
using namespace sycl;
59

60
namespace
61
{
62
static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED,
63
              "The compiler does not meet minimum version requirement");
64

65
using namespace dpctl::syclinterface;
66

67
template <bundle_state S> struct bundle_ref;
68
template <> struct bundle_ref<bundle_state::input>
69
{
70
    using type = DPCTLSyclInputKernelBundleRef;
71
};
72
template <> struct bundle_ref<bundle_state::object>
73
{
74
    using type = DPCTLSyclObjectKernelBundleRef;
75
};
76
template <> struct bundle_ref<bundle_state::executable>
77
{
78
    using type = DPCTLSyclKernelBundleRef;
79
};
80
template <bundle_state S> using bundle_ref_t = typename bundle_ref<S>::type;
81

82
std::vector<device> unwrap_devices(DPCTLDeviceVectorRef DVRef)
83
{
71 ✔
84
    auto DV = unwrap<std::vector<DPCTLSyclDeviceRef>>(DVRef);
71 ✔
85
    std::vector<device> Devs;
71 ✔
86
    Devs.reserve(DV->size());
71 ✔
87
    for (auto DRef : *DV) {
71 ✔
88
        auto D = unwrap<device>(DRef);
71 ✔
89
        if (!D)
71 !
NEW
90
            throw std::invalid_argument("Device vector has a nullptr element");
×
91
        Devs.push_back(*D);
71 ✔
92
    }
71 ✔
93
    return Devs;
71 ✔
94
}
71 ✔
95

96
std::vector<kernel_id> unwrap_kernel_ids(DPCTLKernelIdVectorRef KIdVRef)
97
{
24 ✔
98
    auto KIdV = unwrap<std::vector<DPCTLSyclKernelIdRef>>(KIdVRef);
24 ✔
99
    std::vector<kernel_id> KIds;
24 ✔
100
    KIds.reserve(KIdV->size());
24 ✔
101
    for (auto KIdRef : *KIdV) {
46 ✔
102
        auto KId = unwrap<kernel_id>(KIdRef);
46 ✔
103
        if (!KId)
46 !
NEW
104
            throw std::invalid_argument(
×
NEW
105
                "Kernel id vector has a nullptr element");
×
106
        KIds.push_back(*KId);
46 ✔
107
    }
46 ✔
108
    return KIds;
24 ✔
109
}
24 ✔
110

111
__dpctl_give DPCTLDeviceVectorRef wrap_devices(const std::vector<device> &Devs)
112
{
12 ✔
113
    auto DV = std::make_unique<std::vector<DPCTLSyclDeviceRef>>();
12 ✔
114
    DV->reserve(Devs.size());
12 ✔
115
    for (const auto &D : Devs)
12 ✔
116
        DV->push_back(wrap<device>(new device(D)));
12 ✔
117
    return wrap<std::vector<DPCTLSyclDeviceRef>>(DV.release());
12 ✔
118
}
12 ✔
119

120
__dpctl_give DPCTLKernelIdVectorRef
121
wrap_kernel_ids(const std::vector<kernel_id> &KIds)
122
{
46 ✔
123
    auto KIdV = std::make_unique<std::vector<DPCTLSyclKernelIdRef>>();
46 ✔
124
    KIdV->reserve(KIds.size());
46 ✔
125
    for (const auto &KId : KIds)
46 ✔
126
        KIdV->push_back(wrap<kernel_id>(new kernel_id(KId)));
497 ✔
127
    return wrap<std::vector<DPCTLSyclKernelIdRef>>(KIdV.release());
46 ✔
128
}
46 ✔
129

130
template <bundle_state S>
131
__dpctl_give bundle_ref_t<S> wrap_bundle(kernel_bundle<S> &&KB)
132
{
79 ✔
133
    return wrap<kernel_bundle<S>>(new kernel_bundle<S>(std::move(KB)));
79 ✔
134
}
79 ✔
135

136
template <bundle_state S>
137
__dpctl_give bundle_ref_t<S>
138
create_from_context_impl(DPCTLSyclContextRef CRef,
139
                         DPCTLDeviceVectorRef DVRef,
140
                         DPCTLKernelIdVectorRef KIdVRef,
141
                         const char *Fn)
142
{
49 ✔
143
    auto Ctx = unwrap<context>(CRef);
49 ✔
144
    if (!Ctx) {
49 ✔
145
        error_handler("Input CRef is nullptr", __FILE__, Fn, __LINE__);
1 ✔
146
        return nullptr;
1 ✔
147
    }
1 ✔
148
    try {
48 ✔
149
        auto Devs = DVRef ? unwrap_devices(DVRef) : Ctx->get_devices();
48 ✔
150
        if (KIdVRef)
48 ✔
151
            return wrap_bundle<S>(sycl::get_kernel_bundle<S>(
13 ✔
152
                *Ctx, Devs, unwrap_kernel_ids(KIdVRef)));
13 ✔
153
        return wrap_bundle<S>(sycl::get_kernel_bundle<S>(*Ctx, Devs));
35 ✔
154
    } catch (std::exception const &e) {
48 ✔
NEW
155
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
156
        return nullptr;
×
NEW
157
    }
×
158
}
48 ✔
159

160
template <bundle_state S>
161
bool can_create_from_context_impl(DPCTLSyclContextRef CRef,
162
                                  DPCTLDeviceVectorRef DVRef,
163
                                  DPCTLKernelIdVectorRef KIdVRef,
164
                                  const char *Fn)
165
{
13 ✔
166
    auto Ctx = unwrap<context>(CRef);
13 ✔
167
    if (!Ctx) {
13 ✔
168
        error_handler("Input CRef is nullptr", __FILE__, Fn, __LINE__);
1 ✔
169
        return false;
1 ✔
170
    }
1 ✔
171
    try {
12 ✔
172
        auto Devs = DVRef ? unwrap_devices(DVRef) : Ctx->get_devices();
12 !
173
        if (KIdVRef)
12 ✔
174
            return sycl::has_kernel_bundle<S>(*Ctx, Devs,
7 ✔
175
                                              unwrap_kernel_ids(KIdVRef));
7 ✔
176
        return sycl::has_kernel_bundle<S>(*Ctx, Devs);
5 ✔
177
    } catch (std::exception const &e) {
12 ✔
NEW
178
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
179
        return false;
×
NEW
180
    }
×
181
}
12 ✔
182

183
template <bundle_state S>
184
const kernel_bundle<S> *get_bundle_impl(bundle_ref_t<S> KBRef, const char *Fn)
185
{
181 ✔
186
    auto KB = unwrap<kernel_bundle<S>>(KBRef);
181 ✔
187
    if (!KB)
181 ✔
188
        error_handler("Input KBRef is nullptr", __FILE__, Fn, __LINE__);
24 ✔
189
    return KB;
181 ✔
190
}
181 ✔
191

192
template <bundle_state S>
193
__dpctl_give bundle_ref_t<S> copy_bundle_impl(bundle_ref_t<S> KBRef,
194
                                              const char *Fn)
195
{
5 ✔
196
    auto KB = get_bundle_impl<S>(KBRef, Fn);
5 ✔
197
    if (!KB)
5 ✔
198
        return nullptr;
1 ✔
199
    try {
4 ✔
200
        return wrap<kernel_bundle<S>>(new kernel_bundle<S>(*KB));
4 ✔
201
    } catch (std::exception const &e) {
4 ✔
NEW
202
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
203
        return nullptr;
×
NEW
204
    }
×
205
}
4 ✔
206

207
template <bundle_state S>
208
__dpctl_give DPCTLSyclContextRef get_context_impl(bundle_ref_t<S> KBRef,
209
                                                  const char *Fn)
210
{
20 ✔
211
    auto KB = get_bundle_impl<S>(KBRef, Fn);
20 ✔
212
    if (!KB)
20 ✔
213
        return nullptr;
2 ✔
214
    try {
18 ✔
215
        return wrap<context>(new context(KB->get_context()));
18 ✔
216
    } catch (std::exception const &e) {
18 ✔
NEW
217
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
218
        return nullptr;
×
NEW
219
    }
×
220
}
18 ✔
221

222
template <bundle_state S>
223
__dpctl_give DPCTLDeviceVectorRef get_devices_impl(bundle_ref_t<S> KBRef,
224
                                                   const char *Fn)
225
{
15 ✔
226
    auto KB = get_bundle_impl<S>(KBRef, Fn);
15 ✔
227
    if (!KB)
15 ✔
228
        return nullptr;
3 ✔
229
    try {
12 ✔
230
        return wrap_devices(KB->get_devices());
12 ✔
231
    } catch (std::exception const &e) {
12 ✔
NEW
232
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
233
        return nullptr;
×
NEW
234
    }
×
235
}
12 ✔
236

237
template <bundle_state S>
238
DPCTLSyclBackendType get_backend_impl(bundle_ref_t<S> KBRef, const char *Fn)
239
{
12 ✔
240
    auto KB = get_bundle_impl<S>(KBRef, Fn);
12 ✔
241
    if (!KB)
12 ✔
242
        return DPCTL_UNKNOWN_BACKEND;
2 ✔
243
    try {
10 ✔
244
        return DPCTL_SyclBackendToDPCTLBackendType(KB->get_backend());
10 ✔
245
    } catch (std::exception const &e) {
10 ✔
NEW
246
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
247
        return DPCTL_UNKNOWN_BACKEND;
×
NEW
248
    }
×
249
}
10 ✔
250

251
template <bundle_state S>
252
bool is_empty_impl(bundle_ref_t<S> KBRef, const char *Fn)
253
{
16 ✔
254
    auto KB = get_bundle_impl<S>(KBRef, Fn);
16 ✔
255
    return KB ? KB->empty() : false;
16 ✔
256
}
16 ✔
257

258
template <bundle_state S>
259
__dpctl_give DPCTLKernelIdVectorRef get_kernel_ids_impl(bundle_ref_t<S> KBRef,
260
                                                        const char *Fn)
261
{
22 ✔
262
    auto KB = get_bundle_impl<S>(KBRef, Fn);
22 ✔
263
    if (!KB)
22 ✔
264
        return nullptr;
3 ✔
265
    try {
19 ✔
266
        return wrap_kernel_ids(KB->get_kernel_ids());
19 ✔
267
    } catch (std::exception const &e) {
19 ✔
NEW
268
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
269
        return nullptr;
×
NEW
270
    }
×
271
}
19 ✔
272

273
template <bundle_state S>
274
bool has_kernel_id_impl(bundle_ref_t<S> KBRef,
275
                        DPCTLSyclKernelIdRef KIdRef,
276
                        DPCTLSyclDeviceRef DRef,
277
                        const char *Fn)
278
{
22 ✔
279
    auto KB = get_bundle_impl<S>(KBRef, Fn);
22 ✔
280
    if (!KB)
22 !
NEW
281
        return false;
×
282
    auto KId = unwrap<kernel_id>(KIdRef);
22 ✔
283
    if (!KId) {
22 ✔
284
        error_handler("Input KIdRef is nullptr", __FILE__, Fn, __LINE__);
1 ✔
285
        return false;
1 ✔
286
    }
1 ✔
287
    try {
21 ✔
288
        if (auto D = unwrap<device>(DRef))
21 ✔
289
            return KB->has_kernel(*KId, *D);
13 ✔
290
        return KB->has_kernel(*KId);
8 ✔
291
    } catch (std::exception const &e) {
21 ✔
NEW
292
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
293
        return false;
×
NEW
294
    }
×
295
}
21 ✔
296

297
template <bundle_state S>
298
bool contains_specialization_constants_impl(bundle_ref_t<S> KBRef,
299
                                            const char *Fn)
300
{
9 ✔
301
    auto KB = get_bundle_impl<S>(KBRef, Fn);
9 ✔
302
    return KB ? KB->contains_specialization_constants() : false;
9 ✔
303
}
9 ✔
304

305
template <bundle_state S>
306
bool native_specialization_constant_impl(bundle_ref_t<S> KBRef, const char *Fn)
307
{
7 ✔
308
    auto KB = get_bundle_impl<S>(KBRef, Fn);
7 ✔
309
    return KB ? KB->native_specialization_constant() : false;
7 ✔
310
}
7 ✔
311

312
template <bundle_state S>
313
size_t get_num_device_images_impl(bundle_ref_t<S> KBRef, const char *Fn)
314
{
18 ✔
315
    auto KB = get_bundle_impl<S>(KBRef, Fn);
18 ✔
316
    if (!KB)
18 ✔
317
        return 0;
2 ✔
318
    return static_cast<size_t>(std::distance(KB->begin(), KB->end()));
16 ✔
319
}
18 ✔
320

321
template <bundle_state S>
322
bool device_image_has_kernel_impl(bundle_ref_t<S> KBRef,
323
                                  size_t Index,
324
                                  DPCTLSyclKernelIdRef KIdRef,
325
                                  DPCTLSyclDeviceRef DRef,
326
                                  const char *Fn)
327
{
17 ✔
328
    auto KB = get_bundle_impl<S>(KBRef, Fn);
17 ✔
329
    if (!KB)
17 ✔
330
        return false;
2 ✔
331
    auto KId = unwrap<kernel_id>(KIdRef);
15 ✔
332
    if (!KId) {
15 ✔
333
        error_handler("Input KIdRef is nullptr", __FILE__, Fn, __LINE__);
1 ✔
334
        return false;
1 ✔
335
    }
1 ✔
336
    auto NumImages = static_cast<size_t>(std::distance(KB->begin(), KB->end()));
14 ✔
337
    if (Index >= NumImages) {
14 ✔
338
        error_handler("Device image index " + std::to_string(Index) +
3 ✔
339
                          " is out of range for a kernel bundle with " +
3 ✔
340
                          std::to_string(NumImages) + " device images",
3 ✔
341
                      __FILE__, Fn, __LINE__);
3 ✔
342
        return false;
3 ✔
343
    }
3 ✔
344
    try {
11 ✔
345
        auto It = KB->begin();
11 ✔
346
        std::advance(It, Index);
11 ✔
347
        if (auto D = unwrap<device>(DRef))
11 ✔
348
            return It->has_kernel(*KId, *D);
5 ✔
349
        return It->has_kernel(*KId);
6 ✔
350
    } catch (std::exception const &e) {
11 ✔
NEW
351
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
352
        return false;
×
NEW
353
    }
×
354
}
11 ✔
355

356
template <bundle_state S>
357
std::vector<kernel_bundle<S>> unwrap_bundles(size_t NumKBRefs,
358
                                             const bundle_ref_t<S> *KBRefs)
359
{
17 ✔
360
    if (NumKBRefs == 0 || !KBRefs)
17 !
361
        throw std::invalid_argument("No kernel bundles were given");
2 ✔
362
    std::vector<kernel_bundle<S>> Bundles;
15 ✔
363
    Bundles.reserve(NumKBRefs);
15 ✔
364
    for (size_t i = 0; i < NumKBRefs; ++i) {
40 ✔
365
        auto KB = unwrap<kernel_bundle<S>>(KBRefs[i]);
26 ✔
366
        if (!KB)
26 ✔
367
            throw std::invalid_argument(
1 ✔
368
                "Kernel bundle array has a nullptr element");
1 ✔
369
        Bundles.push_back(*KB);
25 ✔
370
    }
25 ✔
371
    return Bundles;
14 ✔
372
}
15 ✔
373

374
template <bundle_state S>
375
__dpctl_give bundle_ref_t<S> join_bundles_impl(size_t NumKBRefs,
376
                                               const bundle_ref_t<S> *KBRefs,
377
                                               const char *Fn)
378
{
11 ✔
379
    try {
11 ✔
380
        return wrap_bundle<S>(sycl::join(unwrap_bundles<S>(NumKBRefs, KBRefs)));
11 ✔
381
    } catch (std::exception const &e) {
11 ✔
382
        error_handler(e, __FILE__, Fn, __LINE__);
1 ✔
383
        return nullptr;
1 ✔
384
    }
1 ✔
385
}
11 ✔
386

387
struct device_image_view
388
{
389
    std::function<bool(const kernel_id &, const device *)> has_kernel;
390
};
391

392
template <bundle_state S>
393
__dpctl_give bundle_ref_t<S>
394
create_with_selector_impl(DPCTLSyclContextRef CRef,
395
                          DPCTLDeviceVectorRef DVRef,
396
                          DPCTLDeviceImageSelectorFn Selector,
397
                          void *UserData,
398
                          const char *Fn)
399
{
12 ✔
400
    auto Ctx = unwrap<context>(CRef);
12 ✔
401
    if (!Ctx) {
12 ✔
402
        error_handler("Input CRef is nullptr", __FILE__, Fn, __LINE__);
1 ✔
403
        return nullptr;
1 ✔
404
    }
1 ✔
405
    if (!Selector) {
11 ✔
406
        error_handler("Input Selector is nullptr", __FILE__, Fn, __LINE__);
1 ✔
407
        return nullptr;
1 ✔
408
    }
1 ✔
409
    try {
10 ✔
410
        auto Devs = DVRef ? unwrap_devices(DVRef) : Ctx->get_devices();
10 ✔
411
        auto Sel = [Selector, UserData](const device_image<S> &Img) {
30 ✔
412
            device_image_view View{
30 ✔
413
                [&Img](const kernel_id &KId, const device *D) {
30 ✔
414
                    return D ? Img.has_kernel(KId, *D) : Img.has_kernel(KId);
15 ✔
415
                }};
15 ✔
416
            return Selector(reinterpret_cast<DPCTLSyclDeviceImageRef>(&View),
30 ✔
417
                            UserData);
30 ✔
418
        };
30 ✔
419
        return wrap_bundle<S>(sycl::get_kernel_bundle<S>(*Ctx, Devs, Sel));
10 ✔
420
    } catch (std::exception const &e) {
10 ✔
NEW
421
        error_handler(e, __FILE__, Fn, __LINE__);
×
NEW
422
        return nullptr;
×
NEW
423
    }
×
424
}
10 ✔
425

426
// Kernel ids registered by each library loaded with DPCTLKernelId_LoadLibrary
427
struct loaded_kernel_libraries
428
{
429
    std::mutex Mutex;
430
    std::unordered_map<void *, std::vector<kernel_id>> KernelIds;
431
};
432

433
loaded_kernel_libraries &get_loaded_kernel_libraries()
434
{
13 ✔
435
    // never destroyed, as the libraries are never unloaded
436
    static auto *Libs = new loaded_kernel_libraries;
13 ✔
437
    return *Libs;
13 ✔
438
}
13 ✔
439

440
#ifdef _WIN32
441
std::wstring utf8_to_wide(const char *Str)
442
{
443
    int N =
444
        MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, Str, -1, nullptr, 0);
445
    if (N <= 0)
446
        return std::wstring{};
447
    std::wstring W(static_cast<size_t>(N), L'\0');
448
    if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, Str, -1, W.data(),
449
                            N) <= 0)
450
        return std::wstring{};
451
    W.resize(static_cast<size_t>(N) - 1);
452
    return W;
453
}
454
#endif
455

456
void *open_library(const char *Path, std::string &Error)
457
{
13 ✔
458
#ifdef _WIN32
459
    std::wstring WPath = utf8_to_wide(Path);
460
    if (WPath.empty()) {
461
        Error = "the path is not valid UTF-8";
462
        return nullptr;
463
    }
464
    // the search flags require an absolute path with backslashes
465
    DWORD N = GetFullPathNameW(WPath.c_str(), 0, nullptr, nullptr);
466
    if (N == 0) {
467
        Error = "GetFullPathNameW failed with error code " +
468
                std::to_string(GetLastError());
469
        return nullptr;
470
    }
471
    std::wstring FullPath(N, L'\0');
472
    N = GetFullPathNameW(WPath.c_str(), N, FullPath.data(), nullptr);
473
    if (N == 0 || N >= FullPath.size()) {
474
        Error = "GetFullPathNameW failed with error code " +
475
                std::to_string(GetLastError());
476
        return nullptr;
477
    }
478
    FullPath.resize(N);
479
    void *Handle = LoadLibraryExW(FullPath.c_str(), nullptr,
480
                                  LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
481
                                      LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
482
    if (!Handle)
483
        Error = "LoadLibraryExW failed with error code " +
484
                std::to_string(GetLastError());
485
#else
486
    void *Handle = dlopen(Path, RTLD_NOW | RTLD_LOCAL);
13 ✔
487
    if (!Handle) {
13 ✔
488
        const char *Msg = dlerror();
3 ✔
489
        Error = Msg ? Msg : "dlopen failed";
3 !
490
    }
3 ✔
491
#endif
13 ✔
492
    return Handle;
13 ✔
493
}
13 ✔
494

495
} // end of anonymous namespace
496

497
#undef EL
498
#undef EL_SYCL_TYPE
499
#define EL KernelId
500
#define EL_SYCL_TYPE sycl::kernel_id
1,276 ✔
501
#include "dpctl_vector_templ.cpp"
502
#undef EL
503
#undef EL_SYCL_TYPE
504

505
__dpctl_give const char *
506
DPCTLKernelId_GetName(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
507
{
439 ✔
508
    auto KId = unwrap<kernel_id>(KIdRef);
439 ✔
509
    if (!KId) {
439 ✔
510
        error_handler("Input KIdRef is nullptr", __FILE__, __func__, __LINE__);
1 ✔
511
        return nullptr;
1 ✔
512
    }
1 ✔
513
    return dpctl::helper::cstring_from_string(KId->get_name());
438 ✔
514
}
439 ✔
515

516
bool DPCTLKernelId_AreEq(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef1,
517
                         __dpctl_keep const DPCTLSyclKernelIdRef KIdRef2)
518
{
9 ✔
519
    auto KId1 = unwrap<kernel_id>(KIdRef1);
9 ✔
520
    auto KId2 = unwrap<kernel_id>(KIdRef2);
9 ✔
521
    if (!(KId1 && KId2)) {
9 !
522
        error_handler("At least one of the inputs is nullptr", __FILE__,
1 ✔
523
                      __func__, __LINE__);
1 ✔
524
        return false;
1 ✔
525
    }
1 ✔
526
    return *KId1 == *KId2;
8 ✔
527
}
9 ✔
528

529
size_t DPCTLKernelId_Hash(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
530
{
24 ✔
531
    auto KId = unwrap<kernel_id>(KIdRef);
24 ✔
532
    if (!KId) {
24 ✔
533
        error_handler("Input KIdRef is nullptr", __FILE__, __func__, __LINE__);
1 ✔
534
        return 0;
1 ✔
535
    }
1 ✔
536
    std::hash<kernel_id> hash_fn;
23 ✔
537
    return hash_fn(*KId);
23 ✔
538
}
24 ✔
539

540
__dpctl_give DPCTLSyclKernelIdRef
541
DPCTLKernelId_Copy(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
542
{
3 ✔
543
    auto KId = unwrap<kernel_id>(KIdRef);
3 ✔
544
    if (!KId) {
3 ✔
545
        error_handler("Cannot copy DPCTLSyclKernelIdRef as input is a nullptr",
1 ✔
546
                      __FILE__, __func__, __LINE__);
1 ✔
547
        return nullptr;
1 ✔
548
    }
1 ✔
549
    try {
2 ✔
550
        return wrap<kernel_id>(new kernel_id(*KId));
2 ✔
551
    } catch (std::exception const &e) {
2 ✔
NEW
552
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
553
        return nullptr;
×
NEW
554
    }
×
555
}
2 ✔
556

557
void DPCTLKernelId_Delete(__dpctl_take DPCTLSyclKernelIdRef KIdRef)
558
{
690 ✔
559
    delete unwrap<kernel_id>(KIdRef);
690 ✔
560
}
690 ✔
561

562
__dpctl_give DPCTLKernelIdVectorRef DPCTLKernelId_GetAll(void)
563
{
17 ✔
564
    try {
17 ✔
565
        return wrap_kernel_ids(sycl::get_kernel_ids());
17 ✔
566
    } catch (std::exception const &e) {
17 ✔
NEW
567
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
568
        return nullptr;
×
NEW
569
    }
×
570
}
17 ✔
571

572
__dpctl_give DPCTLKernelIdVectorRef
573
DPCTLKernelId_LoadLibrary(__dpctl_keep const char *Path)
574
{
14 ✔
575
    if (!Path) {
14 ✔
576
        error_handler("Input Path is nullptr", __FILE__, __func__, __LINE__);
1 ✔
577
        return nullptr;
1 ✔
578
    }
1 ✔
579
    auto &Libs = get_loaded_kernel_libraries();
13 ✔
580
    try {
13 ✔
581
        std::lock_guard<std::mutex> Lock(Libs.Mutex);
13 ✔
582
        auto Before = sycl::get_kernel_ids();
13 ✔
583
        std::string Error;
13 ✔
584
        void *Handle = open_library(Path, Error);
13 ✔
585
        if (!Handle) {
13 ✔
586
            error_handler("Could not load " + std::string(Path) + ": " + Error,
3 ✔
587
                          __FILE__, __func__, __LINE__);
3 ✔
588
            return nullptr;
3 ✔
589
        }
3 ✔
590
        auto It = Libs.KernelIds.find(Handle);
10 ✔
591
        if (It == Libs.KernelIds.end()) {
10 ✔
592
            std::unordered_set<kernel_id> Known(Before.begin(), Before.end());
4 ✔
593
            std::vector<kernel_id> New;
4 ✔
594
            for (const auto &KId : sycl::get_kernel_ids()) {
62 ✔
595
                if (Known.count(KId) == 0)
62 ✔
596
                    New.push_back(KId);
4 ✔
597
            }
62 ✔
598
            It = Libs.KernelIds.emplace(Handle, std::move(New)).first;
4 ✔
599
        }
4 ✔
600
        return wrap_kernel_ids(It->second);
10 ✔
601
    } catch (std::exception const &e) {
13 ✔
NEW
602
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
603
        return nullptr;
×
NEW
604
    }
×
605
}
13 ✔
606

607
bool DPCTLKernelId_IsCompatible(__dpctl_keep const DPCTLKernelIdVectorRef
608
                                    KIdVRef,
609
                                __dpctl_keep const DPCTLSyclDeviceRef DRef)
610
{
6 ✔
611
    auto D = unwrap<device>(DRef);
6 ✔
612
    if (!(KIdVRef && D)) {
6 ✔
613
        error_handler("At least one of the inputs is nullptr", __FILE__,
2 ✔
614
                      __func__, __LINE__);
2 ✔
615
        return false;
2 ✔
616
    }
2 ✔
617
    try {
4 ✔
618
        return sycl::is_compatible(unwrap_kernel_ids(KIdVRef), *D);
4 ✔
619
    } catch (std::exception const &e) {
4 ✔
NEW
620
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
621
        return false;
×
NEW
622
    }
×
623
}
4 ✔
624

625
__dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromContext(
626
    __dpctl_keep const DPCTLSyclContextRef CRef,
627
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
628
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
629
{
29 ✔
630
    return create_from_context_impl<bundle_state::executable>(
29 ✔
631
        CRef, DVRef, KIdVRef, __func__);
29 ✔
632
}
29 ✔
633

634
bool DPCTLKernelBundle_CanCreateFromContext(
635
    __dpctl_keep const DPCTLSyclContextRef CRef,
636
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
637
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
638
{
4 ✔
639
    return can_create_from_context_impl<bundle_state::executable>(
4 ✔
640
        CRef, DVRef, KIdVRef, __func__);
4 ✔
641
}
4 ✔
642

643
__dpctl_give DPCTLSyclContextRef
644
DPCTLKernelBundle_GetContext(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
645
{
5 ✔
646
    return get_context_impl<bundle_state::executable>(KBRef, __func__);
5 ✔
647
}
5 ✔
648

649
__dpctl_give DPCTLDeviceVectorRef
650
DPCTLKernelBundle_GetDevices(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
651
{
6 ✔
652
    return get_devices_impl<bundle_state::executable>(KBRef, __func__);
6 ✔
653
}
6 ✔
654

655
DPCTLSyclBackendType
656
DPCTLKernelBundle_GetBackend(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
657
{
7 ✔
658
    return get_backend_impl<bundle_state::executable>(KBRef, __func__);
7 ✔
659
}
7 ✔
660

661
bool DPCTLKernelBundle_IsEmpty(
662
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
663
{
7 ✔
664
    return is_empty_impl<bundle_state::executable>(KBRef, __func__);
7 ✔
665
}
7 ✔
666

667
__dpctl_give DPCTLKernelIdVectorRef DPCTLKernelBundle_GetKernelIds(
668
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
669
{
16 ✔
670
    return get_kernel_ids_impl<bundle_state::executable>(KBRef, __func__);
16 ✔
671
}
16 ✔
672

673
bool DPCTLKernelBundle_HasKernelId(
674
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
675
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
676
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
677
{
12 ✔
678
    return has_kernel_id_impl<bundle_state::executable>(KBRef, KIdRef, DRef,
12 ✔
679
                                                        __func__);
12 ✔
680
}
12 ✔
681

682
bool DPCTLKernelBundle_ContainsSpecializationConstants(
683
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
684
{
3 ✔
685
    return contains_specialization_constants_impl<bundle_state::executable>(
3 ✔
686
        KBRef, __func__);
3 ✔
687
}
3 ✔
688

689
bool DPCTLKernelBundle_NativeSpecializationConstant(
690
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
691
{
3 ✔
692
    return native_specialization_constant_impl<bundle_state::executable>(
3 ✔
693
        KBRef, __func__);
3 ✔
694
}
3 ✔
695

696
size_t DPCTLKernelBundle_GetNumDeviceImages(
697
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
698
{
8 ✔
699
    return get_num_device_images_impl<bundle_state::executable>(KBRef,
8 ✔
700
                                                                __func__);
8 ✔
701
}
8 ✔
702

703
bool DPCTLKernelBundle_DeviceImageHasKernel(
704
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
705
    size_t Index,
706
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
707
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
708
{
7 ✔
709
    return device_image_has_kernel_impl<bundle_state::executable>(
7 ✔
710
        KBRef, Index, KIdRef, DRef, __func__);
7 ✔
711
}
7 ✔
712

713
__dpctl_give DPCTLSyclKernelBundleRef
714
DPCTLKernelBundle_Join(size_t NumKBRefs,
715
                       __dpctl_keep const DPCTLSyclKernelBundleRef *KBRefs)
716
{
7 ✔
717
    return join_bundles_impl<bundle_state::executable>(NumKBRefs, KBRefs,
7 ✔
718
                                                       __func__);
7 ✔
719
}
7 ✔
720

721
__dpctl_give DPCTLSyclKernelRef DPCTLKernelBundle_GetKernelById(
722
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
723
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
724
{
9 ✔
725
    auto KB = get_bundle_impl<bundle_state::executable>(KBRef, __func__);
9 ✔
726
    if (!KB)
9 ✔
727
        return nullptr;
1 ✔
728
    auto KId = unwrap<kernel_id>(KIdRef);
8 ✔
729
    if (!KId) {
8 ✔
730
        error_handler("Input KIdRef is nullptr", __FILE__, __func__, __LINE__);
1 ✔
731
        return nullptr;
1 ✔
732
    }
1 ✔
733
    try {
7 ✔
734
        return wrap<kernel>(new kernel(KB->get_kernel(*KId)));
7 ✔
735
    } catch (std::exception const &e) {
7 ✔
NEW
736
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
737
        return nullptr;
×
NEW
738
    }
×
739
}
7 ✔
740

741
__dpctl_give DPCTLSyclInputKernelBundleRef
742
DPCTLInputKernelBundle_CreateFromContext(
743
    __dpctl_keep const DPCTLSyclContextRef CRef,
744
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
745
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
746
{
12 ✔
747
    return create_from_context_impl<bundle_state::input>(CRef, DVRef, KIdVRef,
12 ✔
748
                                                         __func__);
12 ✔
749
}
12 ✔
750

751
bool DPCTLInputKernelBundle_CanCreateFromContext(
752
    __dpctl_keep const DPCTLSyclContextRef CRef,
753
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
754
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
755
{
5 ✔
756
    return can_create_from_context_impl<bundle_state::input>(CRef, DVRef,
5 ✔
757
                                                             KIdVRef, __func__);
5 ✔
758
}
5 ✔
759

760
__dpctl_give DPCTLSyclInputKernelBundleRef DPCTLInputKernelBundle_Copy(
761
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
762
{
3 ✔
763
    return copy_bundle_impl<bundle_state::input>(KBRef, __func__);
3 ✔
764
}
3 ✔
765

766
void DPCTLInputKernelBundle_Delete(
767
    __dpctl_take DPCTLSyclInputKernelBundleRef KBRef)
768
{
21 ✔
769
    delete unwrap<kernel_bundle<bundle_state::input>>(KBRef);
21 ✔
770
}
21 ✔
771

772
__dpctl_give DPCTLSyclContextRef DPCTLInputKernelBundle_GetContext(
773
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
774
{
7 ✔
775
    return get_context_impl<bundle_state::input>(KBRef, __func__);
7 ✔
776
}
7 ✔
777

778
__dpctl_give DPCTLDeviceVectorRef DPCTLInputKernelBundle_GetDevices(
779
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
780
{
4 ✔
781
    return get_devices_impl<bundle_state::input>(KBRef, __func__);
4 ✔
782
}
4 ✔
783

784
DPCTLSyclBackendType DPCTLInputKernelBundle_GetBackend(
785
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
786
{
3 ✔
787
    return get_backend_impl<bundle_state::input>(KBRef, __func__);
3 ✔
788
}
3 ✔
789

790
bool DPCTLInputKernelBundle_IsEmpty(
791
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
792
{
4 ✔
793
    return is_empty_impl<bundle_state::input>(KBRef, __func__);
4 ✔
794
}
4 ✔
795

796
__dpctl_give DPCTLKernelIdVectorRef DPCTLInputKernelBundle_GetKernelIds(
797
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
798
{
3 ✔
799
    return get_kernel_ids_impl<bundle_state::input>(KBRef, __func__);
3 ✔
800
}
3 ✔
801

802
bool DPCTLInputKernelBundle_HasKernelId(
803
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
804
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
805
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
806
{
5 ✔
807
    return has_kernel_id_impl<bundle_state::input>(KBRef, KIdRef, DRef,
5 ✔
808
                                                   __func__);
5 ✔
809
}
5 ✔
810

811
bool DPCTLInputKernelBundle_ContainsSpecializationConstants(
812
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
813
{
3 ✔
814
    return contains_specialization_constants_impl<bundle_state::input>(
3 ✔
815
        KBRef, __func__);
3 ✔
816
}
3 ✔
817

818
bool DPCTLInputKernelBundle_NativeSpecializationConstant(
819
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
820
{
2 ✔
821
    return native_specialization_constant_impl<bundle_state::input>(KBRef,
2 ✔
822
                                                                    __func__);
2 ✔
823
}
2 ✔
824

825
size_t DPCTLInputKernelBundle_GetNumDeviceImages(
826
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
827
{
5 ✔
828
    return get_num_device_images_impl<bundle_state::input>(KBRef, __func__);
5 ✔
829
}
5 ✔
830

831
bool DPCTLInputKernelBundle_DeviceImageHasKernel(
832
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
833
    size_t Index,
834
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
835
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
836
{
5 ✔
837
    return device_image_has_kernel_impl<bundle_state::input>(
5 ✔
838
        KBRef, Index, KIdRef, DRef, __func__);
5 ✔
839
}
5 ✔
840

841
__dpctl_give DPCTLSyclInputKernelBundleRef DPCTLInputKernelBundle_Join(
842
    size_t NumKBRefs,
843
    __dpctl_keep const DPCTLSyclInputKernelBundleRef *KBRefs)
844
{
2 ✔
845
    return join_bundles_impl<bundle_state::input>(NumKBRefs, KBRefs, __func__);
2 ✔
846
}
2 ✔
847

848
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLInputKernelBundle_Compile(
849
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
850
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
851
{
5 ✔
852
    auto KB = get_bundle_impl<bundle_state::input>(KBRef, __func__);
5 ✔
853
    if (!KB)
5 ✔
854
        return nullptr;
1 ✔
855
    try {
4 ✔
856
        if (DVRef)
4 ✔
857
            return wrap_bundle<bundle_state::object>(
2 ✔
858
                sycl::compile(*KB, unwrap_devices(DVRef)));
2 ✔
859
        return wrap_bundle<bundle_state::object>(sycl::compile(*KB));
2 ✔
860
    } catch (std::exception const &e) {
4 ✔
NEW
861
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
862
        return nullptr;
×
NEW
863
    }
×
864
}
4 ✔
865

866
__dpctl_give DPCTLSyclKernelBundleRef DPCTLInputKernelBundle_Build(
867
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
868
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
869
{
4 ✔
870
    auto KB = get_bundle_impl<bundle_state::input>(KBRef, __func__);
4 ✔
871
    if (!KB)
4 ✔
872
        return nullptr;
1 ✔
873
    try {
3 ✔
874
        if (DVRef)
3 ✔
875
            return wrap_bundle<bundle_state::executable>(
2 ✔
876
                sycl::build(*KB, unwrap_devices(DVRef)));
2 ✔
877
        return wrap_bundle<bundle_state::executable>(sycl::build(*KB));
1 ✔
878
    } catch (std::exception const &e) {
3 ✔
NEW
879
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
880
        return nullptr;
×
NEW
881
    }
×
882
}
3 ✔
883

884
__dpctl_give DPCTLSyclObjectKernelBundleRef
885
DPCTLObjectKernelBundle_CreateFromContext(
886
    __dpctl_keep const DPCTLSyclContextRef CRef,
887
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
888
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
889
{
8 ✔
890
    return create_from_context_impl<bundle_state::object>(CRef, DVRef, KIdVRef,
8 ✔
891
                                                          __func__);
8 ✔
892
}
8 ✔
893

894
bool DPCTLObjectKernelBundle_CanCreateFromContext(
895
    __dpctl_keep const DPCTLSyclContextRef CRef,
896
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
897
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
898
{
4 ✔
899
    return can_create_from_context_impl<bundle_state::object>(
4 ✔
900
        CRef, DVRef, KIdVRef, __func__);
4 ✔
901
}
4 ✔
902

903
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLObjectKernelBundle_Copy(
904
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
905
{
2 ✔
906
    return copy_bundle_impl<bundle_state::object>(KBRef, __func__);
2 ✔
907
}
2 ✔
908

909
void DPCTLObjectKernelBundle_Delete(
910
    __dpctl_take DPCTLSyclObjectKernelBundleRef KBRef)
911
{
21 ✔
912
    delete unwrap<kernel_bundle<bundle_state::object>>(KBRef);
21 ✔
913
}
21 ✔
914

915
__dpctl_give DPCTLSyclContextRef DPCTLObjectKernelBundle_GetContext(
916
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
917
{
8 ✔
918
    return get_context_impl<bundle_state::object>(KBRef, __func__);
8 ✔
919
}
8 ✔
920

921
__dpctl_give DPCTLDeviceVectorRef DPCTLObjectKernelBundle_GetDevices(
922
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
923
{
5 ✔
924
    return get_devices_impl<bundle_state::object>(KBRef, __func__);
5 ✔
925
}
5 ✔
926

927
DPCTLSyclBackendType DPCTLObjectKernelBundle_GetBackend(
928
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
929
{
2 ✔
930
    return get_backend_impl<bundle_state::object>(KBRef, __func__);
2 ✔
931
}
2 ✔
932

933
bool DPCTLObjectKernelBundle_IsEmpty(
934
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
935
{
5 ✔
936
    return is_empty_impl<bundle_state::object>(KBRef, __func__);
5 ✔
937
}
5 ✔
938

939
__dpctl_give DPCTLKernelIdVectorRef DPCTLObjectKernelBundle_GetKernelIds(
940
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
941
{
3 ✔
942
    return get_kernel_ids_impl<bundle_state::object>(KBRef, __func__);
3 ✔
943
}
3 ✔
944

945
bool DPCTLObjectKernelBundle_HasKernelId(
946
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef,
947
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
948
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
949
{
5 ✔
950
    return has_kernel_id_impl<bundle_state::object>(KBRef, KIdRef, DRef,
5 ✔
951
                                                    __func__);
5 ✔
952
}
5 ✔
953

954
bool DPCTLObjectKernelBundle_ContainsSpecializationConstants(
955
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
956
{
3 ✔
957
    return contains_specialization_constants_impl<bundle_state::object>(
3 ✔
958
        KBRef, __func__);
3 ✔
959
}
3 ✔
960

961
bool DPCTLObjectKernelBundle_NativeSpecializationConstant(
962
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
963
{
2 ✔
964
    return native_specialization_constant_impl<bundle_state::object>(KBRef,
2 ✔
965
                                                                     __func__);
2 ✔
966
}
2 ✔
967

968
size_t DPCTLObjectKernelBundle_GetNumDeviceImages(
969
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
970
{
5 ✔
971
    return get_num_device_images_impl<bundle_state::object>(KBRef, __func__);
5 ✔
972
}
5 ✔
973

974
bool DPCTLObjectKernelBundle_DeviceImageHasKernel(
975
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef,
976
    size_t Index,
977
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
978
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
979
{
5 ✔
980
    return device_image_has_kernel_impl<bundle_state::object>(
5 ✔
981
        KBRef, Index, KIdRef, DRef, __func__);
5 ✔
982
}
5 ✔
983

984
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLObjectKernelBundle_Join(
985
    size_t NumKBRefs,
986
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef *KBRefs)
987
{
2 ✔
988
    return join_bundles_impl<bundle_state::object>(NumKBRefs, KBRefs, __func__);
2 ✔
989
}
2 ✔
990

991
__dpctl_give DPCTLSyclKernelBundleRef DPCTLObjectKernelBundle_Link(
992
    size_t NumKBRefs,
993
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef *KBRefs,
994
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
995
{
6 ✔
996
    try {
6 ✔
997
        auto Bundles = unwrap_bundles<bundle_state::object>(NumKBRefs, KBRefs);
6 ✔
998
        if (DVRef)
6 ✔
999
            return wrap_bundle<bundle_state::executable>(
2 ✔
1000
                sycl::link(Bundles, unwrap_devices(DVRef)));
2 ✔
1001
        return wrap_bundle<bundle_state::executable>(sycl::link(Bundles));
4 ✔
1002
    } catch (std::exception const &e) {
6 ✔
1003
        error_handler(e, __FILE__, __func__, __LINE__);
2 ✔
1004
        return nullptr;
2 ✔
1005
    }
2 ✔
1006
}
6 ✔
1007

1008
bool DPCTLDeviceImage_HasKernel(__dpctl_keep const DPCTLSyclDeviceImageRef
1009
                                    ImgRef,
1010
                                __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1011
                                __dpctl_keep const DPCTLSyclDeviceRef DRef)
1012
{
16 ✔
1013
    auto View = reinterpret_cast<const device_image_view *>(ImgRef);
16 ✔
1014
    auto KId = unwrap<kernel_id>(KIdRef);
16 ✔
1015
    if (!(View && KId)) {
16 !
1016
        error_handler("At least one of the inputs is nullptr", __FILE__,
1 ✔
1017
                      __func__, __LINE__);
1 ✔
1018
        return false;
1 ✔
1019
    }
1 ✔
1020
    try {
15 ✔
1021
        return View->has_kernel(*KId, unwrap<device>(DRef));
15 ✔
1022
    } catch (std::exception const &e) {
15 ✔
NEW
1023
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
1024
        return false;
×
NEW
1025
    }
×
1026
}
15 ✔
1027

1028
__dpctl_give DPCTLSyclKernelBundleRef
1029
DPCTLKernelBundle_CreateFromContextWithSelector(
1030
    __dpctl_keep const DPCTLSyclContextRef CRef,
1031
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1032
    DPCTLDeviceImageSelectorFn Selector,
1033
    void *UserData)
1034
{
5 ✔
1035
    return create_with_selector_impl<bundle_state::executable>(
5 ✔
1036
        CRef, DVRef, Selector, UserData, __func__);
5 ✔
1037
}
5 ✔
1038

1039
__dpctl_give DPCTLSyclInputKernelBundleRef
1040
DPCTLInputKernelBundle_CreateFromContextWithSelector(
1041
    __dpctl_keep const DPCTLSyclContextRef CRef,
1042
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1043
    DPCTLDeviceImageSelectorFn Selector,
1044
    void *UserData)
1045
{
4 ✔
1046
    return create_with_selector_impl<bundle_state::input>(CRef, DVRef, Selector,
4 ✔
1047
                                                          UserData, __func__);
4 ✔
1048
}
4 ✔
1049

1050
__dpctl_give DPCTLSyclObjectKernelBundleRef
1051
DPCTLObjectKernelBundle_CreateFromContextWithSelector(
1052
    __dpctl_keep const DPCTLSyclContextRef CRef,
1053
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1054
    DPCTLDeviceImageSelectorFn Selector,
1055
    void *UserData)
1056
{
3 ✔
1057
    return create_with_selector_impl<bundle_state::object>(
3 ✔
1058
        CRef, DVRef, Selector, UserData, __func__);
3 ✔
1059
}
3 ✔
1060

1061
#else /* #ifndef __ADAPTIVECPP__ */
1062

1063
// AdaptiveCpp has no kernel_bundle or kernel_id
1064

1065
namespace
1066
{
1067
void report_unsupported(const char *Fn)
1068
{
1069
    error_handler("Kernel bundles are not supported in AdaptiveCpp", __FILE__,
1070
                  Fn, __LINE__, error_level::error);
1071
}
1072
} // end of anonymous namespace
1073

1074
__dpctl_give DPCTLKernelIdVectorRef DPCTLKernelIdVector_Create()
1075
{
1076
    report_unsupported(__func__);
1077
    return nullptr;
1078
}
1079

1080
__dpctl_give DPCTLKernelIdVectorRef
1081
DPCTLKernelIdVector_CreateFromArray(size_t n,
1082
                                    __dpctl_keep DPCTLSyclKernelIdRef *elems)
1083
{
1084
    report_unsupported(__func__);
1085
    return nullptr;
1086
}
1087

1088
void DPCTLKernelIdVector_Delete(__dpctl_take DPCTLKernelIdVectorRef VRef) {}
1089

1090
void DPCTLKernelIdVector_Clear(__dpctl_keep DPCTLKernelIdVectorRef VRef) {}
1091

1092
size_t DPCTLKernelIdVector_Size(__dpctl_keep DPCTLKernelIdVectorRef VRef)
1093
{
1094
    report_unsupported(__func__);
1095
    return 0;
1096
}
1097

1098
__dpctl_give DPCTLSyclKernelIdRef
1099
DPCTLKernelIdVector_GetAt(__dpctl_keep DPCTLKernelIdVectorRef VRef,
1100
                          size_t index)
1101
{
1102
    report_unsupported(__func__);
1103
    return nullptr;
1104
}
1105

1106
__dpctl_give const char *
1107
DPCTLKernelId_GetName(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
1108
{
1109
    report_unsupported(__func__);
1110
    return nullptr;
1111
}
1112

1113
bool DPCTLKernelId_AreEq(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef1,
1114
                         __dpctl_keep const DPCTLSyclKernelIdRef KIdRef2)
1115
{
1116
    report_unsupported(__func__);
1117
    return false;
1118
}
1119

1120
size_t DPCTLKernelId_Hash(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
1121
{
1122
    report_unsupported(__func__);
1123
    return 0;
1124
}
1125

1126
__dpctl_give DPCTLSyclKernelIdRef
1127
DPCTLKernelId_Copy(__dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
1128
{
1129
    report_unsupported(__func__);
1130
    return nullptr;
1131
}
1132

1133
void DPCTLKernelId_Delete(__dpctl_take DPCTLSyclKernelIdRef KIdRef) {}
1134

1135
__dpctl_give DPCTLKernelIdVectorRef DPCTLKernelId_GetAll(void)
1136
{
1137
    report_unsupported(__func__);
1138
    return nullptr;
1139
}
1140

1141
__dpctl_give DPCTLKernelIdVectorRef
1142
DPCTLKernelId_LoadLibrary(__dpctl_keep const char *Path)
1143
{
1144
    report_unsupported(__func__);
1145
    return nullptr;
1146
}
1147

1148
bool DPCTLKernelId_IsCompatible(__dpctl_keep const DPCTLKernelIdVectorRef
1149
                                    KIdVRef,
1150
                                __dpctl_keep const DPCTLSyclDeviceRef DRef)
1151
{
1152
    report_unsupported(__func__);
1153
    return false;
1154
}
1155

1156
__dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromContext(
1157
    __dpctl_keep const DPCTLSyclContextRef CRef,
1158
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1159
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1160
{
1161
    report_unsupported(__func__);
1162
    return nullptr;
1163
}
1164

1165
bool DPCTLKernelBundle_CanCreateFromContext(
1166
    __dpctl_keep const DPCTLSyclContextRef CRef,
1167
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1168
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1169
{
1170
    report_unsupported(__func__);
1171
    return false;
1172
}
1173

1174
__dpctl_give DPCTLSyclContextRef
1175
DPCTLKernelBundle_GetContext(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1176
{
1177
    report_unsupported(__func__);
1178
    return nullptr;
1179
}
1180

1181
__dpctl_give DPCTLDeviceVectorRef
1182
DPCTLKernelBundle_GetDevices(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1183
{
1184
    report_unsupported(__func__);
1185
    return nullptr;
1186
}
1187

1188
DPCTLSyclBackendType
1189
DPCTLKernelBundle_GetBackend(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1190
{
1191
    report_unsupported(__func__);
1192
    return DPCTL_UNKNOWN_BACKEND;
1193
}
1194

1195
bool DPCTLKernelBundle_IsEmpty(
1196
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1197
{
1198
    report_unsupported(__func__);
1199
    return false;
1200
}
1201

1202
__dpctl_give DPCTLKernelIdVectorRef DPCTLKernelBundle_GetKernelIds(
1203
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1204
{
1205
    report_unsupported(__func__);
1206
    return nullptr;
1207
}
1208

1209
bool DPCTLKernelBundle_HasKernelId(
1210
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
1211
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1212
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1213
{
1214
    report_unsupported(__func__);
1215
    return false;
1216
}
1217

1218
bool DPCTLKernelBundle_ContainsSpecializationConstants(
1219
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1220
{
1221
    report_unsupported(__func__);
1222
    return false;
1223
}
1224

1225
bool DPCTLKernelBundle_NativeSpecializationConstant(
1226
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1227
{
1228
    report_unsupported(__func__);
1229
    return false;
1230
}
1231

1232
size_t DPCTLKernelBundle_GetNumDeviceImages(
1233
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef)
1234
{
1235
    report_unsupported(__func__);
1236
    return 0;
1237
}
1238

1239
bool DPCTLKernelBundle_DeviceImageHasKernel(
1240
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
1241
    size_t Index,
1242
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1243
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1244
{
1245
    report_unsupported(__func__);
1246
    return false;
1247
}
1248

1249
__dpctl_give DPCTLSyclKernelBundleRef
1250
DPCTLKernelBundle_Join(size_t NumKBRefs,
1251
                       __dpctl_keep const DPCTLSyclKernelBundleRef *KBRefs)
1252
{
1253
    report_unsupported(__func__);
1254
    return nullptr;
1255
}
1256

1257
__dpctl_give DPCTLSyclKernelRef DPCTLKernelBundle_GetKernelById(
1258
    __dpctl_keep const DPCTLSyclKernelBundleRef KBRef,
1259
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef)
1260
{
1261
    report_unsupported(__func__);
1262
    return nullptr;
1263
}
1264

1265
__dpctl_give DPCTLSyclInputKernelBundleRef
1266
DPCTLInputKernelBundle_CreateFromContext(
1267
    __dpctl_keep const DPCTLSyclContextRef CRef,
1268
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1269
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1270
{
1271
    report_unsupported(__func__);
1272
    return nullptr;
1273
}
1274

1275
bool DPCTLInputKernelBundle_CanCreateFromContext(
1276
    __dpctl_keep const DPCTLSyclContextRef CRef,
1277
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1278
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1279
{
1280
    report_unsupported(__func__);
1281
    return false;
1282
}
1283

1284
__dpctl_give DPCTLSyclInputKernelBundleRef DPCTLInputKernelBundle_Copy(
1285
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1286
{
1287
    report_unsupported(__func__);
1288
    return nullptr;
1289
}
1290

1291
void DPCTLInputKernelBundle_Delete(
1292
    __dpctl_take DPCTLSyclInputKernelBundleRef KBRef)
1293
{
1294
}
1295

1296
__dpctl_give DPCTLSyclContextRef DPCTLInputKernelBundle_GetContext(
1297
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1298
{
1299
    report_unsupported(__func__);
1300
    return nullptr;
1301
}
1302

1303
__dpctl_give DPCTLDeviceVectorRef DPCTLInputKernelBundle_GetDevices(
1304
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1305
{
1306
    report_unsupported(__func__);
1307
    return nullptr;
1308
}
1309

1310
DPCTLSyclBackendType DPCTLInputKernelBundle_GetBackend(
1311
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1312
{
1313
    report_unsupported(__func__);
1314
    return DPCTL_UNKNOWN_BACKEND;
1315
}
1316

1317
bool DPCTLInputKernelBundle_IsEmpty(
1318
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1319
{
1320
    report_unsupported(__func__);
1321
    return false;
1322
}
1323

1324
__dpctl_give DPCTLKernelIdVectorRef DPCTLInputKernelBundle_GetKernelIds(
1325
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1326
{
1327
    report_unsupported(__func__);
1328
    return nullptr;
1329
}
1330

1331
bool DPCTLInputKernelBundle_HasKernelId(
1332
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
1333
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1334
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1335
{
1336
    report_unsupported(__func__);
1337
    return false;
1338
}
1339

1340
bool DPCTLInputKernelBundle_ContainsSpecializationConstants(
1341
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1342
{
1343
    report_unsupported(__func__);
1344
    return false;
1345
}
1346

1347
bool DPCTLInputKernelBundle_NativeSpecializationConstant(
1348
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1349
{
1350
    report_unsupported(__func__);
1351
    return false;
1352
}
1353

1354
size_t DPCTLInputKernelBundle_GetNumDeviceImages(
1355
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef)
1356
{
1357
    report_unsupported(__func__);
1358
    return 0;
1359
}
1360

1361
bool DPCTLInputKernelBundle_DeviceImageHasKernel(
1362
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
1363
    size_t Index,
1364
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1365
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1366
{
1367
    report_unsupported(__func__);
1368
    return false;
1369
}
1370

1371
__dpctl_give DPCTLSyclInputKernelBundleRef DPCTLInputKernelBundle_Join(
1372
    size_t NumKBRefs,
1373
    __dpctl_keep const DPCTLSyclInputKernelBundleRef *KBRefs)
1374
{
1375
    report_unsupported(__func__);
1376
    return nullptr;
1377
}
1378

1379
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLInputKernelBundle_Compile(
1380
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
1381
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
1382
{
1383
    report_unsupported(__func__);
1384
    return nullptr;
1385
}
1386

1387
__dpctl_give DPCTLSyclKernelBundleRef DPCTLInputKernelBundle_Build(
1388
    __dpctl_keep const DPCTLSyclInputKernelBundleRef KBRef,
1389
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
1390
{
1391
    report_unsupported(__func__);
1392
    return nullptr;
1393
}
1394

1395
__dpctl_give DPCTLSyclObjectKernelBundleRef
1396
DPCTLObjectKernelBundle_CreateFromContext(
1397
    __dpctl_keep const DPCTLSyclContextRef CRef,
1398
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1399
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1400
{
1401
    report_unsupported(__func__);
1402
    return nullptr;
1403
}
1404

1405
bool DPCTLObjectKernelBundle_CanCreateFromContext(
1406
    __dpctl_keep const DPCTLSyclContextRef CRef,
1407
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1408
    __dpctl_keep const DPCTLKernelIdVectorRef KIdVRef)
1409
{
1410
    report_unsupported(__func__);
1411
    return false;
1412
}
1413

1414
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLObjectKernelBundle_Copy(
1415
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1416
{
1417
    report_unsupported(__func__);
1418
    return nullptr;
1419
}
1420

1421
void DPCTLObjectKernelBundle_Delete(
1422
    __dpctl_take DPCTLSyclObjectKernelBundleRef KBRef)
1423
{
1424
}
1425

1426
__dpctl_give DPCTLSyclContextRef DPCTLObjectKernelBundle_GetContext(
1427
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1428
{
1429
    report_unsupported(__func__);
1430
    return nullptr;
1431
}
1432

1433
__dpctl_give DPCTLDeviceVectorRef DPCTLObjectKernelBundle_GetDevices(
1434
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1435
{
1436
    report_unsupported(__func__);
1437
    return nullptr;
1438
}
1439

1440
DPCTLSyclBackendType DPCTLObjectKernelBundle_GetBackend(
1441
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1442
{
1443
    report_unsupported(__func__);
1444
    return DPCTL_UNKNOWN_BACKEND;
1445
}
1446

1447
bool DPCTLObjectKernelBundle_IsEmpty(
1448
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1449
{
1450
    report_unsupported(__func__);
1451
    return false;
1452
}
1453

1454
__dpctl_give DPCTLKernelIdVectorRef DPCTLObjectKernelBundle_GetKernelIds(
1455
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1456
{
1457
    report_unsupported(__func__);
1458
    return nullptr;
1459
}
1460

1461
bool DPCTLObjectKernelBundle_HasKernelId(
1462
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef,
1463
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1464
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1465
{
1466
    report_unsupported(__func__);
1467
    return false;
1468
}
1469

1470
bool DPCTLObjectKernelBundle_ContainsSpecializationConstants(
1471
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1472
{
1473
    report_unsupported(__func__);
1474
    return false;
1475
}
1476

1477
bool DPCTLObjectKernelBundle_NativeSpecializationConstant(
1478
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1479
{
1480
    report_unsupported(__func__);
1481
    return false;
1482
}
1483

1484
size_t DPCTLObjectKernelBundle_GetNumDeviceImages(
1485
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef)
1486
{
1487
    report_unsupported(__func__);
1488
    return 0;
1489
}
1490

1491
bool DPCTLObjectKernelBundle_DeviceImageHasKernel(
1492
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef KBRef,
1493
    size_t Index,
1494
    __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1495
    __dpctl_keep const DPCTLSyclDeviceRef DRef)
1496
{
1497
    report_unsupported(__func__);
1498
    return false;
1499
}
1500

1501
__dpctl_give DPCTLSyclObjectKernelBundleRef DPCTLObjectKernelBundle_Join(
1502
    size_t NumKBRefs,
1503
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef *KBRefs)
1504
{
1505
    report_unsupported(__func__);
1506
    return nullptr;
1507
}
1508

1509
__dpctl_give DPCTLSyclKernelBundleRef DPCTLObjectKernelBundle_Link(
1510
    size_t NumKBRefs,
1511
    __dpctl_keep const DPCTLSyclObjectKernelBundleRef *KBRefs,
1512
    __dpctl_keep const DPCTLDeviceVectorRef DVRef)
1513
{
1514
    report_unsupported(__func__);
1515
    return nullptr;
1516
}
1517

1518
bool DPCTLDeviceImage_HasKernel(__dpctl_keep const DPCTLSyclDeviceImageRef
1519
                                    ImgRef,
1520
                                __dpctl_keep const DPCTLSyclKernelIdRef KIdRef,
1521
                                __dpctl_keep const DPCTLSyclDeviceRef DRef)
1522
{
1523
    report_unsupported(__func__);
1524
    return false;
1525
}
1526

1527
__dpctl_give DPCTLSyclKernelBundleRef
1528
DPCTLKernelBundle_CreateFromContextWithSelector(
1529
    __dpctl_keep const DPCTLSyclContextRef CRef,
1530
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1531
    DPCTLDeviceImageSelectorFn Selector,
1532
    void *UserData)
1533
{
1534
    report_unsupported(__func__);
1535
    return nullptr;
1536
}
1537

1538
__dpctl_give DPCTLSyclInputKernelBundleRef
1539
DPCTLInputKernelBundle_CreateFromContextWithSelector(
1540
    __dpctl_keep const DPCTLSyclContextRef CRef,
1541
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1542
    DPCTLDeviceImageSelectorFn Selector,
1543
    void *UserData)
1544
{
1545
    report_unsupported(__func__);
1546
    return nullptr;
1547
}
1548

1549
__dpctl_give DPCTLSyclObjectKernelBundleRef
1550
DPCTLObjectKernelBundle_CreateFromContextWithSelector(
1551
    __dpctl_keep const DPCTLSyclContextRef CRef,
1552
    __dpctl_keep const DPCTLDeviceVectorRef DVRef,
1553
    DPCTLDeviceImageSelectorFn Selector,
1554
    void *UserData)
1555
{
1556
    report_unsupported(__func__);
1557
    return nullptr;
1558
}
1559

1560
#endif /* #ifndef __ADAPTIVECPP__ */
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc