-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a Cython extension to be built in place and used in tests to te…
…st Cython API functions The extension is built in temp folder. Added cython as Cython test dependency Pass --cov-config option to pytest with coverage. This works around coverage config discrepancy between the main process and a subprocess. See pytest-dev/pytest-cov#243 added _cython_api.pyx to flake exception list Exclude dpctl/tests/* and dpctl/_version from coverage reporting Fix loading of Cython extension _cython_api on Windows Add test for property=int usage
- Loading branch information
1 parent
9ac1e2f
commit 97c9702
Showing
8 changed files
with
84 additions
and
3 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
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 |
---|---|---|
|
@@ -32,6 +32,7 @@ requirements: | |
|
||
test: | ||
requires: | ||
- cython | ||
- pytest | ||
- pytest-cov | ||
|
||
|
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,18 @@ | ||
# cython: language=c++ | ||
# cython: language_level=3 | ||
|
||
cimport dpctl as c_dpctl | ||
|
||
import dpctl | ||
|
||
|
||
def call_create_from_context_and_devices(): | ||
cdef c_dpctl.SyclQueue q | ||
d = dpctl.SyclDevice() | ||
ctx = dpctl.SyclContext(d) | ||
# calling static method | ||
q = c_dpctl.SyclQueue._create_from_context_and_device( | ||
<c_dpctl.SyclContext> ctx, | ||
<c_dpctl.SyclDevice> d | ||
) | ||
return q |
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,12 @@ | ||
import setuptools | ||
|
||
import dpctl | ||
|
||
ext = setuptools.Extension( | ||
"_cython_api", | ||
["_cython_api.pyx"], | ||
include_dirs=[dpctl.get_include()], | ||
language="c++", | ||
) | ||
|
||
setuptools.setup(name="_cython_api", version="0.0.0", ext_modules=[ext]) |
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