From 520826627826b38956fecb4b0f27c14fde9a9a16 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Nov 2021 22:16:59 -0600 Subject: [PATCH] remove deprecated np.float and friends in tests --- loopy/target/ispc.py | 2 +- test/test_scan.py | 2 +- test/test_statistics.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/loopy/target/ispc.py b/loopy/target/ispc.py index 910494112..3c6ff52b0 100644 --- a/loopy/target/ispc.py +++ b/loopy/target/ispc.py @@ -133,7 +133,7 @@ def map_subscript(self, expr, type_context): # {{{ type registry def fill_registry_with_ispc_types(reg, respect_windows, include_bool=True): - reg.get_or_register_dtype("bool", np.bool) + reg.get_or_register_dtype("bool", bool) reg.get_or_register_dtype(["int8", "signed char", "char"], np.int8) reg.get_or_register_dtype(["uint8", "unsigned char"], np.uint8) diff --git a/test/test_scan.py b/test/test_scan.py index 31875ce5d..94778ef4d 100644 --- a/test/test_scan.py +++ b/test/test_scan.py @@ -324,7 +324,7 @@ def test_scan_library(ctx_factory, op_name, np_op): assumptions="n>=1") a = np.random.randn(20) - knl = lp.add_dtypes(knl, dict(a=np.float)) + knl = lp.add_dtypes(knl, dict(a=np.float64)) knl = lp.realize_reduction(knl, force_scan=True) evt, (res,) = knl(queue, a=a) diff --git a/test/test_statistics.py b/test/test_statistics.py index 95887f982..0f074ae53 100644 --- a/test/test_statistics.py +++ b/test/test_statistics.py @@ -1442,8 +1442,8 @@ def test_stats_on_callable_kernel(): y[:] = matvec20x20(A[:,:], x[:]) """, [ - lp.GlobalArg("x,y", shape=(20,), dtype=np.float), - lp.GlobalArg("A", shape=(20, 20), dtype=np.float), + lp.GlobalArg("x,y", shape=(20,), dtype=np.float64), + lp.GlobalArg("A", shape=(20, 20), dtype=np.float64), ], name="matvec") caller = lp.merge([caller, callee]) @@ -1467,8 +1467,8 @@ def test_stats_on_callable_kernel_within_loop(): y[i, :] = matvec20x20(A[:,:], x[i, :]) """, [ - lp.GlobalArg("x,y", shape=(20, 20), dtype=np.float), - lp.GlobalArg("A", shape=(20, 20), dtype=np.float), + lp.GlobalArg("x,y", shape=(20, 20), dtype=np.float64), + lp.GlobalArg("A", shape=(20, 20), dtype=np.float64), ], name="matmat") caller = lp.merge([caller, callee]) @@ -1495,8 +1495,8 @@ def test_callable_kernel_with_substitution(): y[i, :] = matvec(20, A[:,:], x[i, :]) """, [ - lp.GlobalArg("x,y", shape=(20, 20), dtype=np.float), - lp.GlobalArg("A", shape=(20, 20), dtype=np.float), + lp.GlobalArg("x,y", shape=(20, 20), dtype=np.float64), + lp.GlobalArg("A", shape=(20, 20), dtype=np.float64), ], name="matmat") caller = lp.merge([caller, callee]) @@ -1518,7 +1518,7 @@ def test_no_loop_ops(): d = 2*c + a + b """) - knl = lp.add_dtypes(knl, {"a": np.float, "b": np.float}) + knl = lp.add_dtypes(knl, {"a": np.float64, "b": np.float64}) op_map = lp.get_op_map(knl, subgroup_size=SGS, count_redundant_work=True, count_within_subscripts=True)