Skip to content

Commit 0bae6a8

Browse files
Merge pull request #2365 from IntelPython/add_sycl_queue_fill
Add `dpctl.SyclQueue.fill()` method
2 parents 01129f1 + 8df0715 commit 0bae6a8

8 files changed

Lines changed: 1209 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
* Added `create_kernel_bundle_from_sycl_source`, `is_sycl_source_compilation_available`, and `dpctl.SyclDevice.can_compile` for supporting the creation of `dpctl.SyclKernelBundle`s from SYCL source strings via DPC++ extension, as well as corresponding C-API functions to support it [gh-2206](https://github.com/IntelPython/dpctl/pull/2206)
1414
* Added `dpctl.SyclQueue.memset` and `dpctl.SyclQueue.memset_async` methods [gh-2361](https://github.com/IntelPython/dpctl/pull/2361)
1515
* Added `DPCTLQueue_MemsetWithEvents` C-API function to support `dpctl.SyclQueue.memset_async` [gh-2361](https://github.com/IntelPython/dpctl/pull/2361)
16+
* Added `dpctl.SyclQueue.fill` and `dpctl.SyclQueue.fill_async` methods [gh-2365](https://github.com/IntelPython/dpctl/pull/2365)
17+
* Added `DPCTLQueue_Fill8/16/32/64/128WithEvents` C-API functions to support `dpctl.SyclQueue.fill_async` [gh-2365](https://github.com/IntelPython/dpctl/pull/2365)
1618

1719
### Changed
1820
* Bump minimum NumPy version to 1.26 [gh-2192](https://github.com/IntelPython/dpctl/pull/2192)

dpctl/_backend.pxd

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
types defined by dpctl's C API.
2222
"""
2323

24-
from libc.stdint cimport int64_t, uint8_t, uint32_t, uint64_t
24+
from libc.stdint cimport int64_t, uint8_t, uint16_t, uint32_t, uint64_t
2525
from libcpp cimport bool
2626

2727

@@ -674,6 +674,66 @@ cdef extern from "syclinterface/dpctl_sycl_queue_interface.h":
674674
size_t Count,
675675
const DPCTLSyclEventRef *depEvents,
676676
size_t depEventsCount)
677+
cdef DPCTLSyclEventRef DPCTLQueue_Fill8(
678+
const DPCTLSyclQueueRef Q,
679+
void *Dest,
680+
uint8_t Val,
681+
size_t Count)
682+
cdef DPCTLSyclEventRef DPCTLQueue_Fill8WithEvents(
683+
const DPCTLSyclQueueRef Q,
684+
void *Dest,
685+
uint8_t Val,
686+
size_t Count,
687+
const DPCTLSyclEventRef *depEvents,
688+
size_t depEventsCount)
689+
cdef DPCTLSyclEventRef DPCTLQueue_Fill16(
690+
const DPCTLSyclQueueRef Q,
691+
void *Dest,
692+
uint16_t Val,
693+
size_t Count)
694+
cdef DPCTLSyclEventRef DPCTLQueue_Fill16WithEvents(
695+
const DPCTLSyclQueueRef Q,
696+
void *Dest,
697+
uint16_t Val,
698+
size_t Count,
699+
const DPCTLSyclEventRef *depEvents,
700+
size_t depEventsCount)
701+
cdef DPCTLSyclEventRef DPCTLQueue_Fill32(
702+
const DPCTLSyclQueueRef Q,
703+
void *Dest,
704+
uint32_t Val,
705+
size_t Count)
706+
cdef DPCTLSyclEventRef DPCTLQueue_Fill32WithEvents(
707+
const DPCTLSyclQueueRef Q,
708+
void *Dest,
709+
uint32_t Val,
710+
size_t Count,
711+
const DPCTLSyclEventRef *depEvents,
712+
size_t depEventsCount)
713+
cdef DPCTLSyclEventRef DPCTLQueue_Fill64(
714+
const DPCTLSyclQueueRef Q,
715+
void *Dest,
716+
uint64_t Val,
717+
size_t Count)
718+
cdef DPCTLSyclEventRef DPCTLQueue_Fill64WithEvents(
719+
const DPCTLSyclQueueRef Q,
720+
void *Dest,
721+
uint64_t Val,
722+
size_t Count,
723+
const DPCTLSyclEventRef *depEvents,
724+
size_t depEventsCount)
725+
cdef DPCTLSyclEventRef DPCTLQueue_Fill128(
726+
const DPCTLSyclQueueRef Q,
727+
void *Dest,
728+
uint64_t *Val,
729+
size_t Count)
730+
cdef DPCTLSyclEventRef DPCTLQueue_Fill128WithEvents(
731+
const DPCTLSyclQueueRef Q,
732+
void *Dest,
733+
uint64_t *Val,
734+
size_t Count,
735+
const DPCTLSyclEventRef *depEvents,
736+
size_t depEventsCount)
677737
cdef DPCTLSyclEventRef DPCTLQueue_Memset(
678738
const DPCTLSyclQueueRef Q,
679739
void *Dest,

dpctl/_sycl_queue.pxd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ cdef public api class SyclQueue (_SyclQueue) [
107107
cpdef SyclEvent copy_async(
108108
self, dest, src, size_t count, list dEvents=*, str dtype=*
109109
)
110+
cpdef fill(self, dest, value, size_t count, str dtype=*)
111+
cpdef SyclEvent fill_async(
112+
self, dest, value, size_t count, list dEvents=*, str dtype=*
113+
)
110114
cpdef memset(self, mem, int val, size_t count=*)
111115
cpdef SyclEvent memset_async(
112116
self, mem, int val, size_t count=*, list dEvents=*

0 commit comments

Comments
 (0)