Skip to content

Commit e4f2755

Browse files
author
Chaluvadi
committed
Added utility functions for tests
1 parent f90ef61 commit e4f2755

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_utilities.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pytest
2+
3+
import arrayfire_wrapper.lib as wrapper
4+
5+
from arrayfire_wrapper.dtypes import f64, c32, c64, Dtype
6+
7+
def is_cmplx_type(dtype: Dtype) -> bool:
8+
"""Checks to see if the specified type is a complex type"""
9+
return dtype == c32 or dtype == c64
10+
11+
def is_system_supported(dtype: Dtype) -> bool:
12+
"""Checks to see if the specified type is supported by the current system"""
13+
if dtype in [f64, c64] and not wrapper.get_dbl_support():
14+
return False
15+
16+
return True

0 commit comments

Comments
 (0)