Skip to content

Commit 8ebbac1

Browse files
Merge remote-tracking branch 'origin/master' into feature/pyproject
This should resolve build breakage with DPC++ compiler open source nighly build sycl bundle.
2 parents b043ab9 + b24c5b0 commit 8ebbac1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1704
-709
lines changed

.github/workflows/conda-package.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Add conda to system path
4545
run: echo $CONDA/bin >> $GITHUB_PATH
4646
- name: Install conda-build
47-
run: conda install conda-build
47+
run: conda install conda-build -c conda-forge --override-channels
4848
- name: Store conda paths as envs
4949
shell: bash -l {0}
5050
run: |
@@ -140,9 +140,9 @@ jobs:
140140
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
141141
- name: Add conda to system path
142142
run: echo $CONDA/bin >> $GITHUB_PATH
143-
- name: Install conda-build
143+
- name: Install conda-index
144144
# Needed to be able to run conda index
145-
run: conda install conda-build
145+
run: conda install conda-index -c conda-forge --override-channels
146146
- name: Create conda channel
147147
run: |
148148
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
@@ -352,7 +352,7 @@ jobs:
352352
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
353353

354354
- name: Install anaconda-client
355-
run: conda install anaconda-client
355+
run: conda install anaconda-client -c conda-forge --override-channels
356356
- name: Add conda to system path
357357
run: echo $CONDA/bin >> $GITHUB_PATH
358358
- name: Package version
@@ -393,7 +393,7 @@ jobs:
393393
activate-environment: ""
394394

395395
- name: Install anaconda-client
396-
run: conda install anaconda-client
396+
run: conda install anaconda-client -c conda-forge --override-channels
397397

398398
- name: Package version
399399
shell: bash -el {0}
@@ -425,9 +425,9 @@ jobs:
425425
BUILD_ENV_NAME: build_env
426426

427427
steps:
428-
- name: Install conda-build
428+
- name: Install conda-index
429429
# Needed to be able to run conda index
430-
run: conda install conda-build python=${{ matrix.python }}
430+
run: conda install conda-index -c conda-forge --override-channels
431431
- name: Checkout dpctl repo
432432
uses: actions/[email protected]
433433
with:
@@ -450,7 +450,9 @@ jobs:
450450
- name: Collect dependencies
451451
run: |
452452
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
453-
conda install $PACKAGE_NAME python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
453+
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
454+
conda create -n ${{ env.EXAMPLES_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
455+
cat lockfile
454456
- name: Set pkgs_dirs
455457
run: |
456458
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
@@ -468,7 +470,7 @@ jobs:
468470
- name: Install example requirements
469471
shell: bash -l {0}
470472
env:
471-
DPCPP_CMPLR: dpcpp_linux-64">=2024.0"
473+
DPCPP_CMPLR: dpcpp_linux-64">=2024.1"
472474
run: |
473475
CHANNELS="${{ env.CHANNELS }}"
474476
. $CONDA/etc/profile.d/conda.sh
@@ -601,9 +603,9 @@ jobs:
601603
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
602604
- name: Add conda to system path
603605
run: echo $CONDA/bin >> $GITHUB_PATH
604-
- name: Install conda-build
606+
- name: Install conda-index
605607
# Needed to be able to run conda index
606-
run: conda install conda-build
608+
run: conda install conda-index -c conda-forge --override-channels
607609
- name: Create conda channel
608610
run: |
609611
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
@@ -712,7 +714,7 @@ jobs:
712714
python-version: '3.11'
713715

714716
- name: Install anaconda-client
715-
run: conda install anaconda-client
717+
run: conda install anaconda-client -c conda-forge --override-channels
716718

717719
- name: Checkout repo
718720
uses: actions/[email protected]

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
71+
uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
7272
with:
7373
sarif_file: results.sarif

docs/doc_sources/api_reference/dpctl_capi.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,16 @@ API for :c:struct:`Py_MemoryObject`
152152
:param nbytes: The size of allocation in bytes
153153
:param QRef: instance of :c:struct:`PySyclQueueRef` corresponding
154154
to ``sycl::queue`` to be associated with this allocation
155-
:param owner: Python object instance whose deleter triggers freeing of this USM allocation
155+
:param owner: Python object instance whose deleter triggers freeing of this USM allocation. Specify `owner=None`
156+
to pass ownership to created Python memory object, which will use ``sycl::free(ptr, sycl_queue)`` for
157+
deallocation.
158+
159+
.. c:function:: void * Memory_GetOpaquePointer(struct Py_MemoryObject *o)
160+
161+
:param o: Input object
162+
:returns: Returns opaque pointer to `std::shared_ptr<void>` which manages the USM allocation,
163+
or a `nullptr` if the USM allocation represented by `o` is not managed by the smart
164+
pointer.
156165
157166
API for :c:struct:`PyUSMArrayObject`
158167
------------------------------------
@@ -221,6 +230,11 @@ API for :c:struct:`PyUSMArrayObject`
221230
:returns: Offset of zero multi-index array element from the beginning of
222231
the USM allocation.
223232
233+
.. c:function:: PyObject * UsmNDArray_GetUSMData(struct PyUSMArrayObject *arr)
234+
235+
:param arr: Input object
236+
:returns: Python memory object underlying input array `arr`.
237+
224238
.. c:function:: void UsmNDArray_SetWritableFlag(struct PyUSMArrayObject *arr, int flag)
225239
226240
:param arr: Input object

dpctl/_sycl_queue.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ cdef DPCTLSyclEventRef _memcpy_impl(
342342
cdef unsigned char[::1] dst_host_buf = None
343343

344344
if isinstance(src, _Memory):
345-
c_src_ptr = <void*>(<_Memory>src).memory_ptr
345+
c_src_ptr = <void*>(<_Memory>src).get_data_ptr()
346346
elif _is_buffer(src):
347347
src_host_buf = src
348348
c_src_ptr = <void *>&src_host_buf[0]
@@ -354,7 +354,7 @@ cdef DPCTLSyclEventRef _memcpy_impl(
354354
)
355355

356356
if isinstance(dst, _Memory):
357-
c_dst_ptr = <void*>(<_Memory>dst).memory_ptr
357+
c_dst_ptr = <void*>(<_Memory>dst).get_data_ptr()
358358
elif _is_buffer(dst):
359359
dst_host_buf = dst
360360
c_dst_ptr = <void *>&dst_host_buf[0]
@@ -1265,7 +1265,7 @@ cdef class SyclQueue(_SyclQueue):
12651265
cdef DPCTLSyclEventRef ERef = NULL
12661266

12671267
if isinstance(mem, _Memory):
1268-
ptr = <void*>(<_Memory>mem).memory_ptr
1268+
ptr = <void*>(<_Memory>mem).get_data_ptr()
12691269
else:
12701270
raise TypeError("Parameter `mem` should have type _Memory")
12711271

@@ -1285,7 +1285,7 @@ cdef class SyclQueue(_SyclQueue):
12851285
cdef DPCTLSyclEventRef ERef = NULL
12861286

12871287
if isinstance(mem, _Memory):
1288-
ptr = <void*>(<_Memory>mem).memory_ptr
1288+
ptr = <void*>(<_Memory>mem).get_data_ptr()
12891289
else:
12901290
raise TypeError("Parameter `mem` should have type _Memory")
12911291

0 commit comments

Comments
 (0)