Skip to content

Commit d9cb65f

Browse files
authored
libclc: fix convert with half (#99481)
Fix following update of libclc introducing more fp16 support: 7e6a739
1 parent d00b355 commit d9cb65f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libclc/generic/include/clc/convert.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
6363
_CLC_VECTOR_CONVERT_TO1(SUFFIX) \
6464
_CLC_VECTOR_CONVERT_FROM(half, SUFFIX)
65+
#else
6566
#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
6667
_CLC_VECTOR_CONVERT_TO1(SUFFIX)
6768
#endif

libclc/generic/lib/gen_convert.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ def conditional_guard(src, dst):
142142
float64_count = float64_count + 1
143143
elif dst in float16_types:
144144
float16_count = float16_count + 1
145-
if float64_count > 0:
145+
if float64_count > 0 and float16_count > 0:
146+
print("#if defined(cl_khr_fp16) && defined(cl_khr_fp64)")
147+
return True
148+
elif float64_count > 0:
146149
# In embedded profile, if cl_khr_fp64 is supported cles_khr_int64 has to be
147150
print("#ifdef cl_khr_fp64")
148151
return True

0 commit comments

Comments
 (0)