Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 6c67922

Browse files
committed
Merge branch 'update/njit_parallel_option' into 'devel'
Rename njit option spirv to offload See merge request mlp-python/NUMBA-DPPY!78
2 parents 1d85494 + 1e75630 commit 6c67922

17 files changed

+83
-83
lines changed

numba/core/cpu_dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class CPUDispatcher(dispatcher.Dispatcher):
77

88
def __init__(self, py_func, locals={}, targetoptions={}, impl_kind='direct', pipeline_class=compiler.Compiler):
99
if ('parallel' in targetoptions and isinstance(targetoptions['parallel'], dict) and
10-
'spirv' in targetoptions['parallel'] and targetoptions['parallel']['spirv'] == True):
10+
'offload' in targetoptions['parallel'] and targetoptions['parallel']['offload'] == True):
1111
import numba.dppy_config as dppy_config
1212
if dppy_config.dppy_present:
1313
from numba.dppy.compiler import DPPyCompiler

numba/core/cpu_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, value):
6464
self.stencil = value.pop('stencil', True)
6565
self.fusion = value.pop('fusion', True)
6666
self.prange = value.pop('prange', True)
67-
self.gen_spirv = value.pop('spirv', False)
67+
self.gen_spirv = value.pop('offload', False)
6868
if value:
6969
msg = "Unrecognized parallel options: %s" % value.keys()
7070
raise NameError(msg)

numba/dppy/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def define_pipelines(self):
5454
# this maintains the objmode fallback behaviour
5555
pms = []
5656
if not self.state.flags.force_pyobject:
57-
print("Numba-DPPY [INFO]: Using Numba-DPPY pipeline")
57+
#print("Numba-DPPY [INFO]: Using Numba-DPPY pipeline")
5858
pms.append(DPPyPassBuilder.define_nopython_pipeline(self.state))
5959
if self.state.status.can_fallback or self.state.flags.force_pyobject:
6060
pms.append(

numba/dppy/examples/blacksholes_njit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def cndf2(inp):
1414
out = 0.5 + 0.5 * math.erf((math.sqrt(2.0)/2.0) * inp)
1515
return out
1616

17-
@numba.njit(parallel={'spirv':True}, fastmath=True)
17+
@numba.njit(parallel={'offload':True}, fastmath=True)
1818
def blackscholes(sptprice, strike, rate, volatility, timev):
1919
logterm = np.log(sptprice / strike)
2020
powterm = 0.5 * volatility * volatility

numba/dppy/examples/pa_examples/test1-2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from numba import njit, gdb
22
import numpy as np
33

4-
@njit(parallel={'spirv':True})
4+
@njit(parallel={'offload':True})
55
def f1(a, b):
66
c = a + b
77
return c

numba/dppy/examples/pa_examples/test1-3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from numba import njit, gdb
22
import numpy as np
33

4-
@njit(parallel={'spirv':True})
4+
@njit(parallel={'offload':True})
55
def f1(a, b):
66
c = a + b
77
return c

numba/dppy/examples/pa_examples/test1-4d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from numba import njit, gdb
22
import numpy as np
33

4-
@njit(parallel={'spirv':True})
4+
@njit(parallel={'offload':True})
55
def f1(a, b):
66
c = a + b
77
return c

numba/dppy/examples/pa_examples/test1-5d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from numba import njit, gdb
22
import numpy as np
33

4-
@njit(parallel={'spirv':True})
4+
@njit(parallel={'offload':True})
55
def f1(a, b):
66
c = a + b
77
return c

numba/dppy/examples/pa_examples/test1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33

44
#@njit(target='dppy')
5-
@njit(parallel={'spirv':True})
5+
@njit(parallel={'offload':True})
66
def f1(a, b):
77
c = a + b
88
return c

numba/dppy/tests/dppy/test_numpy_bit_twiddling_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class TestNumpy_bit_twiddling_functions(DPPYTestCase):
1515
def test_bitwise_and(self):
16-
@njit(parallel={'spirv':True})
16+
@njit(parallel={'offload':True})
1717
def f(a, b):
1818
c = np.bitwise_and(a, b)
1919
return c
@@ -27,7 +27,7 @@ def f(a, b):
2727

2828

2929
def test_bitwise_or(self):
30-
@njit(parallel={'spirv':True})
30+
@njit(parallel={'offload':True})
3131
def f(a, b):
3232
c = np.bitwise_or(a, b)
3333
return c
@@ -41,7 +41,7 @@ def f(a, b):
4141

4242

4343
def test_bitwise_xor(self):
44-
@njit(parallel={'spirv':True})
44+
@njit(parallel={'offload':True})
4545
def f(a, b):
4646
c = np.bitwise_xor(a, b)
4747
return c
@@ -55,7 +55,7 @@ def f(a, b):
5555

5656

5757
def test_bitwise_not(self):
58-
@njit(parallel={'spirv':True})
58+
@njit(parallel={'offload':True})
5959
def f(a):
6060
c = np.bitwise_not(a)
6161
return c
@@ -68,7 +68,7 @@ def f(a):
6868

6969

7070
def test_invert(self):
71-
@njit(parallel={'spirv':True})
71+
@njit(parallel={'offload':True})
7272
def f(a):
7373
c = np.invert(a)
7474
return c
@@ -81,7 +81,7 @@ def f(a):
8181

8282

8383
def test_left_shift(self):
84-
@njit(parallel={'spirv':True})
84+
@njit(parallel={'offload':True})
8585
def f(a, b):
8686
c = np.left_shift(a, b)
8787
return c
@@ -95,7 +95,7 @@ def f(a, b):
9595

9696

9797
def test_right_shift(self):
98-
@njit(parallel={'spirv':True})
98+
@njit(parallel={'offload':True})
9999
def f(a, b):
100100
c = np.right_shift(a, b)
101101
return c

numba/dppy/tests/dppy/test_numpy_comparison_functions.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TestNumpy_comparison_functions(DPPYTestCase):
1414
a = np.array([4,5,6])
1515
b = np.array([2,6,6])
1616
def test_greater(self):
17-
@njit(parallel={'spirv':True})
17+
@njit(parallel={'offload':True})
1818
def f(a, b):
1919
c = np.greater(a, b)
2020
return c
@@ -25,7 +25,7 @@ def f(a, b):
2525

2626

2727
def test_greater_equal(self):
28-
@njit(parallel={'spirv':True})
28+
@njit(parallel={'offload':True})
2929
def f(a, b):
3030
c = np.greater_equal(a, b)
3131
return c
@@ -36,7 +36,7 @@ def f(a, b):
3636

3737

3838
def test_less(self):
39-
@njit(parallel={'spirv':True})
39+
@njit(parallel={'offload':True})
4040
def f(a, b):
4141
c = np.less(a, b)
4242
return c
@@ -47,7 +47,7 @@ def f(a, b):
4747

4848

4949
def test_less_equal(self):
50-
@njit(parallel={'spirv':True})
50+
@njit(parallel={'offload':True})
5151
def f(a, b):
5252
c = np.less_equal(a, b)
5353
return c
@@ -58,7 +58,7 @@ def f(a, b):
5858

5959

6060
def test_not_equal(self):
61-
@njit(parallel={'spirv':True})
61+
@njit(parallel={'offload':True})
6262
def f(a, b):
6363
c = np.not_equal(a, b)
6464
return c
@@ -69,7 +69,7 @@ def f(a, b):
6969

7070

7171
def test_equal(self):
72-
@njit(parallel={'spirv':True})
72+
@njit(parallel={'offload':True})
7373
def f(a, b):
7474
c = np.equal(a, b)
7575
return c
@@ -80,7 +80,7 @@ def f(a, b):
8080

8181

8282
def test_logical_and(self):
83-
@njit(parallel={'spirv':True})
83+
@njit(parallel={'offload':True})
8484
def f(a, b):
8585
c = np.logical_and(a, b)
8686
return c
@@ -94,7 +94,7 @@ def f(a, b):
9494

9595

9696
def test_logical_or(self):
97-
@njit(parallel={'spirv':True})
97+
@njit(parallel={'offload':True})
9898
def f(a, b):
9999
c = np.logical_or(a, b)
100100
return c
@@ -108,7 +108,7 @@ def f(a, b):
108108

109109

110110
def test_logical_xor(self):
111-
@njit(parallel={'spirv':True})
111+
@njit(parallel={'offload':True})
112112
def f(a, b):
113113
c = np.logical_xor(a, b)
114114
return c
@@ -122,7 +122,7 @@ def f(a, b):
122122

123123

124124
def test_logical_not(self):
125-
@njit(parallel={'spirv':True})
125+
@njit(parallel={'offload':True})
126126
def f(a):
127127
c = np.logical_not(a)
128128
return c
@@ -135,7 +135,7 @@ def f(a):
135135

136136

137137
def test_maximum(self):
138-
@njit(parallel={'spirv':True})
138+
@njit(parallel={'offload':True})
139139
def f(a, b):
140140
c = np.maximum(a, b)
141141
return c
@@ -149,7 +149,7 @@ def f(a, b):
149149

150150

151151
def test_minimum(self):
152-
@njit(parallel={'spirv':True})
152+
@njit(parallel={'offload':True})
153153
def f(a, b):
154154
c = np.minimum(a, b)
155155
return c
@@ -163,7 +163,7 @@ def f(a, b):
163163

164164

165165
def test_fmax(self):
166-
@njit(parallel={'spirv':True})
166+
@njit(parallel={'offload':True})
167167
def f(a, b):
168168
c = np.fmax(a, b)
169169
return c
@@ -177,7 +177,7 @@ def f(a, b):
177177

178178

179179
def test_fmin(self):
180-
@njit(parallel={'spirv':True})
180+
@njit(parallel={'offload':True})
181181
def f(a, b):
182182
c = np.fmin(a, b)
183183
return c

numba/dppy/tests/dppy/test_numpy_floating_functions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class TestNumpy_floating_functions(DPPYTestCase):
1313
def test_isfinite(self):
14-
@njit(parallel={'spirv':True})
14+
@njit(parallel={'offload':True})
1515
def f(a):
1616
c = np.isfinite(a)
1717
return c
@@ -25,7 +25,7 @@ def f(a):
2525

2626

2727
def test_isinf(self):
28-
@njit(parallel={'spirv':True})
28+
@njit(parallel={'offload':True})
2929
def f(a):
3030
c = np.isinf(a)
3131
return c
@@ -38,7 +38,7 @@ def f(a):
3838
self.assertTrue(np.all(c == d))
3939

4040
def test_isnan(self):
41-
@njit(parallel={'spirv':True})
41+
@njit(parallel={'offload':True})
4242
def f(a):
4343
c = np.isnan(a)
4444
return c
@@ -52,7 +52,7 @@ def f(a):
5252

5353

5454
def test_floor(self):
55-
@njit(parallel={'spirv':True})
55+
@njit(parallel={'offload':True})
5656
def f(a):
5757
c = np.floor(a)
5858
return c
@@ -65,7 +65,7 @@ def f(a):
6565

6666

6767
def test_ceil(self):
68-
@njit(parallel={'spirv':True})
68+
@njit(parallel={'offload':True})
6969
def f(a):
7070
c = np.ceil(a)
7171
return c
@@ -78,7 +78,7 @@ def f(a):
7878

7979

8080
def test_trunc(self):
81-
@njit(parallel={'spirv':True})
81+
@njit(parallel={'offload':True})
8282
def f(a):
8383
c = np.trunc(a)
8484
return c

0 commit comments

Comments
 (0)