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

IntelPython / dpctl / 14808089933

03 May 2025 05:56AM UTC coverage: 86.372% (-0.05%) from 86.419%
14808089933

Pull #2067

github

web-flow
Merge 05c89234e into fa4eaa7a3
Pull Request #2067: Updating `repr()` function

3023 of 3720 branches covered (81.26%)

Branch coverage included in aggregate %.

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

217 existing lines in 4 files now uncovered.

12257 of 13971 relevant lines covered (87.73%)

6959.73 hits per line

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

89.19
/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
using raw_kernel_arg_t = std::vector<unsigned char>;
67

68
DPCTL_API
69
__dpctl_give DPCTLSyclRawKernelArgRef DPCTLRawKernelArg_Create(void *bytes,
70
                                                               size_t count)
71
{
12✔
72
    DPCTLSyclRawKernelArgRef rka = nullptr;
12✔
73
    try {
12✔
74
        auto RawKernelArg =
12✔
75
            std::unique_ptr<raw_kernel_arg_t>(new raw_kernel_arg_t(count));
12✔
76
        std::memcpy(RawKernelArg->data(), bytes, count);
12✔
77
        rka = wrap<raw_kernel_arg_t>(RawKernelArg.get());
12✔
78
        RawKernelArg.release();
12✔
79
    } catch (std::exception const &e) {
12✔
UNCOV
80
        error_handler(e, __FILE__, __func__, __LINE__);
×
UNCOV
81
    }
×
82
    return rka;
12✔
83
}
12✔
84

85
DPCTL_API
86
void DPCTLRawKernelArg_Delete(__dpctl_take DPCTLSyclRawKernelArgRef Ref)
87
{
10✔
88
    delete unwrap<raw_kernel_arg_t>(Ref);
10✔
89
}
10✔
90

91
DPCTL_API
92
bool DPCTLRawKernelArg_Available()
93
{
14✔
94
#ifdef SYCL_EXT_ONEAPI_RAW_KERNEL_ARG
14✔
95
    return true;
14✔
96
#else
97
    return false;
98
#endif
99
}
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