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

IntelPython / dpnp / 9783760502

03 Jul 2024 07:29PM UTC coverage: 52.609% (+3.9%) from 48.738%
9783760502

push

github

web-flow
Clean up legacy array creation and manipulation implementation from the backend (#1903)

* Clean up legacy element-wise implementation from the backend

* return legacy copy implementation for partition function

* Apply comments

* Fix pre-commit

* Fix pre-commit

* Clean up legacy array creation implementation from the backend

* Clean-up MACRO_2ARG_2TYPES_LOGIC_OP. Clean-up /backend/include

* Removed backend/examples for removed functions

* address comments

* address comments

---------

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
Co-authored-by: Anton Volkov <antonwolfy@gmail.com>

3783 of 12739 branches covered (29.7%)

Branch coverage included in aggregate %.

13338 of 19805 relevant lines covered (67.35%)

16762.03 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-2024, 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 <exception>
28
#include <iostream>
29

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

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

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

×
43
    mkl_get_version_string(buf, len);
×
44

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

×
50
    mkl_get_version(&version);
×
51

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

58
#if (not defined(NDEBUG))
59
[[maybe_unused]] static void show_available_sycl_devices()
60
{
61
    const std::vector<sycl::device> devices = sycl::device::get_devices();
62

63
    std::cout << "Available SYCL devices:" << std::endl;
64
    for (std::vector<sycl::device>::const_iterator it = devices.cbegin();
65
         it != devices.cend(); ++it)
66
    {
67
        std::cout
68
            // not yet implemented error << " " <<
69
            // it->has(sycl::aspect::usm_shared_allocations)  << " "
70
            << " - id=" << it->get_info<sycl::info::device::vendor_id>()
71
            << ", type="
72
            << static_cast<pi_uint64>(
73
                   it->get_info<sycl::info::device::device_type>())
74
            << ", gws="
75
            << it->get_info<sycl::info::device::max_work_group_size>()
76
            << ", cu=" << it->get_info<sycl::info::device::max_compute_units>()
77
            << ", name=" << it->get_info<sycl::info::device::name>()
78
            << std::endl;
79
    }
80
}
81
#endif
82

83
size_t dpnp_queue_is_cpu_c()
84
{
×
85
    const auto &be = backend_sycl::get();
×
86
    return be.backend_sycl_is_cpu();
×
87
}
×
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