Skip to content

Commit 2ed788e

Browse files
authored
show versions of numpy and mkl (#692)
1 parent ce5059b commit 2ed788e

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

dpnp/backend/src/queue_sycl.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,29 @@ cl::sycl::queue* backend_sycl::queue = nullptr;
3535
#endif
3636
mkl_rng::mt19937* backend_sycl::rng_engine = nullptr;
3737

38+
static void dpnpc_show_mathlib_version()
39+
{
40+
#if 1
41+
const int len = 256;
42+
std::string mathlib_version_str(len, 0x0);
43+
44+
char* buf = const_cast<char*>(mathlib_version_str.c_str()); // TODO avoid write into the container
45+
46+
mkl_get_version_string(buf, len);
47+
48+
std::cout << "Math backend version: " << mathlib_version_str << std::endl;
49+
#else
50+
// Failed to load library under Python environment die to unresolved symbol
51+
MKLVersion version;
52+
53+
mkl_get_version(&version);
54+
55+
std::cout << "Math backend version: " << version.MajorVersion << "." << version.UpdateVersion << "."
56+
<< version.MinorVersion << std::endl;
57+
#endif
58+
}
59+
60+
#if not defined(NDEBUG)
3861
static void show_available_sycl_devices()
3962
{
4063
const std::vector<cl::sycl::device> devices = cl::sycl::device::get_devices();
@@ -51,6 +74,7 @@ static void show_available_sycl_devices()
5174
<< ", name=" << it->get_info<cl::sycl::info::device::name>() << std::endl;
5275
}
5376
}
77+
#endif
5478

5579
static cl::sycl::device get_default_sycl_device()
5680
{
@@ -162,7 +186,10 @@ void backend_sycl::backend_sycl_queue_init(QueueOptions selector)
162186
#else
163187
std::cout << "DPCtrl SYCL queue used\n";
164188
#endif
165-
std::cout << "SYCL kernels link time: " << time_kernels_link.count() << " (sec.)\n" << std::endl;
189+
std::cout << "SYCL kernels link time: " << time_kernels_link.count() << " (sec.)\n";
190+
dpnpc_show_mathlib_version();
191+
192+
std::cout << std::endl;
166193
}
167194

168195
bool backend_sycl::backend_sycl_is_cpu()

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import os
2828
import dpnp
29+
import numpy
2930
import pytest
3031

3132

@@ -51,8 +52,9 @@ def pytest_collection_modifyitems(config, items):
5152

5253
current_queue_is_cpu = dpnp.dpnp_queue_is_cpu()
5354
print("")
54-
print(f"DPNP: current queue is CPU: {current_queue_is_cpu}")
55-
print(f"DPNP: version: {dpnp.version.version}")
55+
print(f" DPNP: current queue is CPU: {current_queue_is_cpu}")
56+
print(f" DPNP: version: {dpnp.__version__}")
57+
print(f"NumPy: version: {numpy.__version__}")
5658
print("")
5759
if not current_queue_is_cpu or os.getenv('DPNP_QUEUE_GPU') == '1':
5860
excluded_tests.extend(get_excluded_tests(test_exclude_file_gpu))

0 commit comments

Comments
 (0)