-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add setup.py It is initial draft version. * Replace numba.dppl with numba_dppy Now numba.dppl is placed in separate package numba_dppy. * Import numba_dppy as dppl Previousply it was `from numba import dppl`. Now it is `import numba_dppy as dppl`. * Import numba_dppy with its name and 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`. * Add version, url, author and classifiers to setup.py This parameters are necessary for PyPI. * Add conda-recipe * Use dppy in dispatcher_registry and TargetDispatcher `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`. * Use --single-version-externally-managed This flag configure installation of `numba_dppy` as folder in `site-packages`. The folder is required for installing compiled spirv code to it. * Add compilation of SPIRV code * Add dependency to numba and dpctl in conda recipe * Add MANIFEST.in
- Loading branch information
1 parent
ba734fc
commit f0e3d2a
Showing
55 changed files
with
260 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include MANIFEST.in | ||
include README.md setup.py LICENSE | ||
|
||
recursive-include numba_dppy *.cl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt | ||
if errorlevel 1 exit 1 | ||
|
||
echo "Activating oneAPI compiler environment..." | ||
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat" | ||
if errorlevel 1 exit 1 | ||
REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted. | ||
set ERRORLEVEL= | ||
|
||
echo on | ||
|
||
set "CC=clang.exe" | ||
|
||
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
${PYTHON} setup.py install --single-version-externally-managed --record=record.txt | ||
|
||
|
||
if [ ! -z "${ONEAPI_ROOT}" ]; then | ||
source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh | ||
export CC=clang | ||
else | ||
echo "DPCPP is needed to build OpenCL kernel. Abort!" | ||
fi | ||
|
||
${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 | ||
cp numba_dppy/ocl/atomics/atomic_ops.spir ${SP_DIR}/numba_dppy/ocl/atomics/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package: | ||
name: numba-dppy | ||
version: {{ GIT_DESCRIBE_TAG }} | ||
|
||
source: | ||
path: .. | ||
|
||
build: | ||
number: {{ GIT_DESCRIBE_NUMBER }} | ||
script_env: | ||
- ONEAPI_ROOT | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
host: | ||
- python | ||
- setuptools | ||
- cython | ||
- llvm-spirv | ||
- numba | ||
- dpctl | ||
run: | ||
- python | ||
- numba >=0.51 | ||
- dpctl | ||
- spirv-tools | ||
- llvm-spirv | ||
- dpnp | ||
|
||
about: | ||
home: https://github.com/IntelPython/numba-dppy | ||
license: BSD-2-Clause | ||
license_file: LICENSE | ||
summary: "Numba extension for Intel CPU and GPU backend" | ||
description: | | ||
<strong>LEGAL NOTICE: Use of this software package is subject to the | ||
software license agreement (as set forth above, in the license section of | ||
the installed Conda package and/or the README file) and all notices, | ||
disclaimers or license terms for third party or open source software | ||
included in or with the software.</strong> | ||
<br/><br/> | ||
EULA: <a href="https://opensource.org/licenses/BSD-2-Clause" target="_blank">BSD-2-Clause</a> | ||
<br/><br/> | ||
extra: | ||
recipe-maintainers: | ||
- PokhodenkoSA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
python -m numba.runtests -b -v -m -- numba_dppy.tests | ||
IF %ERRORLEVEL% NEQ 0 exit /B 1 | ||
|
||
exit /B 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
python -m numba.runtests -b -v -m -- numba_dppy.tests | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
import math | ||
import time | ||
|
||
from numba import dppl | ||
import numba_dppy, numba_dppy as dppl | ||
import dpctl | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.