Skip to content

Commit 7685f44

Browse files
authored
Merge pull request #2407 from IntelPython/remove-deprecated-program-module
Remove deprecated `dpctl.program`
2 parents c349507 + 0b24116 commit 7685f44

11 files changed

Lines changed: 1 addition & 228 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Deprecated
1414

1515
### Removed
16+
* Removed the deprecated `dpctl.program` submodule, use `dpctl.compiler` instead [gh-2407](https://github.com/IntelPython/dpctl/pull/2407)
1617

1718
### Fixed
1819
* Removed stale `select_host_device` and `has_host_device` names from `dpctl.__all__`, which made `from dpctl import *` fail with `AttributeError` [gh-2410](https://github.com/IntelPython/dpctl/pull/2410)

‎docs/_legacy/generate_rst.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"dpctl.tensor._reshape": "Array Manipulation",
4848
"dpctl.tensor._manipulation_functions": "Array Manipulation",
4949
"dpctl.memory._memory": "Functions",
50-
"dpctl.program._program": "Functions",
5150
"dpctl.utils._compute_follows_data": "Functions",
5251
}
5352

‎docs/doc_sources/api_reference/dpctl/index.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
- Unified Shared Memory operations
1717
* - :py:mod:`dpctl.compiler`
1818
- Support for working with SYCL kernels
19-
* - :py:mod:`dpctl.program`
20-
- (deprecated, use :py:mod:`dpctl.compiler`)
2119
* - :py:mod:`dpctl.utils`
2220
- A collection of utility functions
2321

‎docs/doc_sources/api_reference/dpctl/program.rst‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎docs/doc_sources/api_reference/index.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ The package ``dpctl`` provides
1010
- :ref:`API objects <dpctl_pyapi>` in :py:mod:`dpctl` namespace
1111
- :ref:`API objects <dpctl_memory_pyapi>` in :py:mod:`dpctl.memory` namespace
1212
- :ref:`API objects <dpctl_compiler_pyapi>` in :py:mod:`dpctl.compiler` namespace
13-
- :ref:`API objects <dpctl_program_pyapi>` in :py:mod:`dpctl.program` namespace (deprecated, use :py:mod:`dpctl.compiler`)
1413
- :ref:`API objects <dpctl_utils_pyapi>` in :py:mod:`dpctl.utils` namespace
1514
* Python C API
1615
- :ref:`C API <dpctl_capi>` for working with Python classes defined in :mod:`dpctl`
@@ -33,7 +32,6 @@ The package ``dpctl`` provides
3332
dpctl/index
3433
dpctl/memory
3534
dpctl/compiler
36-
dpctl/program
3735
dpctl/utils
3836
libsyclinterface/index
3937
dpctl_capi

‎docs/doc_sources/known_words.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ SyclContext
6060
SyclEvent
6161
SyclKernel
6262
SyclKernelBundle
63-
SyclProgram
6463
SyclPlatform
6564
dtype
6665
ndarray

‎dpctl/__init__.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
__all__ += [
135135
"memory",
136136
"compiler",
137-
"program",
138137
"utils",
139138
]
140139

‎dpctl/program/__init__.py‎

Lines changed: 0 additions & 74 deletions
This file was deleted.

‎dpctl/program/_program.py‎

Lines changed: 0 additions & 60 deletions
This file was deleted.

‎dpctl/tests/test_sycl_compiler.py‎

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
"""Defines unit test cases for the SyclKernelBundle and SyclKernel classes"""
1818

1919
import os
20-
import warnings
2120

2221
import numpy as np
2322
import pytest
2423

2524
import dpctl
2625
import dpctl.compiler as dpc
2726
import dpctl.memory as dpm
28-
import dpctl.program as dpp
2927
from dpctl.compiler.utils import parse_spirv_specializations
3028

3129

@@ -721,57 +719,3 @@ def test_sycl_source_vector_add_correctness(queue_selector):
721719
ev4 = q.memcpy_async(dest=out, src=out_usm, count=out.nbytes, dEvents=[ev3])
722720
ev4.wait()
723721
assert np.array_equal(out, expected)
724-
725-
726-
@pytest.mark.parametrize(
727-
"deprecated_name, replacement",
728-
[
729-
("SyclProgram", dpc.SyclKernelBundle),
730-
("SyclProgramCompilationError", dpc.SyclKernelBundleCompilationError),
731-
],
732-
)
733-
def test_program_deprecated_aliases(deprecated_name, replacement):
734-
with pytest.warns(DeprecationWarning, match=deprecated_name):
735-
alias = getattr(dpp, deprecated_name)
736-
737-
assert alias is replacement
738-
739-
740-
def test_program_all_names_are_reachable():
741-
with warnings.catch_warnings():
742-
warnings.simplefilter("ignore", DeprecationWarning)
743-
for name in dpp.__all__:
744-
assert getattr(dpp, name) is not None
745-
746-
747-
def test_create_program_from_source_is_deprecated():
748-
q = _get_opencl_queue_or_skip()
749-
oclSrc = " \
750-
kernel void add(global int* a, global int* b, global int* c) { \
751-
size_t index = get_global_id(0); \
752-
c[index] = a[index] + b[index]; \
753-
}"
754-
with pytest.warns(
755-
DeprecationWarning, match="create_program_from_source is deprecated"
756-
):
757-
kb = dpp.create_program_from_source(q, oclSrc)
758-
759-
assert type(kb) is dpc.SyclKernelBundle
760-
assert kb.has_sycl_kernel("add")
761-
762-
763-
def test_create_program_from_spirv_is_deprecated():
764-
import dpctl.program as dpp
765-
766-
q = _get_opencl_queue_or_skip()
767-
spirv_file = get_spirv_abspath("multi_kernel.spv")
768-
with open(spirv_file, "rb") as fin:
769-
spirv = fin.read()
770-
with pytest.warns(
771-
DeprecationWarning, match="create_program_from_spirv is deprecated"
772-
):
773-
kb = dpp.create_program_from_spirv(q, spirv)
774-
775-
assert type(kb) is dpc.SyclKernelBundle
776-
assert kb.has_sycl_kernel("add")
777-
assert kb.has_sycl_kernel("axpy")

0 commit comments

Comments
 (0)