Skip to content

Commit 4030515

Browse files
committed
Merge branch 'master' into fix_is_host_deprecation
2 parents 2cf8a76 + ebe4f2a commit 4030515

25 files changed

+1910
-567
lines changed

.github/workflows/conda-package.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ jobs:
234234

235235
# TODO: run the whole scope once the issues on CPU are resolved
236236
- name: Run tests
237-
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_special.py
237+
run: |
238+
python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_random_state.py test_special.py
238239
env:
239240
OCL_ICD_FILENAMES: 'libintelocl.so'
240241
working-directory: ${{ env.tests-path }}
@@ -408,7 +409,8 @@ jobs:
408409

409410
# TODO: run the whole scope once the issues on CPU are resolved
410411
- name: Run tests
411-
run: python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_special.py
412+
run: |
413+
python -m pytest -q -ra --disable-warnings -vv test_arraycreation.py test_dparray.py test_fft.py test_linalg.py test_mathematical.py test_random_state.py test_special.py
412414
working-directory: ${{ env.tests-path }}
413415

414416
upload_linux:

dpnp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
from dpnp.dpnp_array import dpnp_array as ndarray
4646
from dpnp.dpnp_flatiter import flatiter as flatiter
4747

48+
from dpnp.dpnp_iface_types import *
4849
from dpnp.dpnp_iface import *
4950
from dpnp.dpnp_iface import __all__ as _iface__all__
50-
from dpnp.dpnp_iface_types import *
5151
from dpnp.version import __version__
5252

5353

dpnp/backend/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ set(DPNP_SRC
218218
src/memory_sycl.cpp
219219
src/queue_sycl.cpp
220220
src/verbose.cpp
221+
src/dpnp_random_state.cpp
221222
)
222223

223224
if(DPNP_STATIC_LIB_ENABLE)

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ enum class DPNPFuncName : size_t
314314
DPNP_FN_RNG_STANDARD_GAMMA, /**< Used in numpy.random.standard_gamma() impl */
315315
DPNP_FN_RNG_STANDARD_GAMMA_EXT, /**< Used in numpy.random.standard_gamma() impl, requires extra parameters */
316316
DPNP_FN_RNG_STANDARD_NORMAL, /**< Used in numpy.random.standard_normal() impl */
317-
DPNP_FN_RNG_STANDARD_NORMAL_EXT, /**< Used in numpy.random.standard_normal() impl */
318317
DPNP_FN_RNG_STANDARD_T, /**< Used in numpy.random.standard_t() impl */
319318
DPNP_FN_RNG_STANDARD_T_EXT, /**< Used in numpy.random.standard_t() impl, requires extra parameters */
320319
DPNP_FN_RNG_TRIANGULAR, /**< Used in numpy.random.triangular() impl */

dpnp/backend/include/dpnp_iface_random.hpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//*****************************************************************************
2-
// Copyright (c) 2016-2020, Intel Corporation
2+
// Copyright (c) 2016-2022, Intel Corporation
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
@@ -438,18 +438,20 @@ INP_DLLEXPORT void
438438
* @brief math library implementation of random number generator (normal continious distribution)
439439
*
440440
* @param [in] q_ref Reference to SYCL queue.
441-
* @param [out] result Output array.
441+
* @param [out] result_out Output array.
442442
* @param [in] mean Mean value.
443443
* @param [in] stddev Standard deviation.
444444
* @param [in] size Number of elements in `result` arrays.
445+
* @param [in] random_state_in Pointer on random state.
445446
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
446447
*/
447448
template <typename _DataType>
448449
INP_DLLEXPORT DPCTLSyclEventRef dpnp_rng_normal_c(DPCTLSyclQueueRef q_ref,
449-
void* result,
450-
const _DataType mean,
451-
const _DataType stddev,
452-
const size_t size,
450+
void* result_out,
451+
const double mean,
452+
const double stddev,
453+
const int64_t size,
454+
void* random_state_in,
453455
const DPCTLEventVectorRef dep_event_vec_ref);
454456

455457
template <typename _DataType>
@@ -629,17 +631,11 @@ INP_DLLEXPORT void dpnp_rng_standard_gamma_c(void* result, const _DataType shape
629631
* @brief math library implementation of random number generator (standard normal distribution)
630632
*
631633
* @param [in] q_ref Reference to SYCL queue.
632-
* @param [out] result Output array.
634+
* @param [out] result_out Output array.
633635
* @param [in] size Number of elements in `result` arrays.
634636
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
635637
*/
636638
template <typename _DataType>
637-
INP_DLLEXPORT DPCTLSyclEventRef dpnp_rng_standard_normal_c(DPCTLSyclQueueRef q_ref,
638-
void* result,
639-
const size_t size,
640-
const DPCTLEventVectorRef dep_event_vec_ref);
641-
642-
template <typename _DataType>
643639
INP_DLLEXPORT void dpnp_rng_standard_normal_c(void* result, const size_t size);
644640

645641
/**
@@ -692,18 +688,20 @@ INP_DLLEXPORT void dpnp_rng_triangular_c(
692688
* @brief math library implementation of random number generator (uniform distribution)
693689
*
694690
* @param [in] q_ref Reference to SYCL queue.
695-
* @param [out] result Output array.
691+
* @param [out] result_out Output array.
696692
* @param [in] low Left bound of array values.
697693
* @param [in] high Right bound of array values.
698694
* @param [in] size Number of elements in `result` array.
695+
* @param [in] random_state_in Pointer on random state.
699696
* @param [in] dep_event_vec_ref Reference to vector of SYCL events.
700697
*/
701698
template <typename _DataType>
702699
INP_DLLEXPORT DPCTLSyclEventRef dpnp_rng_uniform_c(DPCTLSyclQueueRef q_ref,
703-
void* result,
704-
const long low,
705-
const long high,
706-
const size_t size,
700+
void* result_out,
701+
const double low,
702+
const double high,
703+
const int64_t size,
704+
void* random_state_in,
707705
const DPCTLEventVectorRef dep_event_vec_ref);
708706

709707
template <typename _DataType>

0 commit comments

Comments
 (0)