We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 194dee2 commit c980270Copy full SHA for c980270
dpctl/tensor/_usmarray.pyx
@@ -586,10 +586,8 @@ cdef class usm_ndarray:
586
return _flags.Flags(self, self.flags_)
587
588
cdef _set_writable_flag(self, int flag):
589
- cdef int arr_fl = self.flags_
590
- arr_fl ^= (arr_fl & USM_ARRAY_WRITABLE) # unset WRITABLE flag
591
- arr_fl |= (USM_ARRAY_WRITABLE if flag else 0)
592
- self.flags_ = arr_fl
+ cdef int mask = (USM_ARRAY_WRITABLE if flag else 0)
+ self.flags_ = _copy_writable(self.flags_, mask)
593
594
@property
595
def usm_type(self):
0 commit comments