Add dpctl.SyclQueue.memset() method - #2361
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2361/index.html |
|
@ndgrigorian I implemented |
| host = bytearray(nbytes) | ||
| q.memcpy(host, mobj, nbytes) | ||
| return bytes(host) | ||
|
|
There was a problem hiding this comment.
The docstring promises val is interpreted as unsigned char (LSB only), but nothing verifies e.g. memset(mem, 0x1FF) fills 0xFF or -1 fills 0xFF. There is no error case to test here (values truncate, not reject).
There was a problem hiding this comment.
This case is already covered by test_memset_value_truncated_to_byte (negatives and overflow)
https://github.com/IntelPython/dpctl/pull/2361/changes#diff-8cf72656d339e0f446c2227869696dee611bdce0bc37434f62419482dc4cd075R192
ndgrigorian
left a comment
There was a problem hiding this comment.
LGTM, thank you @vlad-perevezentsev
This PR proposes adding
dpctl.SyclQueue.memsetanddpctl.SyclQueue.memset_asyncmethods as a Python wrapper oversycl::queue::memsetbacked by the existingDPCTLQueue_Memsetand a newDPCTLQueue_MemsetWithEventsC-API function and adding a newtest_sycl_queue_memset.py