-
-
Notifications
You must be signed in to change notification settings - Fork 8
Updating Quaddtype #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Updating Quaddtype #102
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
0a36a9d
added readme
SwayamInSync d56e592
renaming module and adding initial longdouble backend support
SwayamInSync 8408227
added ld backend support to casting
SwayamInSync a652985
added multi backend support to scalar operations
SwayamInSync 7fd8da6
failing: londouble with different dtype
SwayamInSync d664a59
added backend parameter in default descriptor
SwayamInSync 7a85fbf
removed todo comment: umath.cpp
SwayamInSync e8cba6a
temporary solution to handle both backends
SwayamInSync 01e9b7e
post-cleaning
SwayamInSync 22982a4
adding dragon4
SwayamInSync 7b43f3b
fixing reduction redorderable issue
SwayamInSync 04480ce
np.dot WIP
SwayamInSync 755e2cd
fixing base
SwayamInSync 0ac5464
added more unary func
SwayamInSync 25dd6b3
removing testing files
SwayamInSync b719ba4
fixing import statements
SwayamInSync fe6cabc
removed unnecessary prints
SwayamInSync 0fba040
added separate aligned and unaligned ufunc support
SwayamInSync 4f0a604
WIP
SwayamInSync 707d5d6
fixed longdouble comparison casting issue
SwayamInSync 0a75b91
aligned and unaligned comparison loops
SwayamInSync 0052e16
Creating Quad with Quad
SwayamInSync 082b64b
exposing constants
SwayamInSync e53edba
resolved reviews
SwayamInSync bbc99a6
fixing constant error
SwayamInSync 012e90f
Merge branch 'dragon4' into constants
SwayamInSync 41ca3f9
added 128-bit common constants
SwayamInSync 2fd9cad
refactoring
SwayamInSync 672be17
added aligned and unaligned casting loops
SwayamInSync 600b2c8
fixed inter-backend cast segment fault
SwayamInSync 77e25b6
made ufunc return actual value instead of 0
SwayamInSync 87a7891
updated meson.build
SwayamInSync 1a6618a
missed the comma :)
SwayamInSync File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
# Numpy-QuadDType | ||
|
||
## Installation | ||
|
||
``` | ||
pip install numpy==2.1.0 | ||
pip install -i https://test.pypi.org/simple/ quaddtype | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
import numpy as np | ||
from numpy_quaddtype import QuadPrecDType, QuadPrecision | ||
|
||
# using sleef backend (default) | ||
np.array([1,2,3], dtype=QuadPrecDType()) | ||
np.array([1,2,3], dtype=QuadPrecDType("sleef")) | ||
|
||
# using longdouble backend | ||
np.array([1,2,3], dtype=QuadPrecDType("longdouble")) | ||
``` | ||
This file contains hidden or 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 hidden or 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,34 @@ | ||
from ._quaddtype_main import ( | ||
QuadPrecision, | ||
QuadPrecDType, | ||
is_longdouble_128, | ||
get_sleef_constant | ||
) | ||
|
||
__all__ = [ | ||
'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision', | ||
'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128', 'pi', 'e', | ||
'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'min_value', 'epsilon' | ||
] | ||
|
||
def SleefQuadPrecision(value): | ||
return QuadPrecision(value, backend='sleef') | ||
|
||
def LongDoubleQuadPrecision(value): | ||
return QuadPrecision(value, backend='longdouble') | ||
|
||
def SleefQuadPrecDType(): | ||
return QuadPrecDType(backend='sleef') | ||
|
||
def LongDoubleQuadPrecDType(): | ||
return QuadPrecDType(backend='longdouble') | ||
|
||
pi = get_sleef_constant("pi") | ||
e = get_sleef_constant("e") | ||
log2e = get_sleef_constant("log2e") | ||
log10e = get_sleef_constant("log10e") | ||
ln2 = get_sleef_constant("ln2") | ||
ln10 = get_sleef_constant("ln10") | ||
max_value = get_sleef_constant("quad_max") | ||
min_value = get_sleef_constant("quad_min") | ||
epsilon = get_sleef_constant("epsilon") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.