Skip to content

Commit 4dbbe31

Browse files
author
Chaluvadi
committed
Fixed utility functions for tests pt. 2
1 parent 77931b9 commit 4dbbe31

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_utilities.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import arrayfire_wrapper.lib as wrapper
2+
import pytest
23

3-
from arrayfire_wrapper.dtypes import f64, c32, c64, Dtype
4+
from arrayfire_wrapper.dtypes import f64, f16, c32, c64, Dtype
45

56

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

1011

11-
def is_system_supported(dtype: Dtype) -> bool:
12+
def check_type_supported(dtype: Dtype) -> None:
1213
"""Checks to see if the specified type is supported by the current system"""
1314
if dtype in [f64, c64] and not wrapper.get_dbl_support():
14-
return False
15-
return True
15+
pytest.skip("Device does not support doubel types.")
16+
17+
if dtype == f16 and not wrapper.get_half_support():
18+
pytest.skip("Device does not support half types.")
19+

0 commit comments

Comments
 (0)