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

IntelPython / dpctl / 14222426726

02 Apr 2025 02:39PM UTC coverage: 86.307% (-0.07%) from 86.379%
14222426726

Pull #2038

github

web-flow
Merge 301707497 into 67317b094
Pull Request #2038: Add support for raw_kernel_arg extension

3018 of 3716 branches covered (81.22%)

Branch coverage included in aggregate %.

46 of 67 new or added lines in 3 files covered. (68.66%)

1 existing line in 1 file now uncovered.

12160 of 13870 relevant lines covered (87.67%)

7005.24 hits per line

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

88.24
/libsyclinterface/source/dpctl_sycl_extension_interface.cpp
1
//===---- dpctl_sycl_extension_interface.cpp - Implements C API for SYCL ext =//
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 data types and functions declared in
23
/// dpctl_sycl_extension_interface.h.
24
///
25
//===----------------------------------------------------------------------===//
26

27
#include "dpctl_sycl_extension_interface.h"
28

29
#include "dpctl_error_handlers.h"
30
#include "dpctl_sycl_type_casters.hpp"
31

32
#include <sycl/sycl.hpp>
33

34
using namespace dpctl::syclinterface;
35

36
DPCTL_API
37
__dpctl_give DPCTLSyclWorkGroupMemoryRef
38
DPCTLWorkGroupMemory_Create(size_t nbytes)
39
{
11✔
40
    DPCTLSyclWorkGroupMemoryRef wgm = nullptr;
11✔
41
    try {
11✔
42
        auto WorkGroupMem = new RawWorkGroupMemory{nbytes};
11✔
43
        wgm = wrap<RawWorkGroupMemory>(WorkGroupMem);
11✔
44
    } catch (std::exception const &e) {
11✔
45
        error_handler(e, __FILE__, __func__, __LINE__);
×
46
    }
×
47
    return wgm;
11✔
48
}
11✔
49

50
DPCTL_API
51
void DPCTLWorkGroupMemory_Delete(__dpctl_take DPCTLSyclWorkGroupMemoryRef Ref)
52
{
11✔
53
    delete unwrap<RawWorkGroupMemory>(Ref);
11✔
54
}
11✔
55

56
DPCTL_API
57
bool DPCTLWorkGroupMemory_Available()
58
{
13✔
59
#ifdef SYCL_EXT_ONEAPI_WORK_GROUP_MEMORY
13✔
60
    return true;
13✔
61
#else
62
    return false;
63
#endif
64
}
13✔
65

66
DPCTL_API
67
__dpctl_give DPCTLSyclRawKernelArgRef DPCTLRawKernelArg_Create(void *bytes,
68
                                                               size_t count)
69
{
12✔
70
    DPCTLSyclRawKernelArgRef rka = nullptr;
12✔
71
    try {
12✔
72
        auto RawKernelArg = new RawKernelArgData{bytes, count};
12✔
73
        rka = wrap<RawKernelArgData>(RawKernelArg);
12✔
74
    } catch (std::exception const &e) {
12✔
NEW
75
        error_handler(e, __FILE__, __func__, __LINE__);
×
NEW
76
    }
×
77
    return rka;
12✔
78
}
12✔
79

80
DPCTL_API
81
void DPCTLRawKernelArg_Delete(__dpctl_take DPCTLSyclRawKernelArgRef Ref)
82
{
10✔
83
    delete unwrap<RawKernelArgData>(Ref);
10✔
84
}
10✔
85

86
DPCTL_API
87
bool DPCTLRawKernelArg_Available()
88
{
14✔
89
#ifdef SYCL_EXT_ONEAPI_RAW_KERNEL_ARG
14✔
90
    return true;
14✔
91
#else
92
    return false;
93
#endif
94
}
14✔
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