From 50d48d25951dabc247b6ae4ef346e736abe0467d Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:01:45 -0600 Subject: [PATCH 1/8] updated copyright year --- mkl_random/src/mkl_distributions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkl_random/src/mkl_distributions.cpp b/mkl_random/src/mkl_distributions.cpp index 247aa6e..a2adcf1 100644 --- a/mkl_random/src/mkl_distributions.cpp +++ b/mkl_random/src/mkl_distributions.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2017-2019, Intel Corporation + Copyright (c) 2017-2021, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From 0178e4441cdb9242a5dfbaa408e869d1bdabc88d Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:03:05 -0600 Subject: [PATCH 2/8] Replaced explicit use of #pragma ivdep Use _Pragma("vector") hidden behind compiler-aware preprocessor variable --- mkl_random/src/mkl_distributions.cpp | 85 ++++++++++++++++------------ 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/mkl_random/src/mkl_distributions.cpp b/mkl_random/src/mkl_distributions.cpp index a2adcf1..16dc00a 100644 --- a/mkl_random/src/mkl_distributions.cpp +++ b/mkl_random/src/mkl_distributions.cpp @@ -40,6 +40,17 @@ #define MKL_INT_MAX ((npy_intp) (~((MKL_UINT) 0) >> 1)) +#if defined(__ICC) || defined(__INTEL_COMPILER) +#define DIST_PRAGMA_VECTOR _Pragma("vector") +#define DIST_PRAGMA_NOVECTOR _Pragma("novector") +#define DIST_ASSUME_ALIGNED(p, b) __assume_aligned((p), (b)); +#else +#define DIST_PRAGMA_VECTOR _Pragma("GCC ivdep") +#define DIST_PRAGMA_NOVECTOR +#define DIST_ASSUME_ALIGNED(p, b) +#endif + + void irk_double_vec(irk_state *state, npy_intp len, double *res) { @@ -413,7 +424,7 @@ irk_pareto_vec(irk_state *state, npy_intp len, double *res, const double alp) /* res[i] = pow(res[i], neg_rec_alp) */ vmdPowx(len, res, neg_rec_alp, res, VML_HA); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] -= 1.0; } @@ -491,7 +502,7 @@ irk_rayleigh_vec(irk_state *state, npy_intp len, double *res, const double scale vmdSqrt(len, res, res, VML_HA); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] *= scale; } @@ -618,7 +629,7 @@ irk_noncentral_chisquare_vec(irk_state *state, npy_intp len, double *res, const idx = (int *) mkl_malloc(len * sizeof(int), 64); assert( idx != NULL ); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i i); @@ -639,7 +650,7 @@ irk_noncentral_chisquare_vec(irk_state *state, npy_intp len, double *res, const shape + cv, d_zero, d_two); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(k = i; k < j; k++) res[idx[k]] = tmp[k - i]; i = j; @@ -733,10 +744,10 @@ irk_logistic_vec(irk_state *state, npy_intp len, double *res, const double loc, assert(err == VSL_STATUS_OK); /* can MKL optimize computation of the logit function p \mapsto \ln(p/(1-p)) */ - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; istream, len, uvec, d_zero, d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; istream, len, VFvec, (float) d_zero, (float) d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { double mod, resi; @@ -943,7 +954,7 @@ irk_vonmises_vec_large_kappa(irk_state *state, npy_intp len, double *res, const err = vdRngUniform(VSL_RNG_METHOD_UNIFORM_STD_ACCURATE, state->stream, size, Vvec, d_zero, d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < size; i++ ) { double sn, cn, sn2, cn2; double neg_W_minus_one, V, Y; @@ -973,7 +984,7 @@ irk_vonmises_vec_large_kappa(irk_state *state, npy_intp len, double *res, const err = vsRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, VFvec, (float) d_zero, (float) d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { double mod, resi; @@ -1041,7 +1052,7 @@ irk_noncentral_f_vec(irk_state *state, npy_intp len, double *res, const double d mkl_free(den); fctr = df_den/df_num; - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] *= fctr; } @@ -1082,18 +1093,18 @@ irk_triangular_vec(irk_state *state, npy_intp len, double *res, const double x_m assert( 0 <= ratio && ratio <= 1); if (ratio <= 0) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { /* U and 1 - U are equal in distribution */ res[i] = x_max - sqrt(res[i] * rpr); } } else if (ratio >= 1) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { res[i] = x_min + sqrt(res[i]*lpr); } } else { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { double ui = res[i]; res[i] = (ui > ratio) ? x_max - sqrt((1.0 - ui) * rpr) : x_min + sqrt(ui*lpr); @@ -1324,7 +1335,7 @@ irk_zipf_long_vec(irk_state *state, npy_intp len, long *res, const double a) err = vdRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, batch_size, Vvec, d_zero, d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < batch_size; i++) { U = d_one - Uvec[i]; V = Vvec[i]; X = (long)floor(pow(U, (-1.0)/am1)); @@ -1379,7 +1390,7 @@ irk_logseries_vec(irk_state *state, npy_intp len, int *res, const double theta) err = vdRngUniform(VSL_RNG_METHOD_UNIFORM_STD_ACCURATE, state->stream, batch_size, Vvec, d_zero, d_one); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < batch_size; i++) { V = Vvec[i]; if (V >= theta) { @@ -1454,7 +1465,7 @@ irk_discrete_uniform_long_vec(irk_state *state, npy_intp len, long *res, const l max = ((unsigned long) high) - ((unsigned long) low) - 1UL; if(max == 0) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] = low; return; @@ -1467,7 +1478,7 @@ irk_discrete_uniform_long_vec(irk_state *state, npy_intp len, long *res, const l err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, -1, (const int) max); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] = low + ((long) buf[i]) + 1L; mkl_free(buf); @@ -1542,7 +1553,7 @@ irk_long_vec(irk_state *state, npy_intp len, long *res) irk_ulong_vec(state, len, ulptr); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i> 1); @@ -1565,7 +1576,7 @@ irk_rand_bool_vec(irk_state *state, npy_intp len, npy_bool *res, const npy_bool } if (lo == hi) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1578,7 +1589,7 @@ irk_rand_bool_vec(irk_state *state, npy_intp len, npy_bool *res, const npy_bool err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, (const int) lo, (const int) hi + 1); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = (npy_bool) buf[i]; mkl_free(buf); @@ -1601,7 +1612,7 @@ irk_rand_uint8_vec(irk_state *state, npy_intp len, npy_uint8 *res, const npy_uin } if (lo == hi) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1614,7 +1625,7 @@ irk_rand_uint8_vec(irk_state *state, npy_intp len, npy_uint8 *res, const npy_uin err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, (const int) lo, (const int) hi + 1); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = (npy_uint8) buf[i]; mkl_free(buf); @@ -1638,7 +1649,7 @@ irk_rand_int8_vec(irk_state *state, npy_intp len, npy_int8 *res, const npy_int8 } if (lo == hi) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1651,7 +1662,7 @@ irk_rand_int8_vec(irk_state *state, npy_intp len, npy_int8 *res, const npy_int8 err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, (const int) lo, (const int) hi + 1); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = (npy_int8) buf[i]; mkl_free(buf); @@ -1674,7 +1685,7 @@ irk_rand_uint16_vec(irk_state *state, npy_intp len, npy_uint16 *res, const npy_u } if (lo == hi) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1687,7 +1698,7 @@ irk_rand_uint16_vec(irk_state *state, npy_intp len, npy_uint16 *res, const npy_u err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, (const int) lo, (const int) hi + 1); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = (npy_uint16) buf[i]; mkl_free(buf); @@ -1710,7 +1721,7 @@ irk_rand_int16_vec(irk_state *state, npy_intp len, npy_int16 *res, const npy_int } if (lo == hi) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1723,7 +1734,7 @@ irk_rand_int16_vec(irk_state *state, npy_intp len, npy_int16 *res, const npy_int err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, (const int) lo, (const int) hi + 1); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = (npy_int16) buf[i]; mkl_free(buf); @@ -1764,7 +1775,7 @@ irk_rand_uint32_vec(irk_state *state, npy_intp len, npy_uint32 *res, const npy_u err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, (int *) res, (const int) (lo - shft), (const int) (hi - shft + 1U)); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] += shft; } else { @@ -1794,7 +1805,7 @@ irk_rand_int32_vec(irk_state *state, npy_intp len, npy_int32 *res, const npy_int irk_rand_uint32_vec(state, len, (npy_uint32 *) res, 0U, (npy_uint32) (hi - lo)); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] += lo; } else { @@ -1829,7 +1840,7 @@ irk_rand_uint64_vec(irk_state *state, npy_intp len, npy_uint64 *res, const npy_u rng = hi - lo; if(!rng) { - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = lo; return; @@ -1844,7 +1855,7 @@ irk_rand_uint64_vec(irk_state *state, npy_intp len, npy_uint64 *res, const npy_u err = viRngUniform(VSL_RNG_METHOD_UNIFORM_STD, state->stream, len, buf, 0, (const int) rng); assert(err == VSL_STATUS_OK); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i=0; i < len; i++) res[i] = lo + ((npy_uint64) buf[i]); mkl_free(buf); @@ -1896,7 +1907,7 @@ irk_rand_int64_vec(irk_state *state, npy_intp len, npy_int64 *res, const npy_int irk_rand_uint64_vec(state, len, (npy_uint64 *) res, 0, rng); - #pragma ivdep + DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) res[i] = res[i] + lo; @@ -1950,7 +1961,7 @@ irk_multinormal_vec_BM2(irk_state *state, npy_intp len, double *res, const int d int err; const MKL_INT storage_mode = cholesky_storage_flags[storage_flag]; - if (len<1) + if (len<1) return; while (len > MKL_INT_MAX) { From 6e4ac5ffa6f7cacba3f8c2516b5d91d2d9c674fe Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:04:15 -0600 Subject: [PATCH 3/8] Fixed typo in Wald sampling It gsc should have been sqrt(0.5*mean/scale), not 0.5*sqrt(mean/scale). Also made code transforming variables robust to significant digits cancellation. --- mkl_random/src/mkl_distributions.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mkl_random/src/mkl_distributions.cpp b/mkl_random/src/mkl_distributions.cpp index 16dc00a..4176974 100644 --- a/mkl_random/src/mkl_distributions.cpp +++ b/mkl_random/src/mkl_distributions.cpp @@ -802,7 +802,7 @@ irk_wald_vec(irk_state *state, npy_intp len, double *res, const double mean, con int i, err; const double d_zero = 0., d_one = 1.0; double *uvec = NULL; - double gsc = 0.5*sqrt(mean / scale); + double gsc = sqrt(0.5*mean / scale); if (len < 1) return; @@ -817,15 +817,15 @@ irk_wald_vec(irk_state *state, npy_intp len, double *res, const double mean, con err = vdRngGaussian(VSL_RNG_METHOD_GAUSSIAN_ICDF, state->stream, len, res, d_zero, gsc); assert(err == VSL_STATUS_OK); - /* Y = mean/(4 scale) * Z^2 */ + /* Y = mean/(2 scale) * Z^2 */ vmdSqr(len, res, res, VML_HA); DIST_PRAGMA_VECTOR for(i = 0; i < len; i++) { - if(res[i] <= 1.0) { - res[i] = 1.0 + res[i] - sqrt( res[i] * (res[i] + 2.0)); + if(res[i] <= 2.0) { + res[i] = 1.0 + res[i] + sqrt(res[i] * (res[i] + 2.0)); } else { - res[i] = 1.0 - 2.0/(1.0 + sqrt( 1 + 2.0/res[i])); + res[i] = 1.0 + res[i]*(1.0 + sqrt(1.0 + 2.0/res[i])); } } @@ -837,10 +837,10 @@ irk_wald_vec(irk_state *state, npy_intp len, double *res, const double mean, con DIST_PRAGMA_VECTOR for(i=0; i Date: Tue, 9 Feb 2021 16:23:55 -0600 Subject: [PATCH 4/8] removed unsued variables per compiler warnings --- mkl_random/src/mkl_distributions.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/mkl_random/src/mkl_distributions.cpp b/mkl_random/src/mkl_distributions.cpp index 4176974..c606beb 100644 --- a/mkl_random/src/mkl_distributions.cpp +++ b/mkl_random/src/mkl_distributions.cpp @@ -433,7 +433,7 @@ irk_pareto_vec(irk_state *state, npy_intp len, double *res, const double alp) void irk_weibull_vec(irk_state *state, npy_intp len, double *res, const double alp) { - int i, err; + int err; const double d_zero = 0.0, d_one = 1.0; double rec_alp = 1.0/alp; @@ -458,7 +458,7 @@ irk_weibull_vec(irk_state *state, npy_intp len, double *res, const double alp) void irk_power_vec(irk_state *state, npy_intp len, double *res, const double alp) { - int i, err; + int err; const double d_zero = 0.0, d_one = 1.0; double rec_alp = 1.0/alp; @@ -534,7 +534,7 @@ void irk_f_vec(irk_state *state, npy_intp len, double *res, const double df_num, const double df_den) { int err; - const double d_zero = 0.0, d_one = 1.0; + const double d_zero = 0.0; double shape = 0.5*df_num, scale = 2.0/df_num; double *den = NULL; @@ -642,7 +642,6 @@ irk_noncentral_chisquare_vec(irk_state *state, npy_intp len, double *res, const for(i = 0; i < len; ) { int k, j, cv = pvec[idx[i]]; - DIST_PRAGMA_VECTOR for(j=i+1; (j < len) && (pvec[idx[j]] == cv); j++) {} assert(j > i); @@ -728,7 +727,7 @@ void irk_logistic_vec(irk_state *state, npy_intp len, double *res, const double loc, const double scale) { int i, err; - const double d_one = 1.0, d_mone = -1.0, d_zero = 0.0; + const double d_one = 1.0, d_zero = 0.0; if(len < 1) return; @@ -862,7 +861,7 @@ irk_wald_vec(irk_state *state, npy_intp len, double *res, const double mean, con static void irk_vonmises_vec_small_kappa(irk_state *state, npy_intp len, double *res, const double mu, const double kappa) { - int i, err, n, size, blen = 1 << 20; + int i, err, n, size; double rho_over_kappa, rho, r, s_kappa, Z, W, Y, V; double *Uvec = NULL, *Vvec = NULL; float *VFvec = NULL; @@ -923,9 +922,9 @@ irk_vonmises_vec_small_kappa(irk_state *state, npy_intp len, double *res, const static void irk_vonmises_vec_large_kappa(irk_state *state, npy_intp len, double *res, const double mu, const double kappa) { - int i, err, n, size, blen = 1 << 20; + int i, err, n, size; double r_over_two_kappa, recip_two_kappa; - double s_minus_one, hpt, r_over_two_kappa_minus_one, rho_minus_one, neg_W_minus_one; + double s_minus_one, hpt, r_over_two_kappa_minus_one, rho_minus_one; double *Uvec = NULL, *Vvec = NULL; float *VFvec = NULL; const double d_zero = 0.0, d_one = 1.0; @@ -1000,8 +999,6 @@ irk_vonmises_vec_large_kappa(irk_state *state, npy_intp len, double *res, const void irk_vonmises_vec(irk_state *state, npy_intp len, double *res, const double mu, const double kappa) { - int blen = 1 << 20; - if(len < 1) return; @@ -1022,7 +1019,7 @@ irk_vonmises_vec(irk_state *state, npy_intp len, double *res, const double mu, c void irk_noncentral_f_vec(irk_state *state, npy_intp len, double *res, const double df_num, const double df_den, const double nonc) { - int i, blen = 1 << 20; + int i; double *den = NULL, fctr; if(len < 1) @@ -1281,7 +1278,7 @@ irk_poisson_vec_POISNORM(irk_state *state, npy_intp len, int *res, const double void irk_poisson_vec_V(irk_state *state, npy_intp len, int *res, double *lambdas) { - int err, blen; + int err; if(len < 1) return; @@ -1304,7 +1301,7 @@ irk_poisson_vec_V(irk_state *state, npy_intp len, int *res, double *lambdas) void irk_zipf_long_vec(irk_state *state, npy_intp len, long *res, const double a) { - int i, err, n_accepted, batch_size, blen = 1 << 20; + int i, err, n_accepted, batch_size; double T, U, V, am1, b; double *Uvec = NULL, *Vvec = NULL; long X; @@ -1897,7 +1894,6 @@ void irk_rand_int64_vec(irk_state *state, npy_intp len, npy_int64 *res, const npy_int64 lo, const npy_int64 hi) { npy_uint64 rng; - int err; npy_intp i; if (len < 1) From c6d63627c119be9fdffd4b402ffdca0e3f705370 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:24:16 -0600 Subject: [PATCH 5/8] suppressed unsed-functions warning on Linux --- mkl_random/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkl_random/setup.py b/mkl_random/setup.py index 4f60d86..1395f9a 100644 --- a/mkl_random/setup.py +++ b/mkl_random/setup.py @@ -70,12 +70,16 @@ def configuration(parent_package='',top_path=None): pdir = 'mkl_random' wdir = join(pdir, 'src') + eca = [Q + 'std=c++11'] + if sys.platform == "linux": + eca.extend(["-Wno-unused-but-set-variable", "-Wno-unused-function"]) + config.add_library( 'mkl_dists', sources=join(wdir, 'mkl_distributions.cpp'), libraries=libs, include_dirs=[wdir,pdir,get_numpy_include(),get_python_include()], - extra_compiler_args=[Q + 'std=c++11'], + extra_compiler_args=eca, depends=[join(wdir, '*.h'),], language='c++', ) From 011f3f3c2bea0446f959aff132adb38a2b898756 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:28:36 -0600 Subject: [PATCH 6/8] modified test_wald after bug fix --- mkl_random/tests/test_random.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mkl_random/tests/test_random.py b/mkl_random/tests/test_random.py index 933c152..05ee6c7 100644 --- a/mkl_random/tests/test_random.py +++ b/mkl_random/tests/test_random.py @@ -890,9 +890,11 @@ def test_vonmises_small(self): def test_wald(self): rnd.seed(self.seed, brng=self.brng) actual = rnd.wald(mean=1.23, scale=1.54, size=(3, 2)) - desired = np.array([[0.3465678392232347, 0.3594497155916536], - [2.192908727996422, 1.7408141717513501], - [1.1943709105062374, 0.3273455943060196]]) + desired = np.array( + [[0.22448558337033758, 0.23485255518098838], + [2.756850184899666, 2.005347850108636], + [1.179918636588408, 0.20928649815442452] + ]) np.testing.assert_array_almost_equal(actual, desired, decimal=10) def test_weibull(self): From dc39e1118937db20e9f236ddc5f1bc477a6f6f4f Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 9 Feb 2021 16:31:48 -0600 Subject: [PATCH 7/8] Added test that noncentral_chisquare(df=1.) gives positive samples --- mkl_random/tests/test_regression.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mkl_random/tests/test_regression.py b/mkl_random/tests/test_regression.py index e719c00..45593b9 100644 --- a/mkl_random/tests/test_regression.py +++ b/mkl_random/tests/test_regression.py @@ -170,5 +170,10 @@ def test_shuffle_of_array_of_objects(self): gc.collect() + def test_non_central_chi_squared_df_one(self): + a = rnd.noncentral_chisquare(df = 1.0, nonc=2.3, size=10**4) + assert(a.min() > 0.0) + + if __name__ == "__main__": run_module_suite() From 4c88fb9313f60ef339acd1413968d2233ce9b080 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 10 Feb 2021 08:12:15 -0600 Subject: [PATCH 8/8] update --numpy version in .travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7551481..fb393f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,4 +28,4 @@ install: - g++ -v script: - - conda build -c intel -c conda-forge --numpy=1.16 $PYVER conda-recipe + - conda build -c intel -c conda-forge --override-channels $PYVER conda-recipe