@@ -22,9 +22,10 @@ def vecadd(a, b, c):
22
22
23
23
24
24
def test_1D_global_range_as_int ():
25
- k = vecadd [10 ]
26
- assert k ._global_range == [10 ]
27
- assert k ._local_range is None
25
+ with pytest .deprecated_call ():
26
+ k = vecadd [10 ]
27
+ assert k ._global_range == [10 ]
28
+ assert k ._local_range is None
28
29
29
30
30
31
def test_1D_global_range_as_one_tuple ():
@@ -34,43 +35,49 @@ def test_1D_global_range_as_one_tuple():
34
35
35
36
36
37
def test_1D_global_range_as_list ():
37
- k = vecadd [[10 ]]
38
- assert k ._global_range == [10 ]
39
- assert k ._local_range is None
38
+ with pytest .deprecated_call ():
39
+ k = vecadd [[10 ]]
40
+ assert k ._global_range == [10 ]
41
+ assert k ._local_range is None
40
42
41
43
42
44
def test_1D_global_range_and_1D_local_range1 ():
43
- k = vecadd [[10 , 10 ]]
44
- assert k ._global_range == [10 ]
45
- assert k ._local_range == [10 ]
45
+ with pytest .deprecated_call ():
46
+ k = vecadd [[10 , 10 ]]
47
+ assert k ._global_range == [10 ]
48
+ assert k ._local_range == [10 ]
46
49
47
50
48
51
def test_1D_global_range_and_1D_local_range2 ():
49
- k = vecadd [(10 ,), (10 ,)]
50
- assert k ._global_range == [10 ]
51
- assert k ._local_range == [10 ]
52
+ with pytest .deprecated_call ():
53
+ k = vecadd [(10 ,), (10 ,)]
54
+ assert k ._global_range == [10 ]
55
+ assert k ._local_range == [10 ]
52
56
53
57
54
58
def test_2D_global_range_and_2D_local_range1 ():
55
- k = vecadd [(10 , 10 ), (10 , 10 )]
56
- assert k ._global_range == [10 , 10 ]
57
- assert k ._local_range == [10 , 10 ]
59
+ with pytest .deprecated_call ():
60
+ k = vecadd [(10 , 10 ), (10 , 10 )]
61
+ assert k ._global_range == [10 , 10 ]
62
+ assert k ._local_range == [10 , 10 ]
58
63
59
64
60
65
def test_2D_global_range_and_2D_local_range2 ():
61
- k = vecadd [[10 , 10 ], (10 , 10 )]
62
- assert k ._global_range == [10 , 10 ]
63
- assert k ._local_range == [10 , 10 ]
66
+ with pytest .deprecated_call ():
67
+ k = vecadd [[10 , 10 ], (10 , 10 )]
68
+ assert k ._global_range == [10 , 10 ]
69
+ assert k ._local_range == [10 , 10 ]
64
70
65
71
66
72
def test_2D_global_range_and_2D_local_range3 ():
67
- k = vecadd [(10 , 10 ), [10 , 10 ]]
68
- assert k ._global_range == [10 , 10 ]
69
- assert k ._local_range == [10 , 10 ]
73
+ with pytest .deprecated_call ():
74
+ k = vecadd [(10 , 10 ), [10 , 10 ]]
75
+ assert k ._global_range == [10 , 10 ]
76
+ assert k ._local_range == [10 , 10 ]
70
77
71
78
72
79
def test_2D_global_range_and_2D_local_range4 ():
73
- k = vecadd [[ 10 , 10 ], [ 10 , 10 ] ]
80
+ k = vecadd [dpex . NdRange (( 10 , 10 ), ( 10 , 10 )) ]
74
81
assert k ._global_range == [10 , 10 ]
75
82
assert k ._local_range == [10 , 10 ]
76
83
@@ -119,27 +126,32 @@ def test_unknown_global_range_error():
119
126
120
127
def test_illegal_kernel_launch_arg1 ():
121
128
with pytest .raises (InvalidKernelLaunchArgsError ):
122
- vecadd [()]
129
+ with pytest .deprecated_call ():
130
+ vecadd [()]
123
131
124
132
125
133
def test_illegal_kernel_launch_arg2 ():
126
134
with pytest .raises (InvalidKernelLaunchArgsError ):
127
- vecadd [10 , 10 , []]
135
+ with pytest .deprecated_call ():
136
+ vecadd [10 , 10 , []]
128
137
129
138
130
139
def test_illegal_range_error1 ():
131
140
with pytest .raises (IllegalRangeValueError ):
132
- vecadd [[], []]
141
+ with pytest .deprecated_call ():
142
+ vecadd [[], []]
133
143
134
144
135
145
def test_illegal_range_error2 ():
136
146
with pytest .raises (IllegalRangeValueError ):
137
- vecadd [[], 10 ]
147
+ with pytest .deprecated_call ():
148
+ vecadd [[], 10 ]
138
149
139
150
140
151
def test_illegal_range_error3 ():
141
152
with pytest .raises (IllegalRangeValueError ):
142
- vecadd [(), 10 ]
153
+ with pytest .deprecated_call ():
154
+ vecadd [(), 10 ]
143
155
144
156
145
157
if __name__ == "__main__" :
0 commit comments