Skip to content

Commit d73d748

Browse files
Merge branch 'master' into correlate_fft
2 parents 6435dc6 + 3ceb358 commit d73d748

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2786
-2515
lines changed

.github/workflows/conda-package.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ jobs:
8383
MAX_BUILD_CMPL_MKL_VERSION: '2025.1a0'
8484

8585
- name: Upload artifact
86-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
86+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
8787
with:
8888
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
8989
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
9090

9191
- name: Upload wheels artifact
92-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
92+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
9393
with:
9494
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
9595
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl
@@ -148,7 +148,7 @@ jobs:
148148
149149
- name: Test conda channel
150150
run: |
151-
mamba search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
151+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
152152
cat ${{ env.ver-json-path }}
153153
154154
- name: Get package version
@@ -182,7 +182,7 @@ jobs:
182182
id: run_tests_linux
183183
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
184184
with:
185-
timeout_minutes: 10
185+
timeout_minutes: 12
186186
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
187187
retry_on: any
188188
command: |
@@ -264,7 +264,7 @@ jobs:
264264
- name: Test conda channel
265265
run: |
266266
@echo on
267-
mamba search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
267+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
268268
269269
- name: Dump version.json
270270
run: more ${{ env.ver-json-path }}

.github/workflows/openssf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
63+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif
6767
retention-days: 14
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
71+
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
7272
with:
7373
sarif_file: results.sarif

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ if(_use_onemkl_interfaces)
112112
set(ENABLE_CUSOLVER_BACKEND True)
113113
set(ENABLE_CUFFT_BACKEND True)
114114
# set(ENABLE_CURAND_BACKEND True)
115-
set(ENABLE_MKLGPU_BACKEND False)
116-
set(ENABLE_MKLCPU_BACKEND False)
115+
set(ENABLE_MKLGPU_BACKEND True)
116+
set(ENABLE_MKLCPU_BACKEND True)
117117
endif()
118118

119119
if(DPNP_ONEMKL_INTERFACES_DIR)

doc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@ def _can_document_member(member, *args, **kwargs):
218218

219219
intersphinx_mapping = {
220220
"python": ("https://docs.python.org/3/", None),
221-
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
221+
"numpy": ("https://numpy.org/doc/stable/", None),
222222
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
223223
"dpctl": ("https://intelpython.github.io/dpctl/latest/", None),
224+
"cupy": ("https://docs.cupy.dev/en/stable/", None),
224225
}
225226

226227
# If true, `todo` and `todoList` produce output, else they produce nothing.

doc/known_words.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
al
22
ary
33
backend
4+
bandlimited
45
bitwise
56
boolean
67
broadcastable
78
broadcasted
89
byteorder
10+
cardinalis
911
Cholesky
1012
combinatorially
1113
conda
@@ -34,11 +36,16 @@ fs
3436
getter
3537
Golub
3638
Hadamard
39+
histogrammed
3740
Hypergeometric
41+
kwargs
42+
iaxis
3843
iinfo
3944
Infs
4045
intp
46+
ints
4147
iterable
48+
Lanczos
4249
Lomax
4350
Mersenne
4451
meshgrid
@@ -47,13 +54,17 @@ multinomial
4754
multivalued
4855
NaN
4956
NaT
57+
nd
5058
ndarray
5159
ndarrays
5260
ndim
5361
Nj
5462
Nk
5563
normed
5664
nuc
65+
numpy
66+
nx
67+
ny
5768
Nyquist
5869
oneAPI
5970
ord
@@ -62,12 +73,15 @@ Penrose
6273
Polyutils
6374
pre
6475
prepend
76+
prepended
6577
prepending
6678
representable
79+
resampling
6780
runtimes
6881
scikit
6982
signbit
7083
signum
84+
sinc
7185
subarray
7286
subarrays
7387
subclasses
@@ -84,7 +98,9 @@ ufunc
8498
ufuncs
8599
Unary
86100
unscaled
101+
unstacked
87102
unicode
103+
Upcasting
88104
usm
89105
Vandermonde
90106
vectorized

dpnp/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# *****************************************************************************
2626

2727
import os
28+
import sys
2829

2930
mypath = os.path.dirname(os.path.realpath(__file__))
3031

@@ -45,10 +46,22 @@
4546
if hasattr(os, "add_dll_directory"):
4647
os.add_dll_directory(mypath)
4748
os.add_dll_directory(dpctlpath)
49+
4850
os.environ["PATH"] = os.pathsep.join(
4951
[os.getenv("PATH", ""), mypath, dpctlpath]
5052
)
5153

54+
# For virtual environments on Windows, add folder with DPC++ libraries
55+
# to the DLL search path
56+
if sys.base_exec_prefix != sys.exec_prefix and os.path.isfile(
57+
os.path.join(sys.exec_prefix, "pyvenv.cfg")
58+
):
59+
dll_path = os.path.join(sys.exec_prefix, "Library", "bin")
60+
if os.path.isdir(dll_path):
61+
os.environ["PATH"] = os.pathsep.join(
62+
[os.getenv("PATH", ""), dll_path]
63+
)
64+
5265
# Borrowed from DPCTL
5366
from dpctl.tensor import DLDeviceType
5467

dpnp/backend/extensions/blas/gemm.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ typedef sycl::event (*gemm_impl_fn_ptr_t)(sycl::queue &,
5555
const std::int64_t,
5656
char *,
5757
const std::int64_t,
58+
#if !defined(USE_ONEMKL_CUBLAS)
5859
const bool,
60+
#endif // !USE_ONEMKL_CUBLAS
5961
const std::vector<sycl::event> &);
6062

6163
static gemm_impl_fn_ptr_t gemm_dispatch_table[dpctl_td_ns::num_types]
@@ -74,7 +76,9 @@ static sycl::event gemm_impl(sycl::queue &exec_q,
7476
const std::int64_t ldb,
7577
char *resultC,
7678
const std::int64_t ldc,
79+
#if !defined(USE_ONEMKL_CUBLAS)
7780
const bool is_row_major,
81+
#endif // !USE_ONEMKL_CUBLAS
7882
const std::vector<sycl::event> &depends)
7983
{
8084
type_utils::validate_type_for_device<Tab>(exec_q);
@@ -236,6 +240,7 @@ std::tuple<sycl::event, sycl::event, bool>
236240
std::int64_t lda;
237241
std::int64_t ldb;
238242

243+
// cuBLAS supports only column-major storage
239244
#if defined(USE_ONEMKL_CUBLAS)
240245
const bool is_row_major = false;
241246

@@ -315,9 +320,15 @@ std::tuple<sycl::event, sycl::event, bool>
315320
const char *b_typeless_ptr = matrixB.get_data();
316321
char *r_typeless_ptr = resultC.get_data();
317322

323+
#if defined(USE_ONEMKL_CUBLAS)
324+
sycl::event gemm_ev =
325+
gemm_fn(exec_q, transA, transB, m, n, k, a_typeless_ptr, lda,
326+
b_typeless_ptr, ldb, r_typeless_ptr, ldc, depends);
327+
#else
318328
sycl::event gemm_ev = gemm_fn(exec_q, transA, transB, m, n, k,
319329
a_typeless_ptr, lda, b_typeless_ptr, ldb,
320330
r_typeless_ptr, ldc, is_row_major, depends);
331+
#endif // USE_ONEMKL_CUBLAS
321332

322333
sycl::event args_ev = dpctl::utils::keep_args_alive(
323334
exec_q, {matrixA, matrixB, resultC}, {gemm_ev});

dpnp/backend/extensions/blas/gemm_batch.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ typedef sycl::event (*gemm_batch_impl_fn_ptr_t)(
6060
const char *,
6161
const char *,
6262
char *,
63+
#if !defined(USE_ONEMKL_CUBLAS)
6364
const bool,
65+
#endif // !USE_ONEMKL_CUBLAS
6466
const std::vector<sycl::event> &);
6567

6668
static gemm_batch_impl_fn_ptr_t
@@ -83,7 +85,9 @@ static sycl::event gemm_batch_impl(sycl::queue &exec_q,
8385
const char *matrixA,
8486
const char *matrixB,
8587
char *resultC,
88+
#if !defined(USE_ONEMKL_CUBLAS)
8689
const bool is_row_major,
90+
#endif // !USE_ONEMKL_CUBLAS
8791
const std::vector<sycl::event> &depends)
8892
{
8993
type_utils::validate_type_for_device<Tab>(exec_q);
@@ -311,6 +315,7 @@ std::tuple<sycl::event, sycl::event, bool>
311315
std::int64_t lda;
312316
std::int64_t ldb;
313317

318+
// cuBLAS supports only column-major storage
314319
#if defined(USE_ONEMKL_CUBLAS)
315320
const bool is_row_major = false;
316321

@@ -391,10 +396,17 @@ std::tuple<sycl::event, sycl::event, bool>
391396
const char *b_typeless_ptr = matrixB.get_data();
392397
char *r_typeless_ptr = resultC.get_data();
393398

399+
#if defined(USE_ONEMKL_CUBLAS)
400+
sycl::event gemm_batch_ev =
401+
gemm_batch_fn(exec_q, m, n, k, batch_size, lda, ldb, ldc, stridea,
402+
strideb, stridec, transA, transB, a_typeless_ptr,
403+
b_typeless_ptr, r_typeless_ptr, depends);
404+
#else
394405
sycl::event gemm_batch_ev =
395406
gemm_batch_fn(exec_q, m, n, k, batch_size, lda, ldb, ldc, stridea,
396407
strideb, stridec, transA, transB, a_typeless_ptr,
397408
b_typeless_ptr, r_typeless_ptr, is_row_major, depends);
409+
#endif // USE_ONEMKL_CUBLAS
398410

399411
sycl::event args_ev = dpctl::utils::keep_args_alive(
400412
exec_q, {matrixA, matrixB, resultC}, {gemm_batch_ev});

dpnp/backend/extensions/blas/gemv.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ typedef sycl::event (*gemv_impl_fn_ptr_t)(sycl::queue &,
5353
const std::int64_t,
5454
char *,
5555
const std::int64_t,
56+
#if !defined(USE_ONEMKL_CUBLAS)
5657
const bool,
58+
#endif // !USE_ONEMKL_CUBLAS
5759
const std::vector<sycl::event> &);
5860

5961
static gemv_impl_fn_ptr_t gemv_dispatch_vector[dpctl_td_ns::num_types];
@@ -69,7 +71,9 @@ static sycl::event gemv_impl(sycl::queue &exec_q,
6971
const std::int64_t incx,
7072
char *vectorY,
7173
const std::int64_t incy,
74+
#if !defined(USE_ONEMKL_CUBLAS)
7275
const bool is_row_major,
76+
#endif // !USE_ONEMKL_CUBLAS
7377
const std::vector<sycl::event> &depends)
7478
{
7579
type_utils::validate_type_for_device<T>(exec_q);
@@ -190,6 +194,7 @@ std::pair<sycl::event, sycl::event>
190194
oneapi::mkl::transpose transA;
191195
std::size_t src_nelems;
192196

197+
// cuBLAS supports only column-major storage
193198
#if defined(USE_ONEMKL_CUBLAS)
194199
const bool is_row_major = false;
195200
std::int64_t m;
@@ -299,9 +304,15 @@ std::pair<sycl::event, sycl::event>
299304
y_typeless_ptr -= (y_shape[0] - 1) * std::abs(incy) * y_elemsize;
300305
}
301306

307+
#if defined(USE_ONEMKL_CUBLAS)
308+
sycl::event gemv_ev =
309+
gemv_fn(exec_q, transA, m, n, a_typeless_ptr, lda, x_typeless_ptr, incx,
310+
y_typeless_ptr, incy, depends);
311+
#else
302312
sycl::event gemv_ev =
303313
gemv_fn(exec_q, transA, m, n, a_typeless_ptr, lda, x_typeless_ptr, incx,
304314
y_typeless_ptr, incy, is_row_major, depends);
315+
#endif // USE_ONEMKL_CUBLAS
305316

306317
sycl::event args_ev = dpctl::utils::keep_args_alive(
307318
exec_q, {matrixA, vectorX, vectorY}, {gemv_ev});

dpnp/backend/extensions/statistics/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set(_module_src
2929
${CMAKE_CURRENT_SOURCE_DIR}/bincount.cpp
3030
${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
3131
${CMAKE_CURRENT_SOURCE_DIR}/histogram.cpp
32+
${CMAKE_CURRENT_SOURCE_DIR}/histogramdd.cpp
3233
${CMAKE_CURRENT_SOURCE_DIR}/histogram_common.cpp
3334
${CMAKE_CURRENT_SOURCE_DIR}/sliding_dot_product1d.cpp
3435
${CMAKE_CURRENT_SOURCE_DIR}/sliding_window1d.cpp

0 commit comments

Comments
 (0)