IntelPython / dpctl

Python SYCL bindings and SYCL-based Python Array API library
https://intelpython.github.io/dpctl/
Apache License 2.0
97 stars 29 forks source link

Disable vectorized `bitwise_invert` for boolean inputs #1681

Closed ndgrigorian closed 1 month ago

ndgrigorian commented 1 month ago

This PR proposes removing the sycl::vec overload of bitwise_invert for boolean inputs to fix unexpected behaviors.

Vectorized bitwise_invert on boolean inputs would corrupt the data in a subtle way. When casting this data to an integer data type, 255 would always be the result of casting true. This is likely related to operator! on sycl::vec returning -1 for true and expecting the output type to be a signed integer type.

github-actions[bot] commented 1 month ago

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. :crossed_fingers:

github-actions[bot] commented 1 month ago

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_359 ran successfully. Passed: 889 Failed: 16 Skipped: 91

coveralls commented 1 month ago

Coverage Status

coverage: 87.951%. remained the same when pulling c6404ee9fe48d3f6e09629df2766eb33565305f5 on fix-bitwise-invert-on-boolean-inputs into c994666251c564f544c976be1dba72033941d543 on master.

github-actions[bot] commented 1 month ago

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_360 ran successfully. Passed: 888 Failed: 17 Skipped: 91