Skip to content

Commit 96319d5

Browse files
ENH: random.multivariate_normal enable on GPU (#687)
1 parent a85aa25 commit 96319d5

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

dpnp/backend/kernels/dpnp_krnl_random.cpp

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -548,27 +548,9 @@ void dpnp_rng_multivariate_normal_c(void* result,
548548
// `size1` is a number of random values to be generated for each dimension.
549549
size_t size1 = size / dimen;
550550

551-
if (dpnp_queue_is_cpu_c())
552-
{
553-
mkl_rng::gaussian_mv<_DataType> distribution(dimen, mean, cov);
554-
auto event_out = mkl_rng::generate(distribution, DPNP_RNG_ENGINE, size1, result1);
555-
event_out.wait();
556-
}
557-
else
558-
{
559-
int errcode = vdRngGaussianMV(VSL_RNG_METHOD_GAUSSIANMV_BOXMULLER2,
560-
get_rng_stream(),
561-
size1,
562-
result1,
563-
dimen,
564-
VSL_MATRIX_STORAGE_FULL,
565-
mean_vector,
566-
cov_vector);
567-
if (errcode != VSL_STATUS_OK)
568-
{
569-
throw std::runtime_error("DPNP RNG Error: dpnp_rng_multivariate_normal_c() failed.");
570-
}
571-
}
551+
mkl_rng::gaussian_mv<_DataType> distribution(dimen, mean, cov);
552+
auto event_out = mkl_rng::generate(distribution, DPNP_RNG_ENGINE, size1, result1);
553+
event_out.wait();
572554
}
573555

574556
template <typename _DataType>

0 commit comments

Comments
 (0)