From 7d3e1f0b821110d0f735024505154a0b5773eb57 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Tue, 29 Oct 2024 16:41:16 +0000 Subject: [PATCH] Fix check for CL_DEVICE_HALF_FP_CONFIG. (#2108) When cl_khr_fp16 is not supported, this property is not available. Note that the spec is different for CL_DEVICE_{PREFERRED,NATIVE}_VECTOR_WIDTH_HALF: those properties are always available and return 0 if cl_khr_fp16 is not supported, so those checks are left as is. --- test_conformance/api/test_api_consistency.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_conformance/api/test_api_consistency.cpp b/test_conformance/api/test_api_consistency.cpp index f12705ef..974d552d 100644 --- a/test_conformance/api/test_api_consistency.cpp +++ b/test_conformance/api/test_api_consistency.cpp @@ -1274,8 +1274,10 @@ int test_consistency_requirements_fp16(cl_device_id deviceID, { error = clGetDeviceInfo(deviceID, CL_DEVICE_HALF_FP_CONFIG, sizeof(value), &value, nullptr); - test_error(error, "Unable to get device CL_DEVICE_HALF_FP_CONFIG"); - test_assert_error(value == 0, "CL_DEVICE_HALF_FP_CONFIG must return 0"); + test_failure_error( + error, CL_INVALID_VALUE, + "cl_khr_fp16 is not available; CL_DEVICE_HALF_FP_CONFIG must fail " + "with CL_INVALID_VALUE"); error = clGetDeviceInfo(deviceID, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, sizeof(value), &value, nullptr);