From 8a4076d7644e98f9f57f91016e1ed2c7b3e8a19d Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 2 Nov 2026 10:18:04 -0800 Subject: [PATCH 1/2] Remove deprecated dpctl.program module --- docs/_legacy/generate_rst.py | 1 - .../doc_sources/api_reference/dpctl/index.rst | 2 - .../api_reference/dpctl/program.rst | 30 -------- docs/doc_sources/api_reference/index.rst | 2 - docs/doc_sources/known_words.txt | 1 - dpctl/__init__.py | 1 - dpctl/program/__init__.py | 74 ------------------- dpctl/program/_program.py | 60 --------------- dpctl/tests/test_sycl_compiler.py | 56 -------------- setup.py | 1 - 10 files changed, 228 deletions(-) delete mode 100644 docs/doc_sources/api_reference/dpctl/program.rst delete mode 100644 dpctl/program/__init__.py delete mode 100644 dpctl/program/_program.py diff --git a/docs/_legacy/generate_rst.py b/docs/_legacy/generate_rst.py index aa147471ff..9e97dedf0a 100644 --- a/docs/_legacy/generate_rst.py +++ b/docs/_legacy/generate_rst.py @@ -47,7 +47,6 @@ "dpctl.tensor._reshape": "Array Manipulation", "dpctl.tensor._manipulation_functions": "Array Manipulation", "dpctl.memory._memory": "Functions", - "dpctl.program._program": "Functions", "dpctl.utils._compute_follows_data": "Functions", } diff --git a/docs/doc_sources/api_reference/dpctl/index.rst b/docs/doc_sources/api_reference/dpctl/index.rst index aa84cb12b9..15e2bff4b0 100644 --- a/docs/doc_sources/api_reference/dpctl/index.rst +++ b/docs/doc_sources/api_reference/dpctl/index.rst @@ -16,8 +16,6 @@ - Unified Shared Memory operations * - :py:mod:`dpctl.compiler` - Support for working with SYCL kernels - * - :py:mod:`dpctl.program` - - (deprecated, use :py:mod:`dpctl.compiler`) * - :py:mod:`dpctl.utils` - A collection of utility functions diff --git a/docs/doc_sources/api_reference/dpctl/program.rst b/docs/doc_sources/api_reference/dpctl/program.rst deleted file mode 100644 index 88e096a69d..0000000000 --- a/docs/doc_sources/api_reference/dpctl/program.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. _dpctl_program_pyapi: - -:py:mod:`dpctl.program` (deprecated) -===================================== - -.. deprecated:: - :py:mod:`dpctl.program` is deprecated. Use :py:mod:`dpctl.compiler` instead. - -:py:mod:`dpctl.program` provides a way to create a SYCL kernel -from an OpenCL* program source code represented as a string, SYCL -source code represented as a string, or a SPIR-V binary file. - -It implements creation of interoperability -``sycl::kernel_bundle`` (a collection of kernels), -as well as creation of individual ``sycl::kernel``, suitable for submission for -execution via :py:meth:`dpctl.SyclQueue.submit`. - -.. py:module:: dpctl.program - -.. currentmodule:: dpctl.program - -.. autosummary:: - :toctree: generated - :nosignatures: - - create_program_from_source - create_program_from_spirv - SyclKernel - SyclProgram - SyclProgramCompilationError diff --git a/docs/doc_sources/api_reference/index.rst b/docs/doc_sources/api_reference/index.rst index fbe3b1da63..c4d20d7c8d 100644 --- a/docs/doc_sources/api_reference/index.rst +++ b/docs/doc_sources/api_reference/index.rst @@ -10,7 +10,6 @@ The package ``dpctl`` provides - :ref:`API objects ` in :py:mod:`dpctl` namespace - :ref:`API objects ` in :py:mod:`dpctl.memory` namespace - :ref:`API objects ` in :py:mod:`dpctl.compiler` namespace - - :ref:`API objects ` in :py:mod:`dpctl.program` namespace (deprecated, use :py:mod:`dpctl.compiler`) - :ref:`API objects ` in :py:mod:`dpctl.utils` namespace * Python C API - :ref:`C API ` for working with Python classes defined in :mod:`dpctl` @@ -33,7 +32,6 @@ The package ``dpctl`` provides dpctl/index dpctl/memory dpctl/compiler - dpctl/program dpctl/utils libsyclinterface/index dpctl_capi diff --git a/docs/doc_sources/known_words.txt b/docs/doc_sources/known_words.txt index b68a926685..2bc2390ffa 100644 --- a/docs/doc_sources/known_words.txt +++ b/docs/doc_sources/known_words.txt @@ -60,7 +60,6 @@ SyclContext SyclEvent SyclKernel SyclKernelBundle -SyclProgram SyclPlatform dtype ndarray diff --git a/dpctl/__init__.py b/dpctl/__init__.py index 11c4a3281f..1b6587e4a1 100644 --- a/dpctl/__init__.py +++ b/dpctl/__init__.py @@ -136,7 +136,6 @@ __all__ += [ "memory", "compiler", - "program", "utils", ] diff --git a/dpctl/program/__init__.py b/dpctl/program/__init__.py deleted file mode 100644 index bfd6c2aa1d..0000000000 --- a/dpctl/program/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -# Data Parallel Control (dpctl) -# -# Copyright 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -**Data Parallel Control Program** (deprecated) provides a way to create a SYCL -kernel from either an OpenCL program represented as a string or a SPIR-V binary -file. - -.. deprecated:: - The dpctl.program module is deprecated. Use dpctl.compiler instead. - -""" - -import warnings - -from dpctl.compiler import ( - SyclKernel, - SyclKernelBundle, - SyclKernelBundleCompilationError, -) -from dpctl.program._program import ( - create_program_from_source, - create_program_from_spirv, -) - -__all__ = [ - "create_program_from_source", - "create_program_from_spirv", - "SyclKernel", - "SyclProgram", - "SyclProgramCompilationError", -] - - -warnings.warn( - "dpctl.program is deprecated and will be removed in a future release. " - "Use dpctl.compiler instead.", - DeprecationWarning, - stacklevel=2, -) - - -def __getattr__(name): - if name == "SyclProgram": - warnings.warn( - "dpctl.program.SyclProgram is deprecated and will be removed in a " - "future release. Use dpctl.compiler.SyclKernelBundle instead.", - DeprecationWarning, - stacklevel=2, - ) - return SyclKernelBundle - if name == "SyclProgramCompilationError": - warnings.warn( - "dpctl.program.SyclProgramCompilationError is deprecated and will " - "be removed in a future release. Use " - "dpctl.compiler.SyclKernelBundleCompilationError instead.", - DeprecationWarning, - stacklevel=2, - ) - return SyclKernelBundleCompilationError - raise AttributeError(f"module {__name__} has no attribute {name}") diff --git a/dpctl/program/_program.py b/dpctl/program/_program.py deleted file mode 100644 index 8d524ed1f5..0000000000 --- a/dpctl/program/_program.py +++ /dev/null @@ -1,60 +0,0 @@ -# Data Parallel Control (dpctl) -# -# Copyright 2020-2025 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Deprecated wrapper functions for backward compatibility.""" - -import warnings - -from dpctl.compiler import ( - SyclKernel, - create_kernel_bundle_from_source, - create_kernel_bundle_from_spirv, -) - - -def create_program_from_source(q, src, copts=""): - """This function is a deprecated alias for - :func:`dpctl.compiler.create_kernel_bundle_from_source`. - New code should use :func:`dpctl.compiler.create_kernel_bundle_from_source`. - """ - warnings.warn( - "create_program_from_source is deprecated and will be removed in a " - "future release. Use create_kernel_bundle_from_source instead.", - DeprecationWarning, - stacklevel=2, - ) - return create_kernel_bundle_from_source(q, src, copts) - - -def create_program_from_spirv(q, IL, copts=""): - """This function is a deprecated alias for - :func:`dpctl.compiler.create_kernel_bundle_from_spirv`. - New code should use :func:`dpctl.compiler.create_kernel_bundle_from_spirv`. - """ - warnings.warn( - "create_program_from_spirv is deprecated and will be removed in a " - "future release. Use create_kernel_bundle_from_spirv instead.", - DeprecationWarning, - stacklevel=2, - ) - return create_kernel_bundle_from_spirv(q, IL, copts) - - -__all__ = [ - "create_program_from_source", - "create_program_from_spirv", - "SyclKernel", -] diff --git a/dpctl/tests/test_sycl_compiler.py b/dpctl/tests/test_sycl_compiler.py index 45775a3268..2b7896e868 100644 --- a/dpctl/tests/test_sycl_compiler.py +++ b/dpctl/tests/test_sycl_compiler.py @@ -17,7 +17,6 @@ """Defines unit test cases for the SyclKernelBundle and SyclKernel classes""" import os -import warnings import numpy as np import pytest @@ -25,7 +24,6 @@ import dpctl import dpctl.compiler as dpc import dpctl.memory as dpm -import dpctl.program as dpp from dpctl.compiler.utils import parse_spirv_specializations @@ -721,57 +719,3 @@ def test_sycl_source_vector_add_correctness(queue_selector): ev4 = q.memcpy_async(dest=out, src=out_usm, count=out.nbytes, dEvents=[ev3]) ev4.wait() assert np.array_equal(out, expected) - - -@pytest.mark.parametrize( - "deprecated_name, replacement", - [ - ("SyclProgram", dpc.SyclKernelBundle), - ("SyclProgramCompilationError", dpc.SyclKernelBundleCompilationError), - ], -) -def test_program_deprecated_aliases(deprecated_name, replacement): - with pytest.warns(DeprecationWarning, match=deprecated_name): - alias = getattr(dpp, deprecated_name) - - assert alias is replacement - - -def test_program_all_names_are_reachable(): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - for name in dpp.__all__: - assert getattr(dpp, name) is not None - - -def test_create_program_from_source_is_deprecated(): - q = _get_opencl_queue_or_skip() - oclSrc = " \ - kernel void add(global int* a, global int* b, global int* c) { \ - size_t index = get_global_id(0); \ - c[index] = a[index] + b[index]; \ - }" - with pytest.warns( - DeprecationWarning, match="create_program_from_source is deprecated" - ): - kb = dpp.create_program_from_source(q, oclSrc) - - assert type(kb) is dpc.SyclKernelBundle - assert kb.has_sycl_kernel("add") - - -def test_create_program_from_spirv_is_deprecated(): - import dpctl.program as dpp - - q = _get_opencl_queue_or_skip() - spirv_file = get_spirv_abspath("multi_kernel.spv") - with open(spirv_file, "rb") as fin: - spirv = fin.read() - with pytest.warns( - DeprecationWarning, match="create_program_from_spirv is deprecated" - ): - kb = dpp.create_program_from_spirv(q, spirv) - - assert type(kb) is dpc.SyclKernelBundle - assert kb.has_sycl_kernel("add") - assert kb.has_sycl_kernel("axpy") diff --git a/setup.py b/setup.py index d4c9987b1d..f2244a6152 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ "dpctl.compiler", "dpctl.compiler.utils", "dpctl.memory", - "dpctl.program", "dpctl.utils", ], package_data={ From 0b24116e300141864b6eede174eb21daff9e1d9e Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 2 Nov 2026 10:19:45 -0800 Subject: [PATCH 2/2] Add gh-2407 to the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc5c4bf8a..51829dd520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated ### Removed +* Removed the deprecated `dpctl.program` submodule, use `dpctl.compiler` instead [gh-2407](https://github.com/IntelPython/dpctl/pull/2407) ### Fixed