Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 5 additions & 12 deletions arrayfire_wrapper/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,13 @@ def _get_backend_path_config() -> _BackendPathConfig:
platform_name = platform.system()
cuda_found = False

# try to use user provided AF_PATH if explicitly set
try:
af_path = Path(os.environ["AF_PATH"])
af_is_user_path = True
except KeyError:
af_path = None
af_is_user_path = False
# Try to use user provided AF_PATH if explicitly set
af_path = os.environ.get("AF_PATH", None)
af_is_user_path = af_path is not None

try:
cuda_path = Path(os.environ["CUDA_PATH"])
except KeyError:
cuda_path = None
cuda_path = os.environ.get("CUDA_PATH", None)

# try to find default arrayfire installation paths
# Try to find default arrayfire installation paths
if platform_name == _SupportedPlatforms.windows.value or _SupportedPlatforms.is_cygwin(platform_name):
if platform_name == _SupportedPlatforms.windows.value:
# HACK Supressing crashes caused by missing dlls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def eval_multiple(num: int, /, *arrs: AFArray) -> None:
"""
source: https://arrayfire.org/docs/group__c__api__mat.htm#ga9e08f4cda2471a477d2fa91c2356f72c
"""
call_from_clib(eval_multiple.__name__, ctypes.c_int(num), ctypes.pointer(arrs))
ctypes_arrs = (ctypes.c_void_p * num)(*[arr for arr in arrs])

call_from_clib(eval_multiple.__name__, ctypes.c_int(num), ctypes.pointer(ctypes_arrs))
return None


Expand Down