Skip to content

libclc: fix convert with half #99481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libclc/generic/include/clc/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion libclc/generic/lib/gen_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading