Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9be01c5
Add backend setup
roaffix Aug 10, 2023
af7c6d3
Refactoring
roaffix Aug 10, 2023
1eae6d0
Refactoring
roaffix Aug 10, 2023
7981cb3
Refactoring
roaffix Aug 10, 2023
4fae55c
Even more refactoring
roaffix Aug 10, 2023
2accd0a
Refactor backend
roaffix Aug 10, 2023
cd7dbb6
Minor refactoring
roaffix Aug 10, 2023
5d90490
Refactor
roaffix Aug 10, 2023
cb8fed9
Refactoring
roaffix Aug 10, 2023
2c96548
Refactoring
roaffix Aug 11, 2023
a6907e0
Add backend helpers
roaffix Aug 11, 2023
485ca8d
Remove c_backend constants
roaffix Aug 11, 2023
dd0180b
Rename dirs
roaffix Aug 11, 2023
6774dd4
Fix c approach
roaffix Aug 11, 2023
cf0ba2d
Fix typings. Fix tests and array_api initialisation
roaffix Aug 11, 2023
d5c4cc0
Change dtypes structure
roaffix Aug 11, 2023
6621c8f
Change project structure
roaffix Aug 11, 2023
985f333
Refactor to avoid missunderstanding with import *
roaffix Aug 16, 2023
eabc241
Remove pointer source from array init
roaffix Aug 16, 2023
1ff492d
operations refactoring
roaffix Aug 17, 2023
8a33376
Temp commit
roaffix Aug 19, 2023
cb849e3
Add lots of code
roaffix Sep 1, 2023
0e185e8
Add random. Add data
roaffix Sep 1, 2023
92b0801
Fix tests. Add utils
roaffix Sep 2, 2023
b792366
Add typings from 3.10
roaffix Sep 2, 2023
f626d53
Add reduction operations. Add array methods
roaffix Sep 2, 2023
850e658
Fix bug with sum method. Add some test cases
roaffix Sep 2, 2023
771aa96
Fix typing
roaffix Sep 2, 2023
895fabd
On-call changes. Added vanilla sync, get_device
roaffix Sep 2, 2023
a46a265
Hotfixes
roaffix Sep 12, 2023
03f0e2d
Minir changes in str notes
roaffix Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- master

env:
DEFAULT_PYTHON_VERSION: "3.8"
DEFAULT_PYTHON_VERSION: "3.10"

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[settings]
line_length = 119
multi_line_output = 4
profile = black
228 changes: 222 additions & 6 deletions arrayfire/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,236 @@
__all__ = [
# array objects
"Array",
# dtypes
# flake8: noqa
from .version import ARRAYFIRE_VERSION, VERSION

__all__ = ["__version__"]
__version__ = VERSION

__all__ += ["__arrayfire_version__"]
__arrayfire_version__ = ARRAYFIRE_VERSION

__all__ += ["Array"]
from .array_object import Array

__all__ += [
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"float16",
"float32",
"float64",
"complex64",
"complex128",
"bool",
]

from .dtypes import bool, complex64, complex128, float32, float64, int16, int32, int64, uint8, uint16, uint32, uint64
from .library.array_object import Array
from .dtypes import (
bool,
complex64,
complex128,
float16,
float32,
float64,
int8,
int16,
int32,
int64,
uint8,
uint16,
uint32,
uint64,
)

__all__ += [
"get_backend",
"get_active_backend", # DeprecationWarning
"get_array_backend_name",
"get_array_device_id",
"get_available_backends", # DeprecationWarning
"get_backend_count",
"get_backend_id", # DeprecationWarning
"get_device_id", # DeprecationWarning
"get_dtype_size",
"get_size_of", # DeprecationWarning
"set_backend",
]

from .backend._backend import get_backend
from .backend._backend_functions import (
get_active_backend,
get_array_backend_name,
get_array_device_id,
get_available_backends,
get_backend_count,
get_backend_id,
get_device_id,
get_dtype_size,
get_size_of,
set_backend,
)

__all__ += [
"add",
"sub",
"mul",
"div",
"mod",
"pow",
"bitnot",
"bitand",
"bitor",
"bitxor",
"bitshiftl",
"bitshiftr",
"lt",
"le",
"gt",
"ge",
"eq",
"neq",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"atan2",
"sinh",
"cosh",
"tanh",
"asinh",
"acosh",
"atanh",
"exp",
"expm1",
"log",
"log1p",
"log2",
"log10",
"sqrt",
"cbrt",
"hypot",
"erf",
"erfc",
"tgamma",
"lgamma",
"pow2",
"sign",
"abs",
"ceil",
"floor",
"round",
"trunc",
"isinf",
"isnan",
"iszero",
"isinf",
"isnan",
"iszero",
"isinf",
"isnan",
"clamp",
"arg",
"conjg",
"cplx",
"imag",
"factorial",
"maxof",
"minof",
"real",
"rem",
"root",
"rsqrt",
"sigmoid",
"land",
"lor",
"lnot",
]


from .library.operators import (
abs,
acos,
acosh,
add,
arg,
asin,
asinh,
atan,
atan2,
atanh,
bitand,
bitnot,
bitor,
bitshiftl,
bitshiftr,
bitxor,
cbrt,
ceil,
conjg,
cos,
cosh,
cplx,
div,
eq,
erf,
erfc,
exp,
expm1,
factorial,
floor,
ge,
gt,
hypot,
imag,
isinf,
isnan,
iszero,
land,
le,
lgamma,
lnot,
log,
log1p,
log2,
log10,
lor,
lt,
maxof,
minof,
mod,
mul,
neq,
pow,
pow2,
real,
rem,
root,
round,
rsqrt,
sigmoid,
sign,
sin,
sinh,
sqrt,
sub,
tan,
tanh,
tgamma,
trunc,
)

__all__ += ["constant", "range", "identity", "flat"]

from arrayfire.library.data import constant, flat, identity, range

__all__ += ["randu"]

from arrayfire.library.random import randu

__all__ += ["all_true", "any_true"]

from arrayfire.library.vector_algorithms import all_true, any_true
43 changes: 43 additions & 0 deletions arrayfire/array_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# flake8: noqa

__array_api_version__ = "2022.12"

__all__ = ["__array_api_version__"]

from ._constants import Device

__all__ += ["Device"]

from ._creation_function import asarray

__all__ += ["asarray"]

from ._dtypes import (
bool,
complex64,
complex128,
float32,
float64,
int8,
int16,
int32,
int64,
uint8,
uint16,
uint32,
uint64,
)

__all__ += [
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"float32",
"float64",
"bool",
]
Loading