|
17 | 17 | """Defines unit test cases for the SyclKernelBundle and SyclKernel classes""" |
18 | 18 |
|
19 | 19 | import os |
20 | | -import warnings |
21 | 20 |
|
22 | 21 | import numpy as np |
23 | 22 | import pytest |
24 | 23 |
|
25 | 24 | import dpctl |
26 | 25 | import dpctl.compiler as dpc |
27 | 26 | import dpctl.memory as dpm |
28 | | -import dpctl.program as dpp |
29 | 27 | from dpctl.compiler.utils import parse_spirv_specializations |
30 | 28 |
|
31 | 29 |
|
@@ -721,57 +719,3 @@ def test_sycl_source_vector_add_correctness(queue_selector): |
721 | 719 | ev4 = q.memcpy_async(dest=out, src=out_usm, count=out.nbytes, dEvents=[ev3]) |
722 | 720 | ev4.wait() |
723 | 721 | 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