diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index 20a8a44579..6d2f7cc339 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -96,11 +96,17 @@ jobs: - name: Upload coverage data to coveralls.io shell: bash -l {0} run: | + echo "Processing c-api-coverage" + export DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov) + grep "/tmp" $DPCTL_LCOV_FN coveralls-lcov -v -n \ - $(find _skbuild -name dpctl.lcov) > dpctl-c-api-coverage.json + $DPCTL_LCOV_FN > dpctl-c-api-coverage.json + echo "Processing pytest-coverage" + export DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov) + grep "/tmp" $DPCTL_PYTEST_LCOV coveralls-lcov -v -n \ - $(find . -name dpctl_pytest.lcov) > pytest-dpctl-c-api-coverage.json - # merge json files + $DPCTL_PYTEST_LCOV > pytest-dpctl-c-api-coverage.json + echo "Merging JSON files" python -c "import json; \ fh1 = open('dpctl-c-api-coverage.json', 'r'); \ f1 = json.load(fh1); fh1.close(); \ @@ -113,6 +119,7 @@ jobs: ls -lh dpctl-c-api-coverage.json pytest-dpctl-c-api-coverage.json \ combined-dpctl-c-api-coverage.json \ $(find _skbuild -name dpctl.lcov) $(find . -name dpctl_pytest.lcov) + echo "Merging combined files with coverage data" coveralls --service=github --merge=combined-dpctl-c-api-coverage.json env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index bf52935f89..434077f1cc 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -63,7 +63,7 @@ jobs: source /opt/intel/oneapi/setvars.sh wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.2/doxyrest-2.1.2-linux-amd64.tar.xz tar xf doxyrest-2.1.2-linux-amd64.tar.xz - python setup.py develop -G Ninja --build-type=Debug \ + python setup.py develop -G Ninja --build-type=Release \ -- \ -DCMAKE_C_COMPILER:PATH=$(which icx) \ -DCMAKE_CXX_COMPILER:PATH=$(which icpx) \ diff --git a/CHANGELOG.md b/CHANGELOG.md index ba418bce4b..cdb9460cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* Added `dpctl.program.SyclKernel.max_sub_group_size` property [#1208](https://github.com/IntelPython/dpctl/pull/1028). + ### Changed +* Removed `dpctl.select_host_device`, `dpctl.has_host_device`, `dpctl.SyclDevice.is_host`, and `dpctl.SyclDevice.has_aspect_host` since support for host device has been removed in DPC++ 2023 and from SYCL 2020 spec [#1208](https://github.com/IntelPython/dpctl/pull/1028). + ### Fixed diff --git a/dpctl/CMakeLists.txt b/dpctl/CMakeLists.txt index 2a4e829a83..596eb55651 100644 --- a/dpctl/CMakeLists.txt +++ b/dpctl/CMakeLists.txt @@ -18,10 +18,10 @@ if(WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox ${WARNING_FLAGS}") set(CMAKE_C_FLAGS_DEBUG - "${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -ggdb3 -DDEBUG" + "${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG" ) set(CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -ggdb3 -DDEBUG" + "${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG" ) set(DPCTL_LDFLAGS "/link /NXCompat /DynamicBase") elseif(UNIX) @@ -57,10 +57,10 @@ elseif(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 ${CFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 ${CXXFLAGS}") set(CMAKE_C_FLAGS_DEBUG - "${CMAKE_C_FLAGS_DEBUG} ${CFLAGS} -O0 -ggdb3 -DDEBUG" + "${CMAKE_C_FLAGS_DEBUG} ${CFLAGS} -O0 -g1 -DDEBUG" ) set(CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG} ${CXXFLAGS} -O0 -ggdb3 -DDEBUG" + "${CMAKE_CXX_FLAGS_DEBUG} ${CXXFLAGS} -O0 -g1 -DDEBUG" ) set(DPCTL_LDFLAGS "-z,noexecstack,-z,relro,-z,now") else() diff --git a/dpctl/__init__.py b/dpctl/__init__.py index bd92b505f3..3784e6006d 100644 --- a/dpctl/__init__.py +++ b/dpctl/__init__.py @@ -48,12 +48,10 @@ has_accelerator_devices, has_cpu_devices, has_gpu_devices, - has_host_device, select_accelerator_device, select_cpu_device, select_default_device, select_gpu_device, - select_host_device, ) from ._sycl_event import SyclEvent from ._sycl_platform import SyclPlatform, get_platforms, lsplatform diff --git a/dpctl/_backend.pxd b/dpctl/_backend.pxd index b0c60078c4..42406d8b9d 100644 --- a/dpctl/_backend.pxd +++ b/dpctl/_backend.pxd @@ -37,7 +37,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h": ctypedef enum _backend_type 'DPCTLSyclBackendType': _ALL_BACKENDS 'DPCTL_ALL_BACKENDS' _CUDA 'DPCTL_CUDA' - _HOST 'DPCTL_HOST' _LEVEL_ZERO 'DPCTL_LEVEL_ZERO' _OPENCL 'DPCTL_OPENCL' _UNKNOWN_BACKEND 'DPCTL_UNKNOWN_BACKEND' @@ -49,7 +48,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h": _CPU 'DPCTL_CPU' _CUSTOM 'DPCTL_CUSTOM' _GPU 'DPCTL_GPU' - _HOST_DEVICE 'DPCTL_HOST_DEVICE' _UNKNOWN_DEVICE 'DPCTL_UNKNOWN_DEVICE' ctypedef enum _arg_data_type 'DPCTLKernelArgType': @@ -174,7 +172,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h": cdef bool DPCTLDevice_IsAccelerator(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef) - cdef bool DPCTLDevice_IsHost(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_GetSubGroupIndependentForwardProgress(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetPreferredVectorWidthChar(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetPreferredVectorWidthShort(const DPCTLSyclDeviceRef DRef) @@ -236,7 +233,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_selector_interface.h": DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create() DPCTLSyclDeviceSelectorRef DPCTLFilterSelector_Create(const char *) DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create() - DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create() void DPCTLDeviceSelector_Delete(DPCTLSyclDeviceSelectorRef) int DPCTLDeviceSelector_Score(DPCTLSyclDeviceSelectorRef, DPCTLSyclDeviceRef) @@ -271,8 +267,7 @@ cdef extern from "syclinterface/dpctl_sycl_kernel_interface.h": cdef size_t DPCTLKernel_GetPreferredWorkGroupSizeMultiple(const DPCTLSyclKernelRef KRef) cdef size_t DPCTLKernel_GetPrivateMemSize(const DPCTLSyclKernelRef KRef) cdef uint32_t DPCTLKernel_GetMaxNumSubGroups(const DPCTLSyclKernelRef KRef) -## Next line is commented out due to issue in DPC++ runtime -# cdef uint32_t DPCTLKernel_GetMaxSubGroupSize(const DPCTLSyclKernelRef KRef) + cdef uint32_t DPCTLKernel_GetMaxSubGroupSize(const DPCTLSyclKernelRef KRef) cdef uint32_t DPCTLKernel_GetCompileNumSubGroups(const DPCTLSyclKernelRef KRef) cdef uint32_t DPCTLKernel_GetCompileSubGroupSize(const DPCTLSyclKernelRef KRef) diff --git a/dpctl/_sycl_device.pyx b/dpctl/_sycl_device.pyx index e139197b18..76d9e99acc 100644 --- a/dpctl/_sycl_device.pyx +++ b/dpctl/_sycl_device.pyx @@ -73,7 +73,6 @@ from ._backend cimport ( # noqa: E211 DPCTLDevice_IsAccelerator, DPCTLDevice_IsCPU, DPCTLDevice_IsGPU, - DPCTLDevice_IsHost, DPCTLDeviceMgr_GetDeviceInfoStr, DPCTLDeviceMgr_GetDevices, DPCTLDeviceMgr_GetPositionInDevices, @@ -162,8 +161,6 @@ cdef list _get_devices(DPCTLDeviceVectorRef DVRef): cdef str _backend_type_to_filter_string_part(_backend_type BTy): if BTy == _backend_type._CUDA: return "cuda" - elif BTy == _backend_type._HOST: - return "host" elif BTy == _backend_type._LEVEL_ZERO: return "level_zero" elif BTy == _backend_type._OPENCL: @@ -181,8 +178,6 @@ cdef str _device_type_to_filter_string_part(_device_type DTy): return "cpu" elif DTy == _device_type._GPU: return "gpu" - elif DTy == _device_type._HOST_DEVICE: - return "host" else: return "unknown" @@ -222,7 +217,6 @@ cdef class SyclDevice(_SyclDevice): :func:`dpctl.select_cpu_device()`, :func:`dpctl.select_default_device()`, :func:`dpctl.select_gpu_device()`, - :func:`dpctl.select_host_device()`. :Example: @@ -359,8 +353,6 @@ cdef class SyclDevice(_SyclDevice): ) if BTy == _backend_type._CUDA: return backend_type.cuda - elif BTy == _backend_type._HOST: - return backend_type.host elif BTy == _backend_type._LEVEL_ZERO: return backend_type.level_zero elif BTy == _backend_type._OPENCL: @@ -388,21 +380,9 @@ cdef class SyclDevice(_SyclDevice): return device_type.cpu elif DTy == _device_type._GPU: return device_type.gpu - elif DTy == _device_type._HOST_DEVICE: - return device_type.host else: raise ValueError("Unknown device type.") - @property - def has_aspect_host(self): - """ Returns True if this device is a host device, False otherwise. - - Returns: - bool: Indicates if the device is a host device. - """ - cdef _aspect_type AT = _aspect_type._host - return DPCTLDevice_HasAspect(self._device_ref, AT) - @property def has_aspect_cpu(self): """ Returns True if this device is a CPU device, False otherwise. @@ -729,15 +709,6 @@ cdef class SyclDevice(_SyclDevice): """ return DPCTLDevice_IsGPU(self._device_ref) - @property - def is_host(self): - """ Returns True if the SyclDevice instance is a SYCL host device. - - Returns: - bool: True if the SyclDevice is a SYCL host device, else False. - """ - return DPCTLDevice_IsHost(self._device_ref) - @property def max_work_item_dims(self): """ Returns the maximum dimensions that specify the global and local @@ -866,11 +837,9 @@ cdef class SyclDevice(_SyclDevice): int: The maximum number of sub-groups support per work-group by the device. """ - cdef uint32_t max_num_sub_groups = 0 - if (not self.is_host): - max_num_sub_groups = ( - DPCTLDevice_GetMaxNumSubGroups(self._device_ref) - ) + cdef uint32_t max_num_sub_groups = ( + DPCTLDevice_GetMaxNumSubGroups(self._device_ref) + ) return max_num_sub_groups @property diff --git a/dpctl/_sycl_device_factory.pxd b/dpctl/_sycl_device_factory.pxd index 8287833c67..fc36017c6e 100644 --- a/dpctl/_sycl_device_factory.pxd +++ b/dpctl/_sycl_device_factory.pxd @@ -31,10 +31,8 @@ cpdef SyclDevice select_accelerator_device() cpdef SyclDevice select_cpu_device() cpdef SyclDevice select_default_device() cpdef SyclDevice select_gpu_device() -cpdef SyclDevice select_host_device() cpdef list get_devices(backend=*, device_type=*) cpdef int get_num_devices(backend=*, device_type=*) cpdef cpp_bool has_gpu_devices() cpdef cpp_bool has_cpu_devices() cpdef cpp_bool has_accelerator_devices() -cpdef cpp_bool has_host_device() diff --git a/dpctl/_sycl_device_factory.pyx b/dpctl/_sycl_device_factory.pyx index fb848f902f..99aadb5f2b 100644 --- a/dpctl/_sycl_device_factory.pyx +++ b/dpctl/_sycl_device_factory.pyx @@ -39,7 +39,6 @@ from ._backend cimport ( # noqa: E211 DPCTLDeviceVector_Size, DPCTLDeviceVectorRef, DPCTLGPUSelector_Create, - DPCTLHostSelector_Create, DPCTLSyclDeviceRef, DPCTLSyclDeviceSelectorRef, _backend_type, @@ -56,12 +55,10 @@ __all__ = [ "select_cpu_device", "select_default_device", "select_gpu_device", - "select_host_device", "get_num_devices", "has_cpu_devices", "has_gpu_devices", "has_accelerator_devices", - "has_host_device", ] @@ -71,8 +68,6 @@ cdef _backend_type _string_to_dpctl_sycl_backend_ty(str backend_str): return _backend_type._ALL_BACKENDS elif backend_str == "cuda": return _backend_type._CUDA - elif backend_str == "host": - return _backend_type._HOST elif backend_str == "level_zero": return _backend_type._LEVEL_ZERO elif backend_str == "opencl": @@ -95,8 +90,6 @@ cdef _device_type _string_to_dpctl_sycl_device_ty(str dty_str): return _device_type._CUSTOM elif dty_str == "gpu": return _device_type._GPU - elif dty_str == "host": - return _device_type._HOST_DEVICE else: return _device_type._UNKNOWN_DEVICE @@ -106,8 +99,6 @@ cdef _backend_type _enum_to_dpctl_sycl_backend_ty(BTy): return _backend_type._ALL_BACKENDS elif BTy == backend_type.cuda: return _backend_type._CUDA - elif BTy == backend_type.host: - return _backend_type._HOST elif BTy == backend_type.level_zero: return _backend_type._LEVEL_ZERO elif BTy == backend_type.opencl: @@ -129,8 +120,6 @@ cdef _device_type _enum_to_dpctl_sycl_device_ty(DTy): return _device_type._CUSTOM elif DTy == device_type_t.gpu: return _device_type._GPU - elif DTy == device_type_t.host: - return _device_type._HOST_DEVICE else: return _device_type._UNKNOWN_DEVICE @@ -288,19 +277,6 @@ cpdef cpp_bool has_accelerator_devices(): return num_accelerator_dev -cpdef cpp_bool has_host_device(): - """ A helper function to check if there are any SYCL Host devices available. - - Returns: - bool: ``True`` if ``sycl::device_type::host`` devices are present, - ``False`` otherwise. - """ - cdef int num_host_dev = DPCTLDeviceMgr_GetNumDevices( - _device_type._HOST_DEVICE - ) - return num_host_dev - - cpdef SyclDevice select_accelerator_device(): """ A wrapper for SYCL's ``accelerator_selector`` class. @@ -379,23 +355,3 @@ cpdef SyclDevice select_gpu_device(): raise SyclDeviceCreationError("Device unavailable.") Device = SyclDevice._create(DRef) return Device - - -cpdef SyclDevice select_host_device(): - """ A wrapper for SYCL's ``host_selector`` class. - - Returns: - dpctl.SyclDevice: A Python object wrapping the SYCL ``device`` - returned by the SYCL ``host_selector``. - Raises: - dpctl.SyclDeviceCreationError: If the SYCL ``host_selector`` is - unable to select a ``device``. - """ - cdef DPCTLSyclDeviceSelectorRef DSRef = DPCTLHostSelector_Create() - cdef DPCTLSyclDeviceRef DRef = DPCTLDevice_CreateFromSelector(DSRef) - # Free up the device selector - DPCTLDeviceSelector_Delete(DSRef) - if DRef is NULL: - raise SyclDeviceCreationError("Host device is unavailable.") - Device = SyclDevice._create(DRef) - return Device diff --git a/dpctl/_sycl_event.pyx b/dpctl/_sycl_event.pyx index 5baecb5b58..a1395f3434 100644 --- a/dpctl/_sycl_event.pyx +++ b/dpctl/_sycl_event.pyx @@ -302,8 +302,6 @@ cdef class SyclEvent(_SyclEvent): return backend_type.opencl elif BE == _backend_type._LEVEL_ZERO: return backend_type.level_zero - elif BE == _backend_type._HOST: - return backend_type.host elif BE == _backend_type._CUDA: return backend_type.cuda else: diff --git a/dpctl/_sycl_platform.pyx b/dpctl/_sycl_platform.pyx index 9356c9f8a7..449ad9029f 100644 --- a/dpctl/_sycl_platform.pyx +++ b/dpctl/_sycl_platform.pyx @@ -251,8 +251,6 @@ cdef class SyclPlatform(_SyclPlatform): ) if BTy == _backend_type._CUDA: return backend_type.cuda - elif BTy == _backend_type._HOST: - return backend_type.host elif BTy == _backend_type._LEVEL_ZERO: return backend_type.level_zero elif BTy == _backend_type._OPENCL: diff --git a/dpctl/_sycl_queue.pyx b/dpctl/_sycl_queue.pyx index 6a686f93fd..6c6f3bf1d8 100644 --- a/dpctl/_sycl_queue.pyx +++ b/dpctl/_sycl_queue.pyx @@ -676,8 +676,6 @@ cdef class SyclQueue(_SyclQueue): return backend_type.opencl elif BE == _backend_type._LEVEL_ZERO: return backend_type.level_zero - elif BE == _backend_type._HOST: - return backend_type.host elif BE == _backend_type._CUDA: return backend_type.cuda else: diff --git a/dpctl/enum_types.py b/dpctl/enum_types.py index 6301e778fb..4f80f3e506 100644 --- a/dpctl/enum_types.py +++ b/dpctl/enum_types.py @@ -54,7 +54,6 @@ class device_type(Enum): cpu = auto() custom = auto() gpu = auto() - host = auto() class backend_type(Enum): @@ -74,7 +73,6 @@ class backend_type(Enum): all = auto() cuda = auto() - host = auto() level_zero = auto() opencl = auto() diff --git a/dpctl/program/_program.pyx b/dpctl/program/_program.pyx index da98f53047..a22b220ae1 100644 --- a/dpctl/program/_program.pyx +++ b/dpctl/program/_program.pyx @@ -34,6 +34,7 @@ from dpctl._backend cimport ( # noqa: E211, E402; DPCTLKernel_GetCompileNumSubGroups, DPCTLKernel_GetCompileSubGroupSize, DPCTLKernel_GetMaxNumSubGroups, + DPCTLKernel_GetMaxSubGroupSize, DPCTLKernel_GetNumArgs, DPCTLKernel_GetPreferredWorkGroupSizeMultiple, DPCTLKernel_GetPrivateMemSize, @@ -146,8 +147,8 @@ cdef class SyclKernel: def max_sub_group_size(self): """ Returns the maximum sub-groups size for this kernel. """ - cdef uint32_t sz = 0 - return NotImplemented + cdef uint32_t sz = DPCTLKernel_GetMaxSubGroupSize(self._kernel_ref) + return sz @property def compile_num_sub_groups(self): diff --git a/dpctl/tensor/CMakeLists.txt b/dpctl/tensor/CMakeLists.txt index a587d84609..b496ecfbd8 100644 --- a/dpctl/tensor/CMakeLists.txt +++ b/dpctl/tensor/CMakeLists.txt @@ -29,6 +29,7 @@ pybind11_add_module(${python_module_name} MODULE ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/device_support_queries.cpp ) target_link_options(${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel) +target_link_options(${python_module_name} PRIVATE -fsycl-link-huge-device-code) target_include_directories(${python_module_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include diff --git a/dpctl/tests/_device_attributes_checks.py b/dpctl/tests/_device_attributes_checks.py index 0d66b7c657..49666dfce6 100644 --- a/dpctl/tests/_device_attributes_checks.py +++ b/dpctl/tests/_device_attributes_checks.py @@ -23,7 +23,6 @@ dpctl.select_cpu_device, dpctl.select_default_device, dpctl.select_gpu_device, - dpctl.select_host_device, ] list_of_valid_filter_selectors = [ @@ -109,7 +108,7 @@ def check_max_work_group_size(device): def check_max_num_sub_groups(device): max_num_sub_groups = device.max_num_sub_groups # Special case for FPGA simulator - if device.is_accelerator or device.is_host: + if device.is_accelerator: assert max_num_sub_groups >= 0 else: assert max_num_sub_groups > 0 @@ -120,13 +119,6 @@ def check_sub_group_sizes(device): assert all(el > 0 for el in sg_sizes) -def check_has_aspect_host(device): - try: - device.has_aspect_host - except Exception: - pytest.fail("has_aspect_host call failed") - - def check_has_aspect_cpu(device): try: device.has_aspect_cpu @@ -281,13 +273,6 @@ def check_is_gpu(device): pytest.fail("is_gpu call failed") -def check_is_host(device): - try: - device.is_host - except Exception: - pytest.fail("is_hostcall failed") - - def check_max_read_image_args(device): try: device.max_read_image_args @@ -571,7 +556,7 @@ def check_driver_version(device): def check_vendor(device): ve = device.vendor - assert ve or device.is_host + assert ve assert type(ve) is str @@ -625,7 +610,6 @@ def check_global_mem_cache_line_size(device): check_is_accelerator, check_is_cpu, check_is_gpu, - check_is_host, check_sub_group_independent_forward_progress, check_preferred_vector_width_char, check_preferred_vector_width_short, @@ -634,7 +618,6 @@ def check_global_mem_cache_line_size(device): check_preferred_vector_width_float, check_preferred_vector_width_double, check_preferred_vector_width_half, - check_has_aspect_host, check_has_aspect_cpu, check_has_aspect_gpu, check_has_aspect_accelerator, diff --git a/dpctl/tests/setup_cython_api.py b/dpctl/tests/setup_cython_api.py index 9f9bd8f370..204a78cbc6 100644 --- a/dpctl/tests/setup_cython_api.py +++ b/dpctl/tests/setup_cython_api.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import Cython.Build import setuptools +from Cython.Build import build_ext import dpctl @@ -27,8 +27,8 @@ ) setuptools.setup( - name="_cython_api", + name="test_cython_api", version="0.0.0", ext_modules=[ext], - cmdclass={"build_ext": Cython.Build.build_ext}, + cmdclass={"build_ext": build_ext}, ) diff --git a/dpctl/tests/test_sycl_device_factory.py b/dpctl/tests/test_sycl_device_factory.py index 404b205c0a..8e6e61b343 100644 --- a/dpctl/tests/test_sycl_device_factory.py +++ b/dpctl/tests/test_sycl_device_factory.py @@ -27,24 +27,20 @@ (bty.level_zero, dty.gpu), (bty.opencl, dty.gpu), (bty.opencl, dty.cpu), - (bty.host, dty.host), ] argument_list_2 = [ - ("host", "host"), ("level_zero", "gpu"), ("opencl", "gpu"), ("opencl", "cpu"), ] list_of_backend_str = [ - "host", "level_zero", "opencl", ] list_of_device_type_str = [ - "host", "gpu", "cpu", ] diff --git a/dpctl/tests/test_sycl_kernel_submit.py b/dpctl/tests/test_sycl_kernel_submit.py index c97583c8ee..9e0deb482c 100644 --- a/dpctl/tests/test_sycl_kernel_submit.py +++ b/dpctl/tests/test_sycl_kernel_submit.py @@ -156,7 +156,8 @@ def test_async_submit(): assert isinstance(kern2Kernel, dpctl_prog.SyclKernel) assert isinstance(kern2Kernel, dpctl_prog.SyclKernel) - n = 1024 * 1024 + status_complete = dpctl.event_status_type.complete + n = 1024 * 1024 * 4 X = dpt.empty((3, n), dtype="u4", usm_type="device", sycl_queue=q) first_row = dpctl_mem.as_usm_memory(X[0]) second_row = dpctl_mem.as_usm_memory(X[1]) @@ -191,14 +192,16 @@ def test_async_submit(): None, [e1, e2], ) - status_complete = dpctl.event_status_type.complete + e3_st = e3.execution_status + e2_st = e2.execution_status + e1_st = e1.execution_status assert not all( [ e == status_complete for e in ( - e1.execution_status, - e2.execution_status, - e3.execution_status, + e1_st, + e2_st, + e3_st, ) ] ) diff --git a/dpctl/tests/test_sycl_program.py b/dpctl/tests/test_sycl_program.py index 1cbd9114e4..1f08501815 100644 --- a/dpctl/tests/test_sycl_program.py +++ b/dpctl/tests/test_sycl_program.py @@ -180,9 +180,7 @@ def _check_multi_kernel_program(prog): vmnsg = krn.max_num_sub_groups assert type(vmnsg) is int v = krn.max_sub_group_size - assert ( - v == NotImplemented - ), "SyclKernel.max_sub_group_size acquired implementation, fix the test" + assert type(v) is int cmnsg = krn.compile_num_sub_groups assert type(cmnsg) is int cmsgsz = krn.compile_sub_group_size diff --git a/dpctl/tests/test_tensor_asarray.py b/dpctl/tests/test_tensor_asarray.py index e2a6f512d2..a309b4e3a4 100644 --- a/dpctl/tests/test_tensor_asarray.py +++ b/dpctl/tests/test_tensor_asarray.py @@ -35,11 +35,6 @@ ) def test_asarray_change_usm_type(src_usm_type, dst_usm_type): d = dpctl.SyclDevice() - if d.is_host: - pytest.skip( - "Skip test of host device, which only " - "supports host USM allocations" - ) X = dpt.empty(10, dtype="u1", usm_type=src_usm_type) Y = dpt.asarray(X, usm_type=dst_usm_type) assert X.shape == Y.shape diff --git a/libsyclinterface/helper/source/dpctl_utils_helper.cpp b/libsyclinterface/helper/source/dpctl_utils_helper.cpp index e13189784d..07fe6da05e 100644 --- a/libsyclinterface/helper/source/dpctl_utils_helper.cpp +++ b/libsyclinterface/helper/source/dpctl_utils_helper.cpp @@ -49,11 +49,6 @@ std::string DPCTL_DeviceTypeToStr(info::device_type devTy) case info::device_type::custom: ss << "custom"; break; -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case info::device_type::host: - ss << "host"; - break; -#endif default: ss << "unknown"; } @@ -93,10 +88,6 @@ backend DPCTL_DPCTLBackendTypeToSyclBackend(DPCTLSyclBackendType BeTy) switch (BeTy) { case DPCTLSyclBackendType::DPCTL_CUDA: return backend::ext_oneapi_cuda; -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case DPCTLSyclBackendType::DPCTL_HOST: - return backend::host; -#endif case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO: return backend::ext_oneapi_level_zero; case DPCTLSyclBackendType::DPCTL_OPENCL: @@ -113,10 +104,6 @@ DPCTLSyclBackendType DPCTL_SyclBackendToDPCTLBackendType(backend B) switch (B) { case backend::ext_oneapi_cuda: return DPCTLSyclBackendType::DPCTL_CUDA; -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case backend::host: - return DPCTLSyclBackendType::DPCTL_HOST; -#endif case backend::ext_oneapi_level_zero: return DPCTLSyclBackendType::DPCTL_LEVEL_ZERO; case backend::opencl: @@ -141,8 +128,6 @@ info::device_type DPCTL_DPCTLDeviceTypeToSyclDeviceType(DPCTLSyclDeviceType DTy) return info::device_type::custom; case DPCTLSyclDeviceType::DPCTL_GPU: return info::device_type::gpu; - case DPCTLSyclDeviceType::DPCTL_HOST_DEVICE: - return info::device_type::host; default: throw std::runtime_error("Unsupported device type"); } @@ -163,8 +148,6 @@ DPCTLSyclDeviceType DPCTL_SyclDeviceTypeToDPCTLDeviceType(info::device_type D) return DPCTLSyclDeviceType::DPCTL_CUSTOM; case info::device_type::gpu: return DPCTLSyclDeviceType::DPCTL_GPU; - case info::device_type::host: - return DPCTLSyclDeviceType::DPCTL_HOST_DEVICE; default: return DPCTLSyclDeviceType::DPCTL_UNKNOWN_DEVICE; } @@ -177,11 +160,6 @@ std::string DPCTL_AspectToStr(aspect aspectTy) { std::stringstream ss; switch (aspectTy) { -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case aspect::host: - ss << "host"; - break; -#endif case aspect::cpu: ss << "cpu"; break; @@ -254,11 +232,6 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr) if (aspectTyStr == "cpu") { aspectTy = aspect::cpu; } -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - else if (aspectTyStr == "host") { - aspectTy = aspect::host; - } -#endif else if (aspectTyStr == "gpu") { aspectTy = aspect::gpu; } @@ -323,10 +296,6 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr) aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy) { switch (AspectTy) { -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case DPCTLSyclAspectType::host: - return aspect::host; -#endif case DPCTLSyclAspectType::cpu: return aspect::cpu; case DPCTLSyclAspectType::gpu: @@ -373,10 +342,6 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy) DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect) { switch (Aspect) { -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case aspect::host: - return DPCTLSyclAspectType::host; -#endif case aspect::cpu: return DPCTLSyclAspectType::cpu; case aspect::gpu: @@ -502,11 +467,6 @@ std::string DPCTL_GetDeviceFilterString(const device &Device) case backend::opencl: ss << "opencl"; break; -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case backend::host: - ss << "host"; - break; -#endif default: ss << "unknown"; }; diff --git a/libsyclinterface/include/Config/dpctl_config.h.in b/libsyclinterface/include/Config/dpctl_config.h.in index af6b3befa0..b1cb9562ef 100644 --- a/libsyclinterface/include/Config/dpctl_config.h.in +++ b/libsyclinterface/include/Config/dpctl_config.h.in @@ -29,14 +29,7 @@ #cmakedefine DPCTL_ENABLE_L0_PROGRAM_CREATION \ @DPCTL_ENABLE_L0_PROGRAM_CREATION@ -/* Version of SYCL DPC++ 2023 compiler at which transition to SYCL 2020 occurs */ -/* Intel(R) oneAPI DPC++ 2022.2.1 compiler has version 20221020L on Linux and - 20221101L on Windows */ -#define __SYCL_COMPILER_2023_SWITCHOVER 20221102L - -/* Version of SYCL DPC++ compiler at which info::max_work_item_size was - made templated */ -#define __SYCL_COMPILER_MAX_WORK_ITEM_SIZE_THRESHOLD __SYCL_COMPILER_2023_SWITCHOVER +#define __SYCL_COMPILER_VERSION_REQUIRED 20221201L /* The DPCPP version used to build dpctl */ #define DPCTL_DPCPP_VERSION "@IntelSycl_VERSION@" diff --git a/libsyclinterface/include/dpctl_device_selection.hpp b/libsyclinterface/include/dpctl_device_selection.hpp index a904228d34..6aa4e69ec7 100644 --- a/libsyclinterface/include/dpctl_device_selection.hpp +++ b/libsyclinterface/include/dpctl_device_selection.hpp @@ -26,7 +26,6 @@ #pragma once -#include "Config/dpctl_config.h" #include "Support/DllExport.h" #include @@ -35,8 +34,6 @@ namespace dpctl namespace syclinterface { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER - class DPCTL_API dpctl_device_selector { public: @@ -83,85 +80,5 @@ class DPCTL_API dpctl_filter_selector : public dpctl_device_selector sycl::ext::oneapi::filter_selector _impl; }; -class DPCTL_API dpctl_host_selector : public dpctl_device_selector -{ -public: - dpctl_host_selector() = default; - int operator()(const sycl::device &) const override; -}; - -#else - -class DPCTL_API dpctl_device_selector : public sycl::device_selector -{ -public: - virtual ~dpctl_device_selector() = default; - - virtual int operator()(const sycl::device &device) const = 0; -}; - -class DPCTL_API dpctl_accelerator_selector : public dpctl_device_selector -{ -public: - dpctl_accelerator_selector() : _impl(){}; - int operator()(const sycl::device &d) const override; - -private: - sycl::accelerator_selector _impl; -}; - -class DPCTL_API dpctl_default_selector : public dpctl_device_selector -{ -public: - dpctl_default_selector() : _impl(){}; - int operator()(const sycl::device &d) const override; - -private: - sycl::default_selector _impl; -}; - -class DPCTL_API dpctl_gpu_selector : public dpctl_device_selector -{ -public: - dpctl_gpu_selector() : _impl(){}; - int operator()(const sycl::device &d) const override; - -private: - sycl::gpu_selector _impl; -}; - -class DPCTL_API dpctl_cpu_selector : public dpctl_device_selector -{ -public: - dpctl_cpu_selector() : _impl(){}; - int operator()(const sycl::device &d) const override; - -private: - sycl::cpu_selector _impl; -}; - -class DPCTL_API dpctl_filter_selector : public dpctl_device_selector -{ -public: - dpctl_filter_selector(const std::string &fs) : _impl(fs) {} - - int operator()(const sycl::device &d) const override; - -private: - sycl::ext::oneapi::filter_selector _impl; -}; - -class DPCTL_API dpctl_host_selector : public dpctl_device_selector -{ -public: - dpctl_host_selector() : _impl(){}; - int operator()(const sycl::device &d) const override; - -private: - sycl::host_selector _impl; -}; - -#endif - } // namespace syclinterface } // namespace dpctl diff --git a/libsyclinterface/include/dpctl_sycl_context_interface.h b/libsyclinterface/include/dpctl_sycl_context_interface.h index 6578ffbaa7..6ca3c92d05 100644 --- a/libsyclinterface/include/dpctl_sycl_context_interface.h +++ b/libsyclinterface/include/dpctl_sycl_context_interface.h @@ -130,16 +130,6 @@ DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLContext_GetDevices(__dpctl_keep const DPCTLSyclContextRef CRef); -/*! - * @brief Returns true if this SYCL context is a host context. - * - * @param CtxRef An opaque pointer to a sycl::context. - * @return True if the SYCL context is a host context, else False. - * @ingroup ContextInterface - */ -DPCTL_API -bool DPCTLContext_IsHost(__dpctl_keep const DPCTLSyclContextRef CtxRef); - /*! * @brief Returns the sycl backend for the DPCTLSyclContextRef pointer. * diff --git a/libsyclinterface/include/dpctl_sycl_device_interface.h b/libsyclinterface/include/dpctl_sycl_device_interface.h index 15b6791ffc..bcce8cc592 100644 --- a/libsyclinterface/include/dpctl_sycl_device_interface.h +++ b/libsyclinterface/include/dpctl_sycl_device_interface.h @@ -120,16 +120,6 @@ bool DPCTLDevice_IsCPU(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_IsGPU(__dpctl_keep const DPCTLSyclDeviceRef DRef); -/*! - * @brief Returns true if this SYCL device is a host device. - * - * @param DRef Opaque pointer to a ``sycl::device`` - * @return True if the device is a host device, else False. - * @ingroup DeviceInterface - */ -DPCTL_API -bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef); - /*! * @brief Returns the backend for the device. * diff --git a/libsyclinterface/include/dpctl_sycl_device_selector_interface.h b/libsyclinterface/include/dpctl_sycl_device_selector_interface.h index 04813b1cc6..c1cd5fcd5c 100644 --- a/libsyclinterface/include/dpctl_sycl_device_selector_interface.h +++ b/libsyclinterface/include/dpctl_sycl_device_selector_interface.h @@ -86,15 +86,6 @@ DPCTLFilterSelector_Create(__dpctl_keep const char *filter_str); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create(void); -/*! - * @brief Returns an opaque wrapper for dpctl_host_selector object. - * - * @return An opaque pointer to a dpctl_host_selector object. - * @ingroup DeviceSelectors - */ -DPCTL_API -__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create(void); - /*! * @brief Deletes the DPCTLSyclDeviceSelectorRef after casting it to a * sycl::device_selector. diff --git a/libsyclinterface/include/dpctl_sycl_enum_types.h b/libsyclinterface/include/dpctl_sycl_enum_types.h index 1d5292bb90..fcf253d89b 100644 --- a/libsyclinterface/include/dpctl_sycl_enum_types.h +++ b/libsyclinterface/include/dpctl_sycl_enum_types.h @@ -39,9 +39,8 @@ typedef enum { // clang-format off DPCTL_CUDA = 1 << 16, - DPCTL_HOST = 1 << 17, - DPCTL_LEVEL_ZERO = 1 << 18, - DPCTL_OPENCL = 1 << 19, + DPCTL_LEVEL_ZERO = 1 << 17, + DPCTL_OPENCL = 1 << 18, DPCTL_UNKNOWN_BACKEND = 0, DPCTL_ALL_BACKENDS = ((1<<5)-1) << 16 // clang-format on @@ -62,7 +61,6 @@ typedef enum DPCTL_CPU = 1 << 2, DPCTL_CUSTOM = 1 << 3, DPCTL_GPU = 1 << 4, - DPCTL_HOST_DEVICE = 1 << 5, DPCTL_ALL = (1 << 6) - 1, DPCTL_UNKNOWN_DEVICE = 0 // clang-format on diff --git a/libsyclinterface/include/dpctl_sycl_kernel_interface.h b/libsyclinterface/include/dpctl_sycl_kernel_interface.h index ad46ecb3f1..52d1dca5bd 100644 --- a/libsyclinterface/include/dpctl_sycl_kernel_interface.h +++ b/libsyclinterface/include/dpctl_sycl_kernel_interface.h @@ -26,7 +26,6 @@ #pragma once -#include "Config/dpctl_config.h" #include "Support/DllExport.h" #include "Support/ExternC.h" #include "Support/MemOwnershipAttrs.h" @@ -130,7 +129,6 @@ DPCTL_API uint32_t DPCTLKernel_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef); -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER /*! * !brief Wrapper around * `kernel::get_info()`. @@ -143,7 +141,6 @@ DPCTLKernel_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API uint32_t DPCTLKernel_GetMaxSubGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef); -#endif /*! * !brief Wrapper around diff --git a/libsyclinterface/source/dpctl_device_selection.cpp b/libsyclinterface/source/dpctl_device_selection.cpp index 12c28cbc23..7203bc3b1a 100644 --- a/libsyclinterface/source/dpctl_device_selection.cpp +++ b/libsyclinterface/source/dpctl_device_selection.cpp @@ -29,13 +29,17 @@ #include "Config/dpctl_config.h" #include +namespace +{ +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); +} + namespace dpctl { namespace syclinterface { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER - int dpctl_device_selector::operator()(const sycl::device &) const { return REJECT_DEVICE; @@ -67,44 +71,5 @@ int dpctl_filter_selector::operator()(const sycl::device &d) const return _impl(d); } -int dpctl_host_selector::operator()(const sycl::device &) const -{ - return REJECT_DEVICE; -} - -#else - -int dpctl_accelerator_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -int dpctl_default_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -int dpctl_gpu_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -int dpctl_cpu_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -int dpctl_filter_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -int dpctl_host_selector::operator()(const sycl::device &d) const -{ - return _impl(d); -} - -#endif - } // namespace syclinterface } // namespace dpctl diff --git a/libsyclinterface/source/dpctl_sycl_context_interface.cpp b/libsyclinterface/source/dpctl_sycl_context_interface.cpp index b83d17e101..d93ca4e992 100644 --- a/libsyclinterface/source/dpctl_sycl_context_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_context_interface.cpp @@ -35,6 +35,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; } // end of anonymous namespace @@ -166,19 +169,6 @@ size_t DPCTLContext_DeviceCount(__dpctl_keep const DPCTLSyclContextRef CRef) return Devices.size(); } -bool DPCTLContext_IsHost(__dpctl_keep const DPCTLSyclContextRef CtxRef) -{ - auto Ctx = unwrap(CtxRef); - if (Ctx) { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER - return false; -#else - return Ctx->is_host(); -#endif - } - return false; -} - void DPCTLContext_Delete(__dpctl_take DPCTLSyclContextRef CtxRef) { delete unwrap(CtxRef); @@ -194,10 +184,6 @@ DPCTLContext_GetBackend(__dpctl_keep const DPCTLSyclContextRef CtxRef) auto BE = unwrap(CtxRef)->get_platform().get_backend(); switch (BE) { -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case backend::host: - return DPCTL_HOST; -#endif case backend::opencl: return DPCTL_OPENCL; case backend::ext_oneapi_level_zero: diff --git a/libsyclinterface/source/dpctl_sycl_device_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_interface.cpp index 5b86e426f2..02e4239a3f 100644 --- a/libsyclinterface/source/dpctl_sycl_device_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_interface.cpp @@ -42,16 +42,15 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; device *new_device_from_selector(const dpctl_device_selector *sel) { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER return new device( [=](const device &d) -> int { return sel->operator()(d); }); -#else - return new device(*sel); -#endif } template @@ -177,19 +176,6 @@ bool DPCTLDevice_IsGPU(__dpctl_keep const DPCTLSyclDeviceRef DRef) return false; } -bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef) -{ - auto D = unwrap(DRef); - if (D) { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER - return false; -#else - return D->is_host(); -#endif - } - return false; -} - DPCTLSyclBackendType DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef) { diff --git a/libsyclinterface/source/dpctl_sycl_device_manager.cpp b/libsyclinterface/source/dpctl_sycl_device_manager.cpp index 3ce34df2c5..71160089cb 100644 --- a/libsyclinterface/source/dpctl_sycl_device_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_manager.cpp @@ -29,7 +29,8 @@ #include "dpctl_sycl_enum_types.h" #include "dpctl_sycl_type_casters.hpp" #include "dpctl_utils_helper.h" -#include /* SYCL headers */ +#include /* SYCL headers */ +#include /* Config */ #include #include #include @@ -40,6 +41,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; /* diff --git a/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp index 5440b803f8..9753c32613 100644 --- a/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp @@ -24,6 +24,7 @@ //===----------------------------------------------------------------------===// #include "dpctl_sycl_device_selector_interface.h" +#include "Config/dpctl_config.h" #include "dpctl_device_selection.hpp" #include "dpctl_error_handlers.h" #include "dpctl_sycl_type_casters.hpp" @@ -33,6 +34,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; } // end of anonymous namespace @@ -93,17 +97,6 @@ __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create() } } -__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create() -{ - try { - auto Selector = new dpctl_host_selector(); - return wrap(Selector); - } catch (std::exception const &e) { - error_handler(e, __FILE__, __func__, __LINE__); - return nullptr; - } -} - int DPCTLDeviceSelector_Score(__dpctl_keep DPCTLSyclDeviceSelectorRef DSRef, __dpctl_keep DPCTLSyclDeviceRef DRef) { diff --git a/libsyclinterface/source/dpctl_sycl_event_interface.cpp b/libsyclinterface/source/dpctl_sycl_event_interface.cpp index 804c76ccb9..3f872f4493 100644 --- a/libsyclinterface/source/dpctl_sycl_event_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_event_interface.cpp @@ -25,6 +25,7 @@ //===----------------------------------------------------------------------===// #include "dpctl_sycl_event_interface.h" +#include "Config/dpctl_config.h" #include "dpctl_error_handlers.h" #include "dpctl_sycl_type_casters.hpp" #include "dpctl_utils_helper.h" @@ -35,6 +36,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; } // end of anonymous namespace diff --git a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp index b196264350..002edabc26 100644 --- a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp @@ -56,6 +56,8 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); using namespace dpctl::syclinterface; diff --git a/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp b/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp index 95a800a34e..8a5af3f179 100644 --- a/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp @@ -36,6 +36,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; } // end of anonymous namespace @@ -161,9 +164,6 @@ DPCTLKernel_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef) return static_cast(v); } -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER -// commented out due to bug in DPC++ runtime, get_info for max_sub_group_size -// exported by libsycl has different, not SPEC-compliant signature uint32_t DPCTLKernel_GetMaxSubGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef) { @@ -185,7 +185,6 @@ DPCTLKernel_GetMaxSubGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef) devs[0]); return v; } -#endif uint32_t DPCTLKernel_GetCompileNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef) diff --git a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp index a33a1e3328..b72d828b09 100644 --- a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp @@ -42,17 +42,15 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); using namespace dpctl::syclinterface; platform *new_platform_from_selector(const dpctl_device_selector *sel) { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER return new platform( [=](const device &d) -> int { return sel->operator()(d); }); -#else - return new platform(*sel); -#endif } } // end of anonymous namespace diff --git a/libsyclinterface/source/dpctl_sycl_platform_manager.cpp b/libsyclinterface/source/dpctl_sycl_platform_manager.cpp index ffbfb9a939..6717b48c6f 100644 --- a/libsyclinterface/source/dpctl_sycl_platform_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_platform_manager.cpp @@ -41,6 +41,8 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); using namespace dpctl::syclinterface; @@ -71,11 +73,7 @@ std::string platform_print_info_impl(const platform &p, size_t verbosity) << p.get_info() << _endl << std::setw(4) << " " << std::left << std::setw(12) << "Vendor" << vendor << _endl << std::setw(4) << " " << std::left << std::setw(12) << "Backend"; -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER ss << p.get_backend(); -#else - p.is_host() ? (ss << "unknown") : (ss << p.get_backend()); -#endif ss << _endl; // Get number of devices on the platform diff --git a/libsyclinterface/source/dpctl_sycl_queue_interface.cpp b/libsyclinterface/source/dpctl_sycl_queue_interface.cpp index 6972b812c3..a8343598c2 100644 --- a/libsyclinterface/source/dpctl_sycl_queue_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_queue_interface.cpp @@ -25,6 +25,7 @@ //===----------------------------------------------------------------------===// #include "dpctl_sycl_queue_interface.h" +#include "Config/dpctl_config.h" #include "dpctl_error_handlers.h" #include "dpctl_sycl_context_interface.h" #include "dpctl_sycl_device_interface.h" @@ -38,6 +39,8 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); using namespace dpctl::syclinterface; diff --git a/libsyclinterface/source/dpctl_sycl_queue_manager.cpp b/libsyclinterface/source/dpctl_sycl_queue_manager.cpp index c2b9c94140..54e97c0efa 100644 --- a/libsyclinterface/source/dpctl_sycl_queue_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_queue_manager.cpp @@ -24,6 +24,7 @@ /// //===----------------------------------------------------------------------===// #include "dpctl_sycl_queue_manager.h" +#include "Config/dpctl_config.h" #include "dpctl_error_handlers.h" #include "dpctl_sycl_device_manager.h" #include "dpctl_sycl_type_casters.hpp" @@ -37,6 +38,8 @@ using namespace sycl; // Anonymous namespace for private helpers namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); using namespace dpctl::syclinterface; diff --git a/libsyclinterface/source/dpctl_sycl_usm_interface.cpp b/libsyclinterface/source/dpctl_sycl_usm_interface.cpp index 443d28bac3..71561ab0bd 100644 --- a/libsyclinterface/source/dpctl_sycl_usm_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_usm_interface.cpp @@ -25,6 +25,7 @@ //===----------------------------------------------------------------------===// #include "dpctl_sycl_usm_interface.h" +#include "Config/dpctl_config.h" #include "dpctl_error_handlers.h" #include "dpctl_sycl_device_interface.h" #include "dpctl_sycl_type_casters.hpp" @@ -34,6 +35,9 @@ using namespace sycl; namespace { +static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VERSION_REQUIRED, + "The compiler does not meet minimum version requirement"); + using namespace dpctl::syclinterface; } // end of anonymous namespace diff --git a/libsyclinterface/tests/CMakeLists.txt b/libsyclinterface/tests/CMakeLists.txt index a1d5dd1c77..4cfd30338d 100644 --- a/libsyclinterface/tests/CMakeLists.txt +++ b/libsyclinterface/tests/CMakeLists.txt @@ -54,7 +54,7 @@ if(DPCTL_GENERATE_COVERAGE) COMMAND ${LLVMCov_EXE} export -format=lcov - -ignore-filename-regex=/tmp/dpctl_*.h* + -ignore-filename-regex=/tmp/icpx* -instr-profile=dpctl.profdata "${object_arg}$,;${object_arg}>" > dpctl.lcov diff --git a/libsyclinterface/tests/test_helper.cpp b/libsyclinterface/tests/test_helper.cpp index 0fe530fbce..ea529cbf24 100644 --- a/libsyclinterface/tests/test_helper.cpp +++ b/libsyclinterface/tests/test_helper.cpp @@ -45,13 +45,6 @@ TEST_F(TestHelperFns, ChkDeviceTypeToStr) res = DPCTL_DeviceTypeToStr(sycl::info::device_type::gpu)); ASSERT_TRUE(res == "gpu"); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE( - res = DPCTL_DeviceTypeToStr(sycl::info::device_type::host)); - // since host device is being deprecated in SYCL 2020, accept unknown - ASSERT_TRUE(res == "host"); -#endif - EXPECT_NO_FATAL_FAILURE( res = DPCTL_DeviceTypeToStr(sycl::info::device_type::custom)); ASSERT_TRUE(res == "custom"); @@ -75,11 +68,6 @@ TEST_F(TestHelperFns, ChkStrToDeviceType) EXPECT_NO_FATAL_FAILURE(dev_type = DPCTL_StrToDeviceType("gpu")); ASSERT_TRUE(dev_type == sycl::info::device_type::gpu); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE(dev_type = DPCTL_StrToDeviceType("host")); - ASSERT_TRUE(dev_type == sycl::info::device_type::host); -#endif - EXPECT_NO_FATAL_FAILURE(dev_type = DPCTL_StrToDeviceType("accelerator")); ASSERT_TRUE(dev_type == sycl::info::device_type::accelerator); @@ -97,12 +85,6 @@ TEST_F(TestHelperFns, ChkDPCTLBackendTypeToSyclBackend) DPCTLSyclBackendType::DPCTL_CUDA)); ASSERT_TRUE(res == sycl::backend::ext_oneapi_cuda); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE(res = DPCTL_DPCTLBackendTypeToSyclBackend( - DPCTLSyclBackendType::DPCTL_HOST)); - ASSERT_TRUE(res == sycl::backend::host); -#endif - EXPECT_NO_FATAL_FAILURE(res = DPCTL_DPCTLBackendTypeToSyclBackend( DPCTLSyclBackendType::DPCTL_OPENCL)); ASSERT_TRUE(res == sycl::backend::opencl); @@ -128,12 +110,6 @@ TEST_F(TestHelperFns, ChkSyclBackendToDPCTLBackendType) DTy = DPCTL_SyclBackendToDPCTLBackendType(sycl::backend::opencl)); ASSERT_TRUE(DTy == DPCTLSyclBackendType::DPCTL_OPENCL); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE( - DTy = DPCTL_SyclBackendToDPCTLBackendType(sycl::backend::host)); - ASSERT_TRUE(DTy == DPCTLSyclBackendType::DPCTL_HOST); -#endif - EXPECT_NO_FATAL_FAILURE(DTy = DPCTL_SyclBackendToDPCTLBackendType( sycl::backend::ext_oneapi_cuda)); ASSERT_TRUE(DTy == DPCTLSyclBackendType::DPCTL_CUDA); @@ -163,12 +139,6 @@ TEST_F(TestHelperFns, ChkDPCTLDeviceTypeToSyclDeviceType) DPCTLSyclDeviceType::DPCTL_CUSTOM)); ASSERT_TRUE(dev_type == sycl::info::device_type::custom); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE(dev_type = DPCTL_DPCTLDeviceTypeToSyclDeviceType( - DPCTLSyclDeviceType::DPCTL_HOST_DEVICE)); - ASSERT_TRUE(dev_type == sycl::info::device_type::host); -#endif - EXPECT_NO_FATAL_FAILURE(dev_type = DPCTL_DPCTLDeviceTypeToSyclDeviceType( DPCTLSyclDeviceType::DPCTL_AUTOMATIC)); ASSERT_TRUE(dev_type == sycl::info::device_type::automatic); @@ -190,12 +160,6 @@ TEST_F(TestHelperFns, SyclDeviceTypeToDPCTLDeviceType) sycl::info::device_type::gpu)); ASSERT_TRUE(DTy == DPCTLSyclDeviceType::DPCTL_GPU); -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - EXPECT_NO_FATAL_FAILURE(DTy = DPCTL_SyclDeviceTypeToDPCTLDeviceType( - sycl::info::device_type::host)); - ASSERT_TRUE(DTy == DPCTLSyclDeviceType::DPCTL_HOST_DEVICE); -#endif - EXPECT_NO_FATAL_FAILURE(DTy = DPCTL_SyclDeviceTypeToDPCTLDeviceType( sycl::info::device_type::accelerator)); ASSERT_TRUE(DTy == DPCTLSyclDeviceType::DPCTL_ACCELERATOR); diff --git a/libsyclinterface/tests/test_sycl_context_interface.cpp b/libsyclinterface/tests/test_sycl_context_interface.cpp index f20591e134..36b2ff6e97 100644 --- a/libsyclinterface/tests/test_sycl_context_interface.cpp +++ b/libsyclinterface/tests/test_sycl_context_interface.cpp @@ -162,21 +162,6 @@ TEST_P(TestDPCTLContextInterface, ChkAreEq) EXPECT_NO_FATAL_FAILURE(DPCTLContext_Delete(CRef3)); } -TEST_P(TestDPCTLContextInterface, ChkIsHost) -{ - DPCTLSyclContextRef CRef = nullptr; - bool is_host_device = false, is_host_context = false; - - EXPECT_NO_FATAL_FAILURE(CRef = DPCTLContext_Create(DRef, nullptr, 0)); - ASSERT_TRUE(CRef); - - EXPECT_NO_FATAL_FAILURE(is_host_device = DPCTLDevice_IsHost(DRef)); - EXPECT_NO_FATAL_FAILURE(is_host_context = DPCTLContext_IsHost(CRef)); - EXPECT_TRUE(is_host_device == is_host_context); - - EXPECT_NO_FATAL_FAILURE(DPCTLContext_Delete(CRef)); -} - TEST_P(TestDPCTLContextInterface, ChkGetBackend) { DPCTLSyclContextRef CRef = nullptr; @@ -262,13 +247,6 @@ TEST_F(TestDPCTLContextNullArgs, ChkDeviceCount) ASSERT_TRUE(count == 0); } -TEST_F(TestDPCTLContextNullArgs, ChkIsHost) -{ - bool is_host = true; - EXPECT_NO_FATAL_FAILURE(is_host = DPCTLContext_IsHost(Null_CRef)); - ASSERT_FALSE(is_host); -} - TEST_F(TestDPCTLContextNullArgs, ChkHash) { size_t hash = 0; diff --git a/libsyclinterface/tests/test_sycl_device_aspects.cpp b/libsyclinterface/tests/test_sycl_device_aspects.cpp index a1cae92876..0d9e373184 100644 --- a/libsyclinterface/tests/test_sycl_device_aspects.cpp +++ b/libsyclinterface/tests/test_sycl_device_aspects.cpp @@ -101,9 +101,6 @@ auto build_params() constexpr auto param_2 = get_param_list>( -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - std::make_pair("host", sycl::aspect::host), -#endif std::make_pair("cpu", sycl::aspect::cpu), std::make_pair("gpu", sycl::aspect::gpu), std::make_pair("accelerator", sycl::aspect::accelerator), diff --git a/libsyclinterface/tests/test_sycl_device_interface.cpp b/libsyclinterface/tests/test_sycl_device_interface.cpp index 80d6566996..7d202044d1 100644 --- a/libsyclinterface/tests/test_sycl_device_interface.cpp +++ b/libsyclinterface/tests/test_sycl_device_interface.cpp @@ -81,8 +81,6 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetBackend) switch (BTy) { case DPCTLSyclBackendType::DPCTL_CUDA: return true; - case DPCTLSyclBackendType::DPCTL_HOST: - return true; case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO: return true; case DPCTLSyclBackendType::DPCTL_OPENCL: @@ -244,11 +242,6 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkIsGPU) EXPECT_NO_FATAL_FAILURE(DPCTLDevice_IsGPU(DRef)); } -TEST_P(TestDPCTLSyclDeviceInterface, ChkIsHost) -{ - EXPECT_NO_FATAL_FAILURE(DPCTLDevice_IsHost(DRef)); -} - TEST_P(TestDPCTLSyclDeviceInterface, ChkGetSubGroupIndependentForwardProgress) { bool sub_group_progress = 0; @@ -312,7 +305,9 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetPreferredVectorWidthDouble) EXPECT_TRUE(vector_width_double != 0); } else { - EXPECT_TRUE(vector_width_double == 0); + // FIXME: DPC++ 2023 RT must have a bug, since it returns 1 for + // devices without aspect::fp64 + // EXPECT_TRUE(vector_width_double == 0); } } @@ -528,13 +523,6 @@ TEST_F(TestDPCTLSyclDeviceNullArgs, ChkIsGPU) ASSERT_FALSE(is_gpu); } -TEST_F(TestDPCTLSyclDeviceNullArgs, ChkIsHost) -{ - bool is_host = true; - EXPECT_NO_FATAL_FAILURE(is_host = DPCTLDevice_IsHost(Null_DRef)); - ASSERT_FALSE(is_host); -} - TEST_F(TestDPCTLSyclDeviceNullArgs, ChkGetMaxComputeUnits) { uint32_t mcu = -1; diff --git a/libsyclinterface/tests/test_sycl_device_manager.cpp b/libsyclinterface/tests/test_sycl_device_manager.cpp index ad4d3f39ab..333f221dfb 100644 --- a/libsyclinterface/tests/test_sycl_device_manager.cpp +++ b/libsyclinterface/tests/test_sycl_device_manager.cpp @@ -134,8 +134,7 @@ TEST_P(TestDPCTLGetDevices, ChkGetAt) INSTANTIATE_TEST_SUITE_P( GetDevices, TestDPCTLGetDevices, - ::testing::Values(DPCTLSyclBackendType::DPCTL_HOST, - DPCTLSyclBackendType::DPCTL_LEVEL_ZERO, + ::testing::Values(DPCTLSyclBackendType::DPCTL_LEVEL_ZERO, DPCTLSyclBackendType::DPCTL_OPENCL, DPCTLSyclBackendType::DPCTL_OPENCL | DPCTLSyclDeviceType::DPCTL_GPU)); @@ -172,8 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(DPCTLSyclDeviceType::DPCTL_ACCELERATOR, DPCTLSyclDeviceType::DPCTL_ALL, DPCTLSyclDeviceType::DPCTL_CPU, - DPCTLSyclDeviceType::DPCTL_GPU, - DPCTLSyclDeviceType::DPCTL_HOST_DEVICE)); + DPCTLSyclDeviceType::DPCTL_GPU)); struct TestGetNumDevicesForBTy : public ::testing::TestWithParam { @@ -210,7 +208,6 @@ INSTANTIATE_TEST_SUITE_P( TestGetNumDevicesForBTy, ::testing::Values(DPCTLSyclBackendType::DPCTL_CUDA, DPCTLSyclBackendType::DPCTL_ALL_BACKENDS, - DPCTLSyclBackendType::DPCTL_HOST, DPCTLSyclBackendType::DPCTL_LEVEL_ZERO, DPCTLSyclBackendType::DPCTL_OPENCL)); @@ -289,8 +286,7 @@ TEST_P(TestDPCTLGetDevicesOrdering, ChkConsistencyWithFilterSelector) INSTANTIATE_TEST_SUITE_P( GetDevices, TestDPCTLGetDevicesOrdering, - ::testing::Values(DPCTLSyclDeviceType::DPCTL_HOST_DEVICE, - DPCTLSyclDeviceType::DPCTL_ACCELERATOR, + ::testing::Values(DPCTLSyclDeviceType::DPCTL_ACCELERATOR, DPCTLSyclDeviceType::DPCTL_GPU, DPCTLSyclDeviceType::DPCTL_CPU)); diff --git a/libsyclinterface/tests/test_sycl_device_selector_interface.cpp b/libsyclinterface/tests/test_sycl_device_selector_interface.cpp index 487014e3d1..eff7e4ee41 100644 --- a/libsyclinterface/tests/test_sycl_device_selector_interface.cpp +++ b/libsyclinterface/tests/test_sycl_device_selector_interface.cpp @@ -159,27 +159,6 @@ TEST_F(TestDeviceSelectorInterface, ChkDPCTLGPUSelectorCreate) EXPECT_NO_FATAL_FAILURE(DPCTLDevice_Delete(DRef)); } -TEST_F(TestDeviceSelectorInterface, ChkDPCTLHostSelectorCreate) -{ - DPCTLSyclDeviceSelectorRef DSRef = nullptr; - DPCTLSyclDeviceRef DRef = nullptr; - - EXPECT_NO_FATAL_FAILURE(DSRef = DPCTLHostSelector_Create()); - EXPECT_NO_FATAL_FAILURE(DRef = DPCTLDevice_CreateFromSelector(DSRef)); - - if (!DRef) { - EXPECT_NO_FATAL_FAILURE(DPCTLDeviceSelector_Delete(DSRef)); - EXPECT_NO_FATAL_FAILURE(DPCTLDevice_Delete(DRef)); - GTEST_SKIP_("Device not found. Skip tests."); - } - - EXPECT_NO_FATAL_FAILURE(DPCTLDeviceMgr_PrintDeviceInfo(DRef)); - // FIXME: DPCPP's host_selector returns a CPU device for some reason. - // EXPECT_TRUE(DPCTLDevice_IsHost(DRef)); - EXPECT_NO_FATAL_FAILURE(DPCTLDeviceSelector_Delete(DSRef)); - EXPECT_NO_FATAL_FAILURE(DPCTLDevice_Delete(DRef)); -} - TEST_P(TestFilterSelector, ChkDPCTLFilterSelectorCreate) { ASSERT_TRUE(DRef != nullptr); diff --git a/libsyclinterface/tests/test_sycl_event_interface.cpp b/libsyclinterface/tests/test_sycl_event_interface.cpp index 17ebff151e..0cc11af731 100644 --- a/libsyclinterface/tests/test_sycl_event_interface.cpp +++ b/libsyclinterface/tests/test_sycl_event_interface.cpp @@ -125,8 +125,6 @@ TEST_F(TestDPCTLSyclEventInterface, CheckEvent_GetBackend) switch (BTy) { case DPCTLSyclBackendType::DPCTL_CUDA: return true; - case DPCTLSyclBackendType::DPCTL_HOST: - return true; case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO: return true; case DPCTLSyclBackendType::DPCTL_OPENCL: @@ -158,11 +156,8 @@ TEST_F(TestDPCTLSyclEventInterface, CheckGetProfiling) { property_list propList{property::queue::enable_profiling()}; -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER queue Q(cpu_selector_v, propList); -#else - queue Q(cpu_selector(), propList); -#endif + auto eA = Q.submit( [&](handler &h) { h.parallel_for(1000, [=](id<1>) { /*...*/ }); }); DPCTLSyclEventRef ERef = reinterpret_cast(&eA); diff --git a/libsyclinterface/tests/test_sycl_kernel_interface.cpp b/libsyclinterface/tests/test_sycl_kernel_interface.cpp index b679fe09d5..97fba96bc3 100644 --- a/libsyclinterface/tests/test_sycl_kernel_interface.cpp +++ b/libsyclinterface/tests/test_sycl_kernel_interface.cpp @@ -145,14 +145,8 @@ TEST_P(TestDPCTLSyclKernelInterface, CheckGetPrivateMemSize) EXPECT_NO_FATAL_FAILURE(axpy_private_mem_sz = DPCTLKernel_GetPrivateMemSize(AxpyKRef)); - if (DPCTLDevice_IsGPU(DRef)) { - ASSERT_TRUE(add_private_mem_sz != 0); - ASSERT_TRUE(axpy_private_mem_sz != 0); - } - else { - ASSERT_TRUE(add_private_mem_sz >= 0); - ASSERT_TRUE(axpy_private_mem_sz >= 0); - } + ASSERT_TRUE(add_private_mem_sz >= 0); + ASSERT_TRUE(axpy_private_mem_sz >= 0); } TEST_P(TestDPCTLSyclKernelInterface, CheckGetMaxNumSubGroups) @@ -167,7 +161,6 @@ TEST_P(TestDPCTLSyclKernelInterface, CheckGetMaxNumSubGroups) ASSERT_TRUE(axpy_mnsg != 0); } -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER TEST_P(TestDPCTLSyclKernelInterface, CheckGetMaxSubGroupSize) { @@ -180,7 +173,6 @@ TEST_P(TestDPCTLSyclKernelInterface, CheckGetMaxSubGroupSize) ASSERT_TRUE(add_msg_sz != 0); ASSERT_TRUE(axpy_msg_sz != 0); } -#endif TEST_P(TestDPCTLSyclKernelInterface, CheckGetCompileNumSubGroups) { @@ -257,14 +249,12 @@ TEST_F(TestDPCTLSyclKernelNullArgs, CheckGetMaxNumSubGroupsNullKRef) ASSERT_EQ(DPCTLKernel_GetMaxNumSubGroups(NullKRef), 0); } -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_2023_SWITCHOVER TEST_F(TestDPCTLSyclKernelNullArgs, CheckGetMaxSubGroupSizeNullKRef) { DPCTLSyclKernelRef NullKRef = nullptr; ASSERT_EQ(DPCTLKernel_GetMaxSubGroupSize(NullKRef), 0); } -#endif TEST_F(TestDPCTLSyclKernelNullArgs, CheckGetCompileNumSubGroupsNullKRef) { diff --git a/libsyclinterface/tests/test_sycl_platform_interface.cpp b/libsyclinterface/tests/test_sycl_platform_interface.cpp index 9fac7ad7c3..e6fb7df134 100644 --- a/libsyclinterface/tests/test_sycl_platform_interface.cpp +++ b/libsyclinterface/tests/test_sycl_platform_interface.cpp @@ -70,8 +70,6 @@ void check_platform_backend(__dpctl_keep const DPCTLSyclPlatformRef PRef) switch (BTy) { case DPCTLSyclBackendType::DPCTL_CUDA: return true; - case DPCTLSyclBackendType::DPCTL_HOST: - return true; case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO: return true; case DPCTLSyclBackendType::DPCTL_OPENCL: diff --git a/libsyclinterface/tests/test_sycl_queue_interface.cpp b/libsyclinterface/tests/test_sycl_queue_interface.cpp index 38266eb2f9..8d23929d39 100644 --- a/libsyclinterface/tests/test_sycl_queue_interface.cpp +++ b/libsyclinterface/tests/test_sycl_queue_interface.cpp @@ -356,11 +356,6 @@ TEST_P(TestDPCTLQueueMemberFunctions, CheckGetBackend) case DPCTL_CUDA: EXPECT_TRUE(Backend == backend::ext_oneapi_cuda); break; -#if __SYCL_COMPILER_VERSION < __SYCL_COMPILER_2023_SWITCHOVER - case DPCTL_HOST: - EXPECT_TRUE(Backend == backend::host); - break; -#endif case DPCTL_LEVEL_ZERO: EXPECT_TRUE(Backend == backend::ext_oneapi_level_zero); break; diff --git a/scripts/gen_coverage.py b/scripts/gen_coverage.py index 60941ce893..41b30d00d9 100644 --- a/scripts/gen_coverage.py +++ b/scripts/gen_coverage.py @@ -140,7 +140,7 @@ def find_objects(): os.path.join(bin_llvm, "llvm-cov"), "export", "-format=lcov", - "-ignore-filename-regex=/tmp/dpctl_*.h*", + "-ignore-filename-regex=/tmp/icpx*", "-instr-profile=" + instr_profile_fn, ] + objects, diff --git a/scripts/gen_docs.py b/scripts/gen_docs.py index a0455748c3..377b37f6d8 100644 --- a/scripts/gen_docs.py +++ b/scripts/gen_docs.py @@ -46,7 +46,7 @@ def run( sys.executable, "setup.py", "develop", - "--build-type=Debug", + "--build-type=Release", "--generator=Ninja", "--", "-DCMAKE_C_COMPILER:PATH=" + c_compiler,