exclude half with PYTHON in test_dtype.is_dtype_supported (#3351)

half memoryview only in 3.12+. rest of the test_dtype (bounty) seems to be legit issue in ops_python.
This commit is contained in:
chenyu
2024-02-08 20:10:25 -05:00
committed by GitHub
parent c32ea95d7d
commit 7c1c6efee5

View File

@@ -21,7 +21,8 @@ def is_dtype_supported(dtype: DType, device: str = Device.DEFAULT):
# for CI GPU, cl_khr_fp16 isn't supported
# for CI LLVM, it segfaults because it can't link to the casting function
# CUDA in CI uses CUDACPU that does not support half
if dtype == dtypes.half: return not (CI and device in ["GPU", "LLVM", "CUDA"])
# PYTHON supports half memoryview in 3.12+ https://github.com/python/cpython/issues/90751
if dtype == dtypes.half: return not (CI and device in ["GPU", "LLVM", "CUDA"]) and device != "PYTHON"
if dtype == dtypes.float64: return device != "METAL" and not (OSX and device == "GPU")
return True