Skip to content

Commit 23e9b88

Browse files
authored
np.negative (#184)
1 parent 1175008 commit 23e9b88

File tree

4 files changed

+98
-97
lines changed

4 files changed

+98
-97
lines changed

azure-pipelines.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ jobs:
126126
export OCL_ICD_FILENAMES=libintelocl.so
127127
export SYCL_DEVICE_FILTER=opencl:cpu
128128
export NUMBA_DISABLE_PERFORMANCE_WARNINGS=1
129-
export DPCOMP_ENABLE_PARFOR_TESTS=1
130129
pytest -n1 -vv --capture=tee-sys -rX
131130
displayName: 'Tests'
132131

numba_dpcomp/numba_dpcomp/mlir/numpy/funcs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def bool_type(builder, t):
207207
(register_func("numpy.exp", numpy.exp), f64_type, lambda a, b: math.exp(a)),
208208
(register_func("numpy.tanh", numpy.tanh), f64_type, lambda a, b: math.tanh(a)),
209209
(register_func("numpy.abs", numpy.abs), None, lambda a, b: abs(a)),
210+
(register_func("numpy.negative", numpy.negative), None, lambda a, b: -a),
210211
(
211212
register_func("numpy.logical_not", numpy.logical_not),
212213
bool_type,

numba_dpcomp/numba_dpcomp/mlir/tests/test_numba_parfor.py

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -53,103 +53,103 @@ def _gen_tests():
5353
]
5454

5555
xfail_tests = {
56-
"test_prange03sub", # sub reduction
57-
"test_prange03div", # div reduction
58-
"test_prange25", # list support
59-
"test_prange18", # memssa failure
60-
"test_list_setitem_hoisting", # list support
61-
"test_list_comprehension_prange", # list comprehension support
62-
"test_prange_raises_invalid_step_size", # we actually support arbirary step in prange
63-
"test_issue7501", # invalid tensor<->memref canonicalization
64-
"test_parfor_race_1", # cfg->scf conversion failure
65-
"test_nested_parfor_push_call_vars", # Can't resolve function 'negative'
66-
"test_record_array_setitem_yield_array", # Record and string support
67-
"test_record_array_setitem", # Record and string support
68-
"test_multiple_call_getattr_object", # Can't resolve function 'negative'
69-
"test_prange_two_instances_same_reduction_var", # Non-trivial reduction
56+
"test_prange03sub", # sub reduction
57+
"test_prange03div", # div reduction
58+
"test_prange25", # list support
59+
"test_prange18", # memssa failure
60+
"test_list_setitem_hoisting", # list support
61+
"test_list_comprehension_prange", # list comprehension support
62+
"test_prange_raises_invalid_step_size", # we actually support arbirary step in prange
63+
"test_issue7501", # invalid tensor<->memref canonicalization
64+
"test_parfor_race_1", # cfg->scf conversion failure
65+
"test_nested_parfor_push_call_vars", # 'float' object has no attribute 'dtype'
66+
"test_record_array_setitem_yield_array", # Record and string support
67+
"test_record_array_setitem", # Record and string support
68+
"test_multiple_call_getattr_object", # 'float' object has no attribute 'dtype'
69+
"test_prange_two_instances_same_reduction_var", # Non-trivial reduction
7070
"test_prange_conflicting_reduction_ops", # Conflicting reduction reduction check
71-
"test_ssa_false_reduction", # Frontend: object has no attribute 'name'
72-
"test_argument_alias_recarray_field", # Record support
73-
"test_mutable_list_param", # List support
74-
"test_signed_vs_unsigned_vec_asm", # Need to hook asm checks
75-
"test_unsigned_refusal_to_vectorize", # Need to hook asm checks
76-
"test_vectorizer_fastmath_asm", # Need to hook asm checks
77-
"test_kde_example", # List suport
78-
"test_prange27", # Literal return issue
79-
"test_simple01", # Empty shape not failed
80-
"test_kmeans", # List suport
81-
"test_simple14", # Slice shape mismatch
82-
"test_ndarray_fill", # array.fill
83-
"test_fuse_argmin_argmax_max_min", # numpy argmin, argmax
84-
"test_max", # max reduction
85-
"test_min", # min reduction
86-
"test_arange", # numpy.arange
87-
"test_pi", # np.random.ranf
88-
"test_simple20", # AssertionError not raised
89-
"test_simple24", # numpy.arange
90-
"test_0d_array", # numpy prod
91-
"test_argmin", # numpy.argmin
92-
"test_argmax", # numpy.argmax
93-
"test_simple07", # complex128 support
94-
"test_ndarray_fill2d", # array.fill
95-
"test_simple18", # np.linalg.svd
96-
"test_linspace", # np.linspace
97-
"test_std", # array.std
98-
"test_reshape_with_neg_one", # unsupported reshape
99-
"test_mvdot", # np.dot unsupported args
100-
"test_array_tuple_concat", # tuple concat
101-
"test_namedtuple1", # namedtuple support
102-
"test_0d_broadcast", # np.array
103-
"test_var", # array.var
104-
"test_reshape_with_too_many_neg_one", # unsupported reshape
105-
"test_namedtuple2", # namedtuple support
106-
"test_simple19", # np.dot unsupported args
107-
"test_no_hoisting_with_member_function_call", # set support
108-
"test_parfor_dtype_type", # dtype cast
109-
"test_tuple3", # numpy.arange
110-
"test_parfor_array_access3", # TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
111-
"test_preparfor_canonicalize_kws", # array.argsort
112-
"test_parfor_array_access4", # np.dot unsupported args
113-
"test_tuple_concat_with_reverse_slice", # enumerate
114-
"test_reduce", # functools.reduce
115-
"test_two_d_array_reduction", # np.arange
116-
"test_tuple_concat", # tuple concat
117-
"test_two_d_array_reduction_with_float_sizes", # np.array
118-
"test_two_d_array_reduction_reuse", # np.arange
119-
"test_parfor_slice21", # unsupported reshape
120-
"test_parfor_array_access_lower_slice", # np.arange
121-
"test_size_assertion", # AssertionError not raised
122-
"test_parfor_slice18", # np.arange
123-
"test_simple12", # complex128
124-
"test_parfor_slice2", # AssertionError not raised
125-
"test_parfor_slice6", # array.transpose
126-
"test_parfor_slice22", # slice using array
127-
"test_simple13", # complex128
128-
"test_parfor_bitmask1", # setitem with mask
129-
"test_parfor_bitmask2", # setitem with mask
130-
"test_parfor_bitmask3", # setitem with mask
131-
"test_parfor_bitmask4", # setitem with mask
132-
"test_parfor_bitmask5", # setitem with mask
133-
"test_parfor_bitmask6", # setitem with mask
134-
"test_issue3169", # list support
135-
"test_issue3748", # unituple of literal dynamic getitem
136-
"test_issue5001", # list suport
137-
"test_issue5167", # np.full
138-
"test_issue6095_numpy_max", # operand #1 does not dominate this use
139-
"test_issue5065", # tuple unpack
140-
"test_no_state_change_in_gufunc_lowering_on_error", # custom pipeline
141-
"test_namedtuple3", # namedtuple
142-
"test_issue6102", # list support
143-
"test_oversized_tuple_as_arg_to_kernel", # UnsupportedParforsError not raised
144-
"test_issue5942_2", # invalid result
145-
"test_reshape_with_large_neg", # unsupported reshape
146-
"test_parfor_ufunc_typing", # np.isinf
147-
"test_issue_5098", # list support and more
148-
"test_parfor_slice27", # Literal return issue
149-
"test_ufunc_expr", # np.bitwise_and(
150-
"test_parfor_generate_fuse", # operand #0 does not dominate this use
151-
"test_parfor_slice7", # array.transpose
152-
"test_one_d_array_reduction", # np.array
71+
"test_ssa_false_reduction", # Frontend: object has no attribute 'name'
72+
"test_argument_alias_recarray_field", # Record support
73+
"test_mutable_list_param", # List support
74+
"test_signed_vs_unsigned_vec_asm", # Need to hook asm checks
75+
"test_unsigned_refusal_to_vectorize", # Need to hook asm checks
76+
"test_vectorizer_fastmath_asm", # Need to hook asm checks
77+
"test_kde_example", # List suport
78+
"test_prange27", # Literal return issue
79+
"test_simple01", # Empty shape not failed
80+
"test_kmeans", # List suport
81+
"test_simple14", # Slice shape mismatch
82+
"test_ndarray_fill", # array.fill
83+
"test_fuse_argmin_argmax_max_min", # numpy argmin, argmax
84+
"test_max", # max reduction
85+
"test_min", # min reduction
86+
"test_arange", # numpy.arange
87+
"test_pi", # np.random.ranf
88+
"test_simple20", # AssertionError not raised
89+
"test_simple24", # numpy.arange
90+
"test_0d_array", # numpy prod
91+
"test_argmin", # numpy.argmin
92+
"test_argmax", # numpy.argmax
93+
"test_simple07", # complex128 support
94+
"test_ndarray_fill2d", # array.fill
95+
"test_simple18", # np.linalg.svd
96+
"test_linspace", # np.linspace
97+
"test_std", # array.std
98+
"test_reshape_with_neg_one", # unsupported reshape
99+
"test_mvdot", # np.dot unsupported args
100+
"test_array_tuple_concat", # tuple concat
101+
"test_namedtuple1", # namedtuple support
102+
"test_0d_broadcast", # np.array
103+
"test_var", # array.var
104+
"test_reshape_with_too_many_neg_one", # unsupported reshape
105+
"test_namedtuple2", # namedtuple support
106+
"test_simple19", # np.dot unsupported args
107+
"test_no_hoisting_with_member_function_call", # set support
108+
"test_parfor_dtype_type", # dtype cast
109+
"test_tuple3", # numpy.arange
110+
"test_parfor_array_access3", # TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
111+
"test_preparfor_canonicalize_kws", # array.argsort
112+
"test_parfor_array_access4", # np.dot unsupported args
113+
"test_tuple_concat_with_reverse_slice", # enumerate
114+
"test_reduce", # functools.reduce
115+
"test_two_d_array_reduction", # np.arange
116+
"test_tuple_concat", # tuple concat
117+
"test_two_d_array_reduction_with_float_sizes", # np.array
118+
"test_two_d_array_reduction_reuse", # np.arange
119+
"test_parfor_slice21", # unsupported reshape
120+
"test_parfor_array_access_lower_slice", # np.arange
121+
"test_size_assertion", # AssertionError not raised
122+
"test_parfor_slice18", # np.arange
123+
"test_simple12", # complex128
124+
"test_parfor_slice2", # AssertionError not raised
125+
"test_parfor_slice6", # array.transpose
126+
"test_parfor_slice22", # slice using array
127+
"test_simple13", # complex128
128+
"test_parfor_bitmask1", # setitem with mask
129+
"test_parfor_bitmask2", # setitem with mask
130+
"test_parfor_bitmask3", # setitem with mask
131+
"test_parfor_bitmask4", # setitem with mask
132+
"test_parfor_bitmask5", # setitem with mask
133+
"test_parfor_bitmask6", # setitem with mask
134+
"test_issue3169", # list support
135+
"test_issue3748", # unituple of literal dynamic getitem
136+
"test_issue5001", # list suport
137+
"test_issue5167", # np.full
138+
"test_issue6095_numpy_max", # operand #1 does not dominate this use
139+
"test_issue5065", # tuple unpack
140+
"test_no_state_change_in_gufunc_lowering_on_error", # custom pipeline
141+
"test_namedtuple3", # namedtuple
142+
"test_issue6102", # list support
143+
"test_oversized_tuple_as_arg_to_kernel", # UnsupportedParforsError not raised
144+
"test_issue5942_2", # invalid result
145+
"test_reshape_with_large_neg", # unsupported reshape
146+
"test_parfor_ufunc_typing", # np.isinf
147+
"test_issue_5098", # list support and more
148+
"test_parfor_slice27", # Literal return issue
149+
"test_ufunc_expr", # np.bitwise_and(
150+
"test_parfor_generate_fuse", # operand #0 does not dominate this use
151+
"test_parfor_slice7", # array.transpose
152+
"test_one_d_array_reduction", # np.array
153153
}
154154

155155
skip_tests = {}

numba_dpcomp/numba_dpcomp/mlir/tests/test_numpy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def _vectorize_reference(func, arg1):
8989
"lambda a: np.tanh(a)",
9090
"lambda a: np.abs(a)",
9191
"lambda a: np.absolute(a)",
92+
"lambda a: np.negative(a)",
9293
"lambda a: a.size",
9394
"lambda a: a.T",
9495
"lambda a: a.T.T",

0 commit comments

Comments
 (0)