Skip to content

Commit 524b89b

Browse files
committed
Add support of numpy 1.24
1 parent 5139df1 commit 524b89b

25 files changed

+77
-106
lines changed

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requirements:
88
host:
99
- python
1010
- setuptools
11-
- numpy >=1.19,<1.23a0
11+
- numpy >=1.19,<1.25a0
1212
- cython
1313
- cmake >=3.19
1414
- dpctl >=0.13

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//*****************************************************************************
2-
// Copyright (c) 2016-2022, Intel Corporation
2+
// Copyright (c) 2016-2023, Intel Corporation
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
@@ -391,7 +391,7 @@ enum class DPNPFuncType : size_t
391391
DPNP_FT_DOUBLE, /**< analog of numpy.float32 or double */
392392
DPNP_FT_CMPLX64, /**< analog of numpy.complex64 or std::complex<float> */
393393
DPNP_FT_CMPLX128, /**< analog of numpy.complex128 or std::complex<double> */
394-
DPNP_FT_BOOL /**< analog of numpy.bool or numpy.bool_ or bool */
394+
DPNP_FT_BOOL /**< analog of numpy.bool_ or bool */
395395
};
396396

397397
/**

dpnp/backend/kernels/dpnp_krnl_arraycreation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//*****************************************************************************
2-
// Copyright (c) 2016-2023, 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

dpnp/backend/src/dpnpc_memory_adapter.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
#include "queue_sycl.hpp"
3131
#include "dpnp_utils.hpp"
3232

33-
static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED,
34-
"The compiler does not meet minimum version requirement");
35-
3633
/**
3734
* @ingroup BACKEND_UTILS
3835
* @brief Adapter for the memory given by parameters in the DPNPC functions

dpnp/backend/src/queue_sycl.cpp

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

34-
static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED,
35-
"The compiler does not meet minimum version requirement");
36-
3734
#if defined(DPNP_LOCAL_QUEUE)
3835
sycl::queue* backend_sycl::queue = nullptr;
3936
#endif

dpnp/dparray.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cython: language_level=3
22
# -*- coding: utf-8 -*-
33
# *****************************************************************************
4-
# Copyright (c) 2016-2022, Intel Corporation
4+
# Copyright (c) 2016-2023, Intel Corporation
55
# All rights reserved.
66
#
77
# Redistribution and use in source and binary forms, with or without
@@ -462,7 +462,7 @@ cdef class dparray:
462462
return ( < long * > self._dparray_data)[lin_idx]
463463
elif self.dtype == numpy.int32:
464464
return ( < int * > self._dparray_data)[lin_idx]
465-
elif self.dtype == numpy.bool:
465+
elif self.dtype == numpy.bool_:
466466
return ( < cpp_bool * > self._dparray_data)[lin_idx]
467467
elif self.dtype == numpy.complex128:
468468
return ( < double complex * > self._dparray_data)[lin_idx]
@@ -489,7 +489,7 @@ cdef class dparray:
489489
( < long * > self._dparray_data)[lin_idx] = <long > value
490490
elif self.dtype == numpy.int32:
491491
( < int * > self._dparray_data)[lin_idx] = <int > value
492-
elif self.dtype == numpy.bool:
492+
elif self.dtype == numpy.bool_:
493493
( < cpp_bool * > self._dparray_data)[lin_idx] = < cpp_bool > value
494494
elif self.dtype == numpy.complex64:
495495
( < float complex * > self._dparray_data)[lin_idx] = <float complex > value
@@ -876,7 +876,7 @@ cdef class dparray:
876876

877877
"""
878878
879-
if not numpy.issubsctype(self.dtype, numpy.complex):
879+
if not numpy.issubsctype(self.dtype, numpy.complex_):
880880
return self
881881
else:
882882
return conjugate(self)
@@ -889,7 +889,7 @@ cdef class dparray:
889889

890890
"""
891891
892-
if not numpy.issubsctype(self.dtype, numpy.complex):
892+
if not numpy.issubsctype(self.dtype, numpy.complex_):
893893
return self
894894
else:
895895
return conjugate(self)

dpnp/dpnp_algo/dpnp_algo.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ cdef dpnp_DPNPFuncType_to_dtype(size_t type):
276276
elif type == <size_t > DPNP_FT_CMPLX128:
277277
return numpy.complex128
278278
elif type == <size_t > DPNP_FT_BOOL:
279-
return numpy.bool
279+
return numpy.bool_
280280
else:
281281
utils.checker_throw_type_error("dpnp_DPNPFuncType_to_dtype", type)
282282

dpnp/dpnp_algo/dpnp_algo_arraycreation.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cython: language_level=3
22
# -*- coding: utf-8 -*-
33
# *****************************************************************************
4-
# Copyright (c) 2016-2022, Intel Corporation
4+
# Copyright (c) 2016-2023, Intel Corporation
55
# All rights reserved.
66
#
77
# Redistribution and use in source and binary forms, with or without
@@ -434,7 +434,7 @@ cpdef utils.dpnp_descriptor dpnp_trace(utils.dpnp_descriptor arr, offset=0, axis
434434
return result
435435

436436

437-
cpdef utils.dpnp_descriptor dpnp_tri(N, M=None, k=0, dtype=numpy.float):
437+
cpdef utils.dpnp_descriptor dpnp_tri(N, M=None, k=0, dtype=dpnp.float):
438438
if M is None:
439439
M = N
440440

dpnp/dpnp_array.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
# *****************************************************************************
3-
# Copyright (c) 2016-2022, Intel Corporation
3+
# Copyright (c) 2016-2023, Intel Corporation
44
# All rights reserved.
55
#
66
# Redistribution and use in source and binary forms, with or without
@@ -493,7 +493,7 @@ def conj(self):
493493
494494
"""
495495

496-
if not numpy.issubsctype(self.dtype, numpy.complex):
496+
if not numpy.issubsctype(self.dtype, numpy.complex_):
497497
return self
498498
else:
499499
return dpnp.conjugate(self)
@@ -506,7 +506,7 @@ def conjugate(self):
506506
507507
"""
508508

509-
if not numpy.issubsctype(self.dtype, numpy.complex):
509+
if not numpy.issubsctype(self.dtype, numpy.complex_):
510510
return self
511511
else:
512512
return dpnp.conjugate(self)

dpnp/dpnp_iface_arraycreation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# distutils: language = c++
33
# -*- coding: utf-8 -*-
44
# *****************************************************************************
5-
# Copyright (c) 2016-2022, Intel Corporation
5+
# Copyright (c) 2016-2023, Intel Corporation
66
# All rights reserved.
77
#
88
# Redistribution and use in source and binary forms, with or without
@@ -1280,7 +1280,7 @@ def trace(x1, offset=0, axis1=0, axis2=1, dtype=None, out=None):
12801280
return call_origin(numpy.trace, x1, offset, axis1, axis2, dtype, out)
12811281

12821282

1283-
def tri(N, M=None, k=0, dtype=numpy.float, **kwargs):
1283+
def tri(N, M=None, k=0, dtype=dpnp.float, **kwargs):
12841284
"""
12851285
An array with ones at and below the given diagonal and zeros elsewhere.
12861286
@@ -1315,7 +1315,7 @@ def tri(N, M=None, k=0, dtype=numpy.float, **kwargs):
13151315
elif not isinstance(k, int):
13161316
pass
13171317
else:
1318-
if dtype is numpy.float:
1318+
if dtype is dpnp.float:
13191319
sycl_queue = dpnp.get_normalized_queue_device(sycl_queue=None, device=None)
13201320
dtype = map_dtype_to_device(dpnp.float64, sycl_queue.sycl_device)
13211321
return dpnp_tri(N, M, k, dtype).get_pyobj()

0 commit comments

Comments
 (0)