libclc: fix convert with half (#99481)

Fix following update of libclc introducing more fp16 support:
7e6a73959a
This commit is contained in:
Romaric Jodin 2024-07-18 15:28:58 +02:00 committed by GitHub
parent d00b35534d
commit d9cb65ff48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,7 @@
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
_CLC_VECTOR_CONVERT_TO1(SUFFIX) \
_CLC_VECTOR_CONVERT_FROM(half, SUFFIX)
#else
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
_CLC_VECTOR_CONVERT_TO1(SUFFIX)
#endif

View File

@ -142,7 +142,10 @@ def conditional_guard(src, dst):
float64_count = float64_count + 1
elif dst in float16_types:
float16_count = float16_count + 1
if float64_count > 0:
if float64_count > 0 and float16_count > 0:
print("#if defined(cl_khr_fp16) && defined(cl_khr_fp64)")
return True
elif float64_count > 0:
# In embedded profile, if cl_khr_fp64 is supported cles_khr_int64 has to be
print("#ifdef cl_khr_fp64")
return True