Skip to content

Commit 81a14dc

Browse files
Added tests for deprecated property:
1 parent e68dd22 commit 81a14dc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

dpctl/_sycl_device.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,10 @@ cdef class SyclDevice(_SyclDevice):
700700
`(1; 1; 1)` for devices that are not of device type
701701
``info::device_type::custom``.
702702
"""
703-
import warnings
704703
warnings.warn(
705-
"Use dpctl.SyclDevice.max_work_item_sizes3d",
704+
"dpctl.SyclDevice.max_work_item_sizes is deprecated, "
705+
"use dpctl.SyclDevice.max_work_item_sizes3d instead",
706706
DeprecationWarning,
707-
stacklevel=2
708707
)
709708
return (
710709
self._max_work_item_sizes[0],

dpctl/tests/_device_attributes_checks.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ def check_get_max_work_item_sizes3d(device):
7474
assert size is not None
7575

7676

77+
@pytest.mark.filterwarnings("DeprecationWarning:")
78+
def check_get_max_work_item_sizes(device):
79+
max_work_item_sizes = device.max_work_item_sizes
80+
for size in max_work_item_sizes:
81+
assert size is not None
82+
83+
7784
def check_get_max_work_group_size(device):
7885
max_work_group_size = device.max_work_group_size
7986
# Special case for FPGA simulator
@@ -513,6 +520,7 @@ def check_platform(device):
513520
check_get_max_work_item_sizes1d,
514521
check_get_max_work_item_sizes2d,
515522
check_get_max_work_item_sizes3d,
523+
check_get_max_work_item_sizes,
516524
check_get_max_work_group_size,
517525
check_get_max_num_sub_groups,
518526
check_is_accelerator,

0 commit comments

Comments
 (0)