Skip to content
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

Test utilities #28

Closed
wants to merge 5 commits into from
Closed
Changes from 2 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
15 changes: 15 additions & 0 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import arrayfire_wrapper.lib as wrapper

from arrayfire_wrapper.dtypes import f64, c32, c64, Dtype


def is_cmplx_type(dtype: Dtype) -> bool:
"""Checks to see if the specified type is a complex type"""
return dtype == c32 or dtype == c64


def is_system_supported(dtype: Dtype) -> bool:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def is_system_supported(dtype: Dtype) -> bool:
def is_type_supported(dtype: Dtype) -> bool:

You want to do the same for f16 if we are supporting that

"""Checks to see if the specified type is supported by the current system"""
if dtype in [f64, c64] and not wrapper.get_dbl_support():
return False
return True
Loading