Skip to content

Conversation

PokhodenkoSA
Copy link
Contributor

@PokhodenkoSA PokhodenkoSA commented Nov 12, 2020

Now with setup.py it is possible to install and run tests. Via tests I have faced with many access to numba.dppl.
This PR also replaces access like numba.dppl to numba_dppy.
Some code uses @dppl.kernel. For this cases import numba_dppy as dppl. It could be renamed to dppy in separate PR.
Now tests passed (should recheck on clean numba). Commands:

python setup.py develop
python -m unittest -v numba_dppy.tests

Related to:

It is initial draft version.
Now numba.dppl is placed in separate package numba_dppy.
Previousply it was `from numba import dppl`.
Now it is `import numba_dppy as dppl`.
There are many places in code which access to `numba_dppy`.
Previously it was `numba.dppl`. It was accessible because
`from numba import dppl`.
This parameters are necessary for PyPI.
`dispatcher_registry.ondemand['dppl'] = init_jit` can be used only one
time. So `dppl` was renamed to `dppy`.
Also in class TargetDispatcher field `target_dppl = 'dppl'` renamed to
`dppy`.
This flag configure installation of `numba_dppy` as folder in
`site-packages`. The folder is required for installing compiled spirv
code to it.
Comment on lines +14 to +16
%CC% -flto -target spir64-unknown-unknown -c -x cl -emit-llvm -cl-std=CL2.0 -Xclang -finclude-default-header numba_dppy/ocl/atomics/atomic_ops.cl -o numba_dppy/ocl/atomics/atomic_ops.bc
llvm-spirv -o numba_dppy/ocl/atomics/atomic_ops.spir numba_dppy/ocl/atomics/atomic_ops.bc
xcopy numba_dppy\ocl\atomics\atomic_ops.spir %SP_DIR%\numba_dppy\ocl\atomics /E /Y
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move SPIRV compilation to setup.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- dpctl
- spirv-tools
- llvm-spirv
- dpnp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dpNP is optional dependency

---------------------------------------------------------------------------
import numpy as np
from numba import dppl
import numba_dppy, numba_dppy as dppl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename dppl to dppy.


metadata = dict(
name="numba-dppy",
version="0.0.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use versioneer.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant