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

IntelPython / dpnp / 18462105984

13 Oct 2025 10:00AM UTC coverage: 72.021% (+0.006%) from 72.015%
18462105984

Pull #2616

github

web-flow
Merge 88f29534e into 71e7d82fc
Pull Request #2616: Add `dpnp.exceptions` submodule to aggregate generic exceptions

5067 of 10224 branches covered (49.56%)

Branch coverage included in aggregate %.

8 of 8 new or added lines in 2 files covered. (100.0%)

2041 existing lines in 130 files now uncovered.

18659 of 22719 relevant lines covered (82.13%)

18875.14 hits per line

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

15.38
/dpnp/backend/src/queue_sycl.cpp
1
//*****************************************************************************
2
// Copyright (c) 2016, Intel Corporation
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without
6
// modification, are permitted provided that the following conditions are met:
7
// - Redistributions of source code must retain the above copyright notice,
8
//   this list of conditions and the following disclaimer.
9
// - Redistributions in binary form must reproduce the above copyright notice,
10
//   this list of conditions and the following disclaimer in the documentation
11
//   and/or other materials provided with the distribution.
12
// - Neither the name of the copyright holder nor the names of its contributors
13
//   may be used to endorse or promote products derived from this software
14
//   without specific prior written permission.
15
//
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26
// THE POSSIBILITY OF SUCH DAMAGE.
27
//*****************************************************************************
28

29
#include <chrono>
30
#include <iostream>
31

32
#include "dpnp_iface.hpp"
33
#include "dpnp_utils.hpp"
34
#include "queue_sycl.hpp"
35

36
[[maybe_unused]] static void dpnpc_show_mathlib_version()
37
{
×
38
#if 1
×
39
    const int len = 256;
×
40
    std::string mathlib_version_str(len, 0x0);
×
41

×
42
    char *buf = const_cast<char *>(
×
43
        mathlib_version_str.c_str()); // TODO avoid write into the container
×
44

×
45
    mkl_get_version_string(buf, len);
×
46

×
47
    std::cout << "Math backend version: " << mathlib_version_str << std::endl;
×
48
#else
×
49
    // Failed to load library under Python environment die to unresolved symbol
×
50
    MKLVersion version;
×
51

×
52
    mkl_get_version(&version);
×
53

×
54
    std::cout << "Math backend version: " << version.MajorVersion << "."
×
55
              << version.UpdateVersion << "." << version.MinorVersion
×
UNCOV
56
              << std::endl;
×
UNCOV
57
#endif
×
UNCOV
58
}
×
59

60
#if (not defined(NDEBUG))
61
[[maybe_unused]] static std::string
62
    device_type_to_str(sycl::info::device_type devTy)
63
{
64
    std::stringstream ss;
65
    switch (devTy) {
66
    case sycl::info::device_type::cpu:
67
        ss << "cpu";
68
        break;
69
    case sycl::info::device_type::gpu:
70
        ss << "gpu";
71
        break;
72
    case sycl::info::device_type::accelerator:
73
        ss << "accelerator";
74
        break;
75
    case sycl::info::device_type::custom:
76
        ss << "custom";
77
        break;
78
    default:
79
        ss << "unknown";
80
    }
81
    return ss.str();
82
}
83

84
[[maybe_unused]] static void show_available_sycl_devices()
85
{
86
    const std::vector<sycl::device> devices = sycl::device::get_devices();
87

88
    std::cout << "Available SYCL devices:" << std::endl;
89
    for (std::vector<sycl::device>::const_iterator it = devices.cbegin();
90
         it != devices.cend(); ++it)
91
    {
92
        std::cout
93
            // not yet implemented error << " " <<
94
            // it->has(sycl::aspect::usm_shared_allocations)  << " "
95
            << " - id=" << it->get_info<sycl::info::device::vendor_id>()
96
            << ", type="
97
            << device_type_to_str(
98
                   it->get_info<sycl::info::device::device_type>())
99
            << ", gws="
100
            << it->get_info<sycl::info::device::max_work_group_size>()
101
            << ", cu=" << it->get_info<sycl::info::device::max_compute_units>()
102
            << ", name=" << it->get_info<sycl::info::device::name>()
103
            << std::endl;
104
    }
105
}
106
#endif
107

108
size_t dpnp_queue_is_cpu_c()
109
{
6✔
110
    const auto &be = backend_sycl::get();
6✔
111
    return be.backend_sycl_is_cpu();
6✔
112
}
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

© 2026 Coveralls, Inc