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

IntelPython / dpnp / 16126000227

07 Jul 2025 07:24PM UTC coverage: 22.684% (-49.4%) from 72.051%
16126000227

Pull #2519

github

web-flow
Merge bd753a3a3 into 624f14f20
Pull Request #2519: tmp changes

889 of 9756 branches covered (9.11%)

Branch coverage included in aggregate %.

6317 of 22011 relevant lines covered (28.7%)

35.96 hits per line

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

0.0
/dpnp/backend/src/queue_sycl.cpp
1
//*****************************************************************************
2
// Copyright (c) 2016-2025, 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
//
13
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
// THE POSSIBILITY OF SUCH DAMAGE.
24
//*****************************************************************************
25

26
#include <chrono>
27
#include <iostream>
28

29
#include "dpnp_iface.hpp"
30
#include "dpnp_utils.hpp"
31
#include "queue_sycl.hpp"
32

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

×
39
    char *buf = const_cast<char *>(
×
40
        mathlib_version_str.c_str()); // TODO avoid write into the container
×
41

×
42
    mkl_get_version_string(buf, len);
×
43

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

×
49
    mkl_get_version(&version);
×
50

×
51
    std::cout << "Math backend version: " << version.MajorVersion << "."
×
52
              << version.UpdateVersion << "." << version.MinorVersion
×
53
              << std::endl;
×
54
#endif
×
55
}
×
56

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

81
[[maybe_unused]] static void show_available_sycl_devices()
82
{
83
    const std::vector<sycl::device> devices = sycl::device::get_devices();
84

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

105
size_t dpnp_queue_is_cpu_c()
106
{
×
107
    const auto &be = backend_sycl::get();
×
108
    return be.backend_sycl_is_cpu();
×
109
}
×
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