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

Commit f5ccb01

Browse files
PokhodenkoSAreazulhoque
authored andcommitted
Rename DPPy to DPPL in code.
In some cases it is better to use Dppl as prefix for class names.
1 parent 6c67922 commit f5ccb01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+809
-810
lines changed

HowTo.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
Features
33
========
44

5-
DPPy is currently implemented using OpenCL 2.1. The features currently available
5+
DPPL is currently implemented using OpenCL 2.1. The features currently available
66
are listed below with the help of sample code snippets. In this release we have
77
the implementation of the OAK approach described in MS138 in section 4.3.2. The
88
new decorator is described below.
99

10-
To access the features driver module have to be imported from numba.dppy.dppy_driver
10+
To access the features driver module have to be imported from numba.dppl.dppl_driver
1111

1212
New Decorator
1313
=============
1414

15-
The new decorator included in this release is *dppy.kernel*. Currently this decorator
15+
The new decorator included in this release is *dppl.kernel*. Currently this decorator
1616
takes only one option *access_types* which is explained below with the help of an example.
1717
Users can write OpenCL tpye kernels where they can identify the global id of the work item
1818
being executed. The supported methods inside a decorated function are:
1919

20-
- dppy.get_global_id(dimidx)
21-
- dppy.get_local_id(dimidx)
22-
- dppy.get_group_num(dimidx)
23-
- dppy.get_num_groups(dimidx)
24-
- dppy.get_work_dim()
25-
- dppy.get_global_size(dimidx)
26-
- dppy.get_local_size(dimidx)
20+
- dppl.get_global_id(dimidx)
21+
- dppl.get_local_id(dimidx)
22+
- dppl.get_group_num(dimidx)
23+
- dppl.get_num_groups(dimidx)
24+
- dppl.get_work_dim()
25+
- dppl.get_global_size(dimidx)
26+
- dppl.get_local_size(dimidx)
2727

2828
Currently no support is provided for local memory in the device and everything is in the
2929
global memory. Barrier and other memory fences will be provided once support for local
@@ -61,7 +61,7 @@ Primitive types are passed by value to the kernel, currently supported are int,
6161
Math Kernels
6262
============
6363

64-
This release has support for math kernels. See numba/dppy/tests/dppy/test_math_functions.py
64+
This release has support for math kernels. See numba/dppl/tests/dppl/test_math_functions.py
6565
for more details.
6666

6767

@@ -72,7 +72,7 @@ Examples
7272
Sum of two 1d arrays
7373
====================
7474

75-
Full example can be found at numba/dppy/examples/sum.py.
75+
Full example can be found at numba/dppl/examples/sum.py.
7676

7777
To write a program that sums two 1d arrays we at first need a OpenCL device environment.
7878
We can get the environment by using *ocldrv.runtime.get_gpu_device()* for getting the
@@ -82,7 +82,7 @@ where *device_env.copy_array_to_device(data)* will read the ndarray and copy tha
8282
and *ocldrv.DeviceArray(device_env.get_env_ptr(), data)* will create a buffer in the device
8383
that has the same memory size as the ndarray being passed. The OpenCL Kernel in the
8484
folllowing example is *data_parallel_sum*. To get the id of the work item we are currently
85-
executing we need to use the *dppy.get_global_id(0)*, since this example only 1 dimension
85+
executing we need to use the *dppl.get_global_id(0)*, since this example only 1 dimension
8686
we only need to get the id in dimension 0.
8787

8888
While invoking the kernel we need to pass the device environment and the global work size.
@@ -91,9 +91,9 @@ back to the host and we can use *device_env.copy_array_from_device(ddata)*.
9191

9292
.. code-block:: python
9393
94-
@dppy.kernel
94+
@dppl.kernel
9595
def data_parallel_sum(a, b, c):
96-
i = dppy.get_global_id(0)
96+
i = dppl.get_global_id(0)
9797
c[i] = a[i] + b[i]
9898
9999
global_size = 10
@@ -126,7 +126,7 @@ ndArray Support
126126

127127
Support for passing ndarray directly to kernels is also supported.
128128

129-
Full example can be found at numba/dppy/examples/sum_ndarray.py
129+
Full example can be found at numba/dppl/examples/sum_ndarray.py
130130

131131
For availing this feature instead of creating device buffers explicitly like the previous
132132
example, users can directly pass the ndarray to the kernel. Internally it will result in
@@ -148,7 +148,7 @@ Reduction
148148

149149
This example will demonstrate a sum reduction of 1d array.
150150

151-
Full example can be found at numba/dppy/examples/sum_reduction.py.
151+
Full example can be found at numba/dppl/examples/sum_reduction.py.
152152

153153
In this example to sum the 1d array we invoke the Kernel multiple times.
154154
This can be implemented by invoking the kernel once, but that requires
@@ -161,15 +161,15 @@ ParFor Support
161161

162162
*Parallel For* is supported in this release for upto 3 dimensions.
163163

164-
Full examples can be found in numba/dppy/examples/pa_examples/
164+
Full examples can be found in numba/dppl/examples/pa_examples/
165165

166166

167167
=======
168168
Testing
169169
=======
170170

171-
All examples can be found in numba/dppy/examples/
171+
All examples can be found in numba/dppl/examples/
172172

173-
All tests can be found in numba/dppy/tests/dppy and can be triggered by the following command:
173+
All tests can be found in numba/dppl/tests/dppl and can be triggered by the following command:
174174

175-
``python -m numba.runtests numba.dppy.tests``
175+
``python -m numba.runtests numba.dppl.tests``

README.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
DPPY
2+
DPPL
33
====
44

55
========
66
1. What?
77
========
88

9-
DPPy proof-of-concept backend for NUMBA to support compilation for Intel CPU and
10-
GPU architectures. The present implementation of DPPy is based on OpenCL 2.1,
9+
DPPL proof-of-concept backend for NUMBA to support compilation for Intel CPU and
10+
GPU architectures. The present implementation of DPPL is based on OpenCL 2.1,
1111
but is likely to change in the future to rely on Sycl/DPC++ or Intel Level-0
1212
driver API.
1313

@@ -22,57 +22,57 @@ driver API.
2222
- Cmake : For managing build process of dependencies
2323
- Python3 : Version 3 is required
2424
- Conda or miniconda : Can be found at https://docs.conda.io/en/latest/miniconda.html
25-
- OpenCL 2.1 driver : DPPy currently works for both Intel GPUs and CPUs is a correct OpenCL driver version is found on the system.
25+
- OpenCL 2.1 driver : DPPL currently works for both Intel GPUs and CPUs is a correct OpenCL driver version is found on the system.
2626
Note. To use the GPU users should be added to "video" user group on Linux systems.
2727

2828

2929
The following requisites will need to be present in the system. Refer to next section for more details.
3030
*******************************************************************************************************
3131

32-
- NUMBA v0.48 : The DPPy backend has only been tested for NUMBA v0.48. The included install script downloads and applies the DDPy patch to the correct NUMBA version.
32+
- NUMBA v0.48 : The DPPL backend has only been tested for NUMBA v0.48. The included install script downloads and applies the DDPy patch to the correct NUMBA version.
3333

3434
- LLVM-SPIRV translator: Used for SPIRV generation from LLVM IR.
3535

3636
- LLVMDEV : To support LLVM IR generation.
3737

38-
- Others : All existing dependecies for NUMBA, such as llvmlite, also apply to DPPy.
38+
- Others : All existing dependecies for NUMBA, such as llvmlite, also apply to DPPL.
3939

4040
==================
4141
3. How to install?
4242
==================
4343
Install Pre-requisites
4444
*************************
45-
Make sure the dependencies of NUMBA-DPPY are installed in the system, for convenience
45+
Make sure the dependencies of NUMBA-DPPL are installed in the system, for convenience
4646
and to make sure the dependencies are installed with consistent version of LLVM we provide
4747
installation script that will create a CONDA environment and install LLVM-SPIRV translator,
4848
SPIRV-Tools and llvmlite in that environment. **To use this CONDA has to be available in the system**.
4949

50-
The above mentioned installation script can be found `here <https://github.intel.com/SAT/numba-dppy-build-scripts>`_. Please follow the README to run the installation script.
50+
The above mentioned installation script can be found `here <https://github.intel.com/SAT/numba-dppl-build-scripts>`_. Please follow the README to run the installation script.
5151

5252
After successful installation the following message should be displayed:
5353

5454
| #
5555
| # Use the following to activate the correct environment
5656
| #
57-
| # ` $ ``conda activate numba-dppy-env`` `
57+
| # ` $ ``conda activate numba-dppl-env`` `
5858
| #
5959
| # Use the following to deactivate environment
6060
| #
6161
| # ` $ ``conda deactivate`` `
6262
63-
The installer script creates a new conda environment called numba-dppy-env with
64-
all the needed dependencies already installed. **Please activate the numba-dppy-env before proceeding**.
63+
The installer script creates a new conda environment called numba-dppl-env with
64+
all the needed dependencies already installed. **Please activate the numba-dppl-env before proceeding**.
6565

6666

67-
Install DPPY backend
67+
Install DPPL backend
6868
***********************
69-
NUMBA-DPPY also depend on DPPY backend. It can be found `here <https://github.intel.com/SAT/dppy>`_. Please run
70-
`build_for_develop.sh` to install DPPY backend.
69+
NUMBA-DPPL also depend on DPPL backend. It can be found `here <https://github.com/IntelPython/PyDPPL>`_. Please run
70+
`build_for_develop.sh` to install DPPL backend.
7171

72-
Install NUMBA-DPPY
72+
Install NUMBA-DPPL
7373
*********************
74-
After all the dependencies are installed please run ``build_for_develop.sh`` to get a local installation of NUMBA-DPPY. **Both step 2 and 3 assumes CONDA environment with
75-
the dependencies of NUMBA-DPPY installed in it, was activated**.
74+
After all the dependencies are installed please run ``build_for_develop.sh`` to get a local installation of NUMBA-DPPL. **Both step 2 and 3 assumes CONDA environment with
75+
the dependencies of NUMBA-DPPL installed in it, was activated**.
7676

7777
================
7878
4. Running tests
@@ -81,11 +81,11 @@ the dependencies of NUMBA-DPPY installed in it, was activated**.
8181
To make sure the installation was successful, try running the examples and the
8282
test suite:
8383

84-
$PATH_TO_NUMBA-DPPY/numba/dppy/examples/
84+
$PATH_TO_NUMBA-DPPL/numba/dppl/examples/
8585

8686
To run the test suite execute the following:
8787

88-
$ ``python -m numba.runtests numba.dppy.tests``
88+
$ ``python -m numba.runtests numba.dppl.tests``
8989

9090
===========================
9191
5. How Tos and Known Issues
@@ -94,7 +94,7 @@ To run the test suite execute the following:
9494
Refer the HowTo.rst guide for an overview of the programming semantics,
9595
examples, supported functionalities, and known issues.
9696

97-
*Installing while Intel OneAPI basekit is actvated have shown to throw error while installation of NUMBA-DPPY because of incompatible TBB interface, one way around that is to temporaily move env variable TBBROOT to something else*
97+
*Installing while Intel OneAPI basekit is actvated have shown to throw error while installation of NUMBA-DPPL because of incompatible TBB interface, one way around that is to temporaily move env variable TBBROOT to something else*
9898

9999

100100
===================

buildscripts/condarecipe.dppy/meta.yaml renamed to buildscripts/condarecipe.pydppl/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ requirements:
3535
- llvmlite >=0.31.*
3636
# TBB devel version is to match TBB libs
3737
- tbb-devel >=2019.5 # [not ((armv6l or armv7l or aarch64) or (win and py27))]
38-
- dppy
38+
- pydppl
3939
run:
4040
- python >=3.6
4141
- numpy >=1.17
4242
- setuptools
4343
# On channel https://anaconda.org/numba/
4444
- llvmlite >=0.31.*
45-
- dppy
45+
- pydppl
4646
- spirv-tools
4747
- llvm-spirv
4848
run_constrained:

numba/core/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ def optional_str(x):
218218
DUMP_IR = _readenv("NUMBA_DUMP_IR", int,
219219
DEBUG_FRONTEND or DEBUG_TYPEINFER)
220220

221-
# Save intermediate files being generated by DPPy
222-
SAVE_DPPY_IR_FILES = _readenv("NUMBA_SAVE_DPPY_IR_FILES", int, 0)
221+
# Save intermediate files being generated by DPPL
222+
SAVE_DPPL_IR_FILES = _readenv("NUMBA_SAVE_DPPL_IR_FILES", int, 0)
223223

224224
# Turn SPIRV-VALIDATION ON/OFF switch
225225
SPIRV_VAL = _readenv("NUMBA_SPIRV_VAL", int, 0)

numba/core/cpu_dispatcher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class CPUDispatcher(dispatcher.Dispatcher):
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
1010
'offload' in targetoptions['parallel'] and targetoptions['parallel']['offload'] == True):
11-
import numba.dppy_config as dppy_config
12-
if dppy_config.dppy_present:
13-
from numba.dppy.compiler import DPPyCompiler
11+
import numba.dppl_config as dppl_config
12+
if dppl_config.dppl_present:
13+
from numba.dppl.compiler import DPPLCompiler
1414
dispatcher.Dispatcher.__init__(self, py_func, locals=locals,
15-
targetoptions=targetoptions, impl_kind=impl_kind, pipeline_class=DPPyCompiler)
15+
targetoptions=targetoptions, impl_kind=impl_kind, pipeline_class=DPPLCompiler)
1616
else:
1717
print("---------------------------------------------------------------------------")
1818
print("WARNING : offload=True option ignored. Ensure OpenCL drivers are installed.")

numba/core/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def wrapper(func):
184184
return cuda.jit(func)
185185
if config.DISABLE_JIT and not target == 'npyufunc':
186186
return func
187-
if target == 'dppy':
188-
from . import dppy
189-
return dppy.jit(func)
187+
if target == 'dppl':
188+
from . import dppl
189+
return dppl.jit(func)
190190
disp = dispatcher(py_func=func, locals=locals,
191191
targetoptions=targetoptions,
192192
**dispatcher_args)

numba/core/lowering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ def emit_environment_object(self):
172172
self.context.declare_env_global(self.module, envname)
173173

174174
def lower(self):
175-
# DRD : Add this hack for the time ebing. Having a global env pointer,
176-
# even if it is a null pointer, breaks spirv-val.
175+
# DRD : Add this hack for the time ebing. Having a global env pointer,
176+
# even if it is a null pointer, breaks spirv-val.
177177
context_name = getattr(self.context, 'context_name', '')
178-
if not context_name in ("dppy.jit",):
178+
if not context_name in ("dppl.jit",):
179179
# Emit the Env into the module
180180
self.emit_environment_object()
181181

numba/core/typing/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@ def resolve_argument_type(self, val):
355355
try:
356356
return typeof(val, Purpose.argument)
357357
except ValueError:
358-
from numba.dppy_config import dppy_present, DeviceArray
359-
if dppy_present:
358+
from numba.dppl_config import dppl_present, DeviceArray
359+
if dppl_present:
360360
if(type(val) == DeviceArray):
361361
return typeof(val._ndarray, Purpose.argument)
362362
# DRD : Hmmm... is the assumption that this error is encountered
363363
# when someone is using cuda, and already has done an import
364-
# cuda?
364+
# cuda?
365365
#elif numba.cuda.is_cuda_array(val):
366366
# return typeof(numba.cuda.as_cuda_array(val), Purpose.argument)
367367
else:
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
NUMBA Version 0.48.0 + DPPY Version 0.3.0 (June 29, 2020)
1+
NUMBA Version 0.48.0 + DPPL Version 0.3.0 (June 29, 2020)
22
--------------------------------------------------------
33

44
This release includes:
55

6-
* Caching of dppy.kernels which will improve performance.
6+
* Caching of dppl.kernels which will improve performance.
77
* Addition of support for Intel Advisor which will help in profiling applications.
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
"""
2-
Module to interact with Intel and other SPIR-V based devices
3-
"""
4-
from __future__ import print_function, absolute_import, division
5-
6-
from numba import config
7-
import numba.testing
8-
9-
from numba.dppy_config import *
10-
if dppy_present:
11-
from .device_init import *
12-
else:
13-
raise ImportError("Importing dppy failed")
14-
15-
def test(*args, **kwargs):
16-
if not dppy_present and not is_available():
17-
dppy_error()
18-
19-
return numba.testing.test("numba.dppy.tests", *args, **kwargs)
1+
"""
2+
Module to interact with Intel and other SPIR-V based devices
3+
"""
4+
from __future__ import print_function, absolute_import, division
5+
6+
from numba import config
7+
import numba.testing
8+
9+
from numba.dppl_config import *
10+
if dppl_present:
11+
from .device_init import *
12+
else:
13+
raise ImportError("Importing dppl failed")
14+
15+
def test(*args, **kwargs):
16+
if not dppl_present and not is_available():
17+
dppl_error()
18+
19+
return numba.testing.test("numba.dppl.tests", *args, **kwargs)

numba/dppy/codegen.py renamed to numba/dppl/codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from numba.core import utils
66

77

8-
SPIR_TRIPLE = {32: ' spir-unknown-unknown',
8+
SPIR_TRIPLE = {32: ' spir-unknown-unknown',
99
64: 'spir64-unknown-unknown'}
1010

1111
SPIR_DATA_LAYOUT = {
@@ -41,7 +41,7 @@ def _finalize_specific(self):
4141

4242
def get_asm_str(self):
4343
# Return nothing: we can only dump assembler code when it is later
44-
# generated (in numba.dppy.compiler).
44+
# generated (in numba.dppl.compiler).
4545
return None
4646

4747

0 commit comments

Comments
 (0)