Skip to content

Commit 553e3c4

Browse files
authored
style 30Jan2021 (#549)
1 parent 5af3b34 commit 553e3c4

File tree

8 files changed

+19
-23
lines changed

8 files changed

+19
-23
lines changed

dpnp/backend/include/dpnp_iface.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ INP_DLLEXPORT void dpnp_std_c(
415415
* @param [in] size Number of elements in the input array.
416416
*/
417417
template <typename _DataType>
418-
INP_DLLEXPORT void dpnp_take_c(
419-
void* array, void* indices, void* result, size_t size);
418+
INP_DLLEXPORT void dpnp_take_c(void* array, void* indices, void* result, size_t size);
420419

421420
/**
422421
* @ingroup BACKEND_API

dpnp/backend/include/dpnp_iface_random.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ INP_DLLEXPORT void dpnp_rng_logistic_c(void* result, const double loc, double co
204204
* @param [out] result Output array.
205205
*/
206206
template <typename _DataType>
207-
INP_DLLEXPORT void dpnp_rng_lognormal_c(void* result, const _DataType mean, const _DataType stddev,
208-
const size_t size);
207+
INP_DLLEXPORT void dpnp_rng_lognormal_c(void* result, const _DataType mean, const _DataType stddev, const size_t size);
209208

210209
/**
211210
* @ingroup BACKEND_RANDOM_API
@@ -218,8 +217,8 @@ INP_DLLEXPORT void dpnp_rng_lognormal_c(void* result, const _DataType mean, cons
218217
* @param [out] result Output array.
219218
*/
220219
template <typename _DataType>
221-
INP_DLLEXPORT void dpnp_rng_multinomial_c(void* result, const int ntrial, const double* p_vector,
222-
const size_t p_vector_size, const size_t size);
220+
INP_DLLEXPORT void dpnp_rng_multinomial_c(
221+
void* result, const int ntrial, const double* p_vector, const size_t p_vector_size, const size_t size);
223222

224223
/**
225224
* @ingroup BACKEND_RANDOM_API

dpnp/backend/kernels/dpnp_krnl_indexing.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "dpnp_utils.hpp"
3232
#include "queue_sycl.hpp"
3333

34-
3534
template <typename _DataType>
3635
class dpnp_take_c_kernel;
3736

@@ -51,7 +50,6 @@ void dpnp_take_c(void* array1_in, void* indices1, void* result1, size_t size)
5150
return;
5251
}
5352

54-
5553
void func_map_init_indexing_func(func_map_t& fmap)
5654
{
5755
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_take_c<int>};

dpnp/backend/kernels/dpnp_krnl_random.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,8 @@ void dpnp_rng_lognormal_c(void* result, const _DataType mean, const _DataType st
407407
}
408408

409409
template <typename _DataType>
410-
void dpnp_rng_multinomial_c(void* result,
411-
const int ntrial,
412-
const double* p_vector,
413-
const size_t p_vector_size,
414-
const size_t size)
410+
void dpnp_rng_multinomial_c(
411+
void* result, const int ntrial, const double* p_vector, const size_t p_vector_size, const size_t size)
415412
{
416413
if (!size)
417414
{

dpnp/backend/tests/test_random.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ bool check_statistics(_DataType* r, double tM, double tD, double tQ, size_t size
4343
/***** Sample moments *****/
4444
sum = 0.0;
4545
sum2 = 0.0;
46-
for (size_t i = 0; i < size; i++) {
46+
for (size_t i = 0; i < size; i++)
47+
{
4748
sum += (double)r[i];
4849
sum2 += (double)r[i] * (double)r[i];
4950
}
@@ -175,7 +176,8 @@ TEST(TestBackendRandomUniform, test_seed)
175176
}
176177
}
177178

178-
TEST(TestBackendRandomUniform, test_statistics) {
179+
TEST(TestBackendRandomUniform, test_statistics)
180+
{
179181
const size_t size = 256;
180182
size_t seed = 10;
181183
long a = 1;
@@ -187,10 +189,10 @@ TEST(TestBackendRandomUniform, test_statistics) {
187189
double tD = ((b - a) * (b - a)) / 12.0;
188190
double tQ = ((b - a) * (b - a) * (b - a) * (b - a)) / 80.0;
189191

190-
auto QueueOptionsDevices = std::vector<QueueOptions>{ QueueOptions::CPU_SELECTOR,
191-
QueueOptions::GPU_SELECTOR };
192+
auto QueueOptionsDevices = std::vector<QueueOptions>{QueueOptions::CPU_SELECTOR, QueueOptions::GPU_SELECTOR};
192193

193-
for (auto device_selector : QueueOptionsDevices) {
194+
for (auto device_selector : QueueOptionsDevices)
195+
{
194196
dpnp_queue_initialize_c(device_selector);
195197
double* result = (double*)dpnp_memory_alloc_c(size * sizeof(double));
196198
dpnp_rng_srand_c(seed);
@@ -201,8 +203,8 @@ TEST(TestBackendRandomUniform, test_statistics) {
201203
}
202204
}
203205

204-
TEST(TestBackendRandomSrand, test_func_ptr) {
205-
206+
TEST(TestBackendRandomSrand, test_func_ptr)
207+
{
206208
void* fptr = nullptr;
207209
DPNPFuncData kernel_data = get_dpnp_function_ptr(
208210
DPNPFuncName::DPNP_FN_RNG_SRAND, DPNPFuncType::DPNP_FT_DOUBLE, DPNPFuncType::DPNP_FT_DOUBLE);

dpnp/dpnp_algo/dpnp_algo_mathematical.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ cpdef dparray dpnp_gradient(dparray y1, int dx=1):
278278
size = y1.size
279279

280280
cdef dparray result = dparray(size, dtype=dpnp.float64)
281-
281+
282282
cur = (y1[1] - y1[0]) / dx
283283

284284
result._setitem_scalar(0, cur)
285285

286286
cur = (y1[-1] - y1[-2]) / dx
287287

288288
result._setitem_scalar(size - 1, cur)
289-
289+
290290
for i in range(1, size - 1):
291291
cur = (y1[i + 1] - y1[i - 1]) / (2 * dx)
292292
result._setitem_scalar(i, cur)

dpnp/dpnp_iface_mathematical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def gradient(y1, *varargs, **kwargs):
809809
Keyword arguments ``kwargs`` are currently unsupported.
810810
Otherwise the functions will be executed sequentially on CPU.
811811
Input array data types are limited by supported DPNP :ref:`Data types`.
812-
812+
813813
Example
814814
-------
815815
>>> import dpnp as np

tests/test_special.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def test_erf():
1717

1818
numpy.testing.assert_array_equal(result, expected)
1919

20+
2021
def test_erf_fallback():
2122
a = numpy.linspace(2.0, 3.0, num=10)
2223

0 commit comments

Comments
 (0)