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

IntelPython / dpnp / 18463977845

13 Oct 2025 11:15AM UTC coverage: 72.021% (+0.006%) from 72.015%
18463977845

Pull #2616

github

web-flow
Merge 4683c32d6 into 800f642c9
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%)

18876.68 hits per line

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

30.43
/dpnp/backend/src/verbose.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 "verbose.hpp"
30
#include <iostream>
31

32
bool _is_verbose_mode = false;
33
bool _is_verbose_mode_init = false;
34

35
bool is_verbose_mode()
36
{
1✔
37
    if (!_is_verbose_mode_init) {
1!
38
        _is_verbose_mode = false;
1✔
39
        char *env_var = nullptr;
1✔
40

41
#ifdef _WIN32
42
        size_t env_var_size = 0;
43
        _dupenv_s(&env_var, &env_var_size, "DPNP_VERBOSE");
44
#else
45
        env_var = std::getenv("DPNP_VERBOSE");
1✔
46
#endif
1✔
47

48
        if (env_var && std::string(env_var) == "1") {
1!
UNCOV
49
            _is_verbose_mode = true;
×
UNCOV
50
        }
×
51
        _is_verbose_mode_init = true;
1✔
52

53
#ifdef _WIN32
54
        if (env_var != nullptr)
55
            free(env_var);
56
#endif
57
    }
1✔
58
    return _is_verbose_mode;
1✔
59
}
1✔
60

61
class barrierKernelClass;
62

63
void set_barrier_event(sycl::queue queue, std::vector<sycl::event> &depends)
64
{
×
65
    if (is_verbose_mode()) {
×
66
        sycl::event barrier_event =
×
67
            queue.single_task<barrierKernelClass>(depends, [=] {});
×
68
        depends.clear();
×
UNCOV
69
        depends.push_back(barrier_event);
×
UNCOV
70
    }
×
UNCOV
71
}
×
72

73
void verbose_print(std::string header,
74
                   sycl::event first_event,
75
                   sycl::event last_event)
76
{
×
77
    if (is_verbose_mode()) {
×
78
        auto first_event_end =
×
79
            first_event
×
80
                .get_profiling_info<sycl::info::event_profiling::command_end>();
×
81
        auto last_event_end =
×
82
            last_event
×
83
                .get_profiling_info<sycl::info::event_profiling::command_end>();
×
84
        std::cout << "DPNP_VERBOSE " << header
×
85
                  << " Time: " << (last_event_end - first_event_end) / 1.0e9
×
UNCOV
86
                  << " s" << std::endl;
×
UNCOV
87
    }
×
UNCOV
88
}
×
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