-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from SwayamInSync/quaddtype
Adding Quaddtype
- Loading branch information
Showing
25 changed files
with
1,974 additions
and
557 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,3 +133,4 @@ compile_commands.json | |
|
||
.ruff-cache/ | ||
.asv | ||
.vscode/ |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +0,0 @@ | ||
# quaddtype | ||
|
||
Quad (128-bit) float dtype for numpy | ||
|
||
## Installation | ||
|
||
To install, make sure you have `numpy` nightly installed. Then build without | ||
isolation so that the `quaddtype` can link against the experimental dtype API | ||
headers, which aren't in the latest releases of `numpy`: | ||
|
||
```bash | ||
pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy | ||
pip install . --no-build-isolation | ||
``` | ||
|
||
Developed with Python 3.11, but 3.9 and 3.10 will probably also work. | ||
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 |
---|---|---|
@@ -1,47 +1,56 @@ | ||
project( | ||
'quaddtype', | ||
'c', | ||
) | ||
project('quaddtype', 'c', 'cpp', default_options : ['cpp_std=c++17', 'b_pie=true']) | ||
|
||
py_mod = import('python') | ||
py = py_mod.find_installation() | ||
|
||
c = meson.get_compiler('c') | ||
|
||
sleef_dep = c.find_library('sleef') | ||
sleefquad_dep = c.find_library('sleefquad') | ||
|
||
incdir_numpy = run_command(py, | ||
[ | ||
'-c', | ||
'import numpy; print(numpy.get_include())' | ||
'import numpy; import os; print(os.path.relpath(numpy.get_include()))' | ||
], | ||
check: true | ||
).stdout().strip() | ||
|
||
includes = include_directories( | ||
[ | ||
incdir_numpy, | ||
'quaddtype/src' | ||
] | ||
[ | ||
incdir_numpy, | ||
'quaddtype/src', | ||
] | ||
) | ||
|
||
srcs = [ | ||
'quaddtype/src/umath.c', | ||
'quaddtype/src/casts.c', | ||
'quaddtype/src/dtype.c', | ||
'quaddtype/src/quaddtype_main.c', | ||
'quaddtype/src/casts.h', | ||
'quaddtype/src/casts.cpp', | ||
'quaddtype/src/scalar.h', | ||
'quaddtype/src/scalar.c', | ||
'quaddtype/src/dtype.h', | ||
'quaddtype/src/dtype.c', | ||
'quaddtype/src/quaddtype_main.c', | ||
'quaddtype/src/scalar_ops.h', | ||
'quaddtype/src/scalar_ops.cpp', | ||
'quaddtype/src/ops.hpp', | ||
'quaddtype/src/umath.h', | ||
'quaddtype/src/umath.cpp' | ||
] | ||
|
||
py.install_sources( | ||
[ | ||
'quaddtype/__init__.py', | ||
'quaddtype/quadscalar.py' | ||
], | ||
subdir: 'quaddtype', | ||
pure: false | ||
[ | ||
'quaddtype/__init__.py', | ||
], | ||
subdir: 'quaddtype', | ||
pure: false | ||
) | ||
|
||
py.extension_module( | ||
'_quaddtype_main', | ||
srcs, | ||
c_args: ['-g', '-O0'], | ||
install: true, | ||
subdir: 'quaddtype', | ||
include_directories: includes | ||
) | ||
py.extension_module('_quaddtype_main', | ||
srcs, | ||
c_args: ['-g', '-O0', '-lsleef', '-lsleefquad'], | ||
dependencies: [sleef_dep, sleefquad_dep], | ||
install: true, | ||
subdir: 'quaddtype', | ||
include_directories: includes | ||
) |
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 |
---|---|---|
@@ -1,8 +1 @@ | ||
# Scalar quantity must be defined _before_ the dtype, so don't isort it. | ||
# During initialization of _quaddtype_main, QuadScalar is imported from this | ||
# (partially initialized) | ||
# module, and therefore has to be defined first. | ||
from .quadscalar import QuadScalar # isort: skip | ||
from ._quaddtype_main import QuadDType | ||
|
||
__all__ = ["QuadScalar", "QuadDType"] | ||
from ._quaddtype_main import QuadPrecDType, QuadPrecision |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.