Skip to content

[SYCL-PTX] Enable 16 bits float libclc builtins. #2024

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 8, 2020
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
9 changes: 9 additions & 0 deletions libclc/generic/include/as_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@
#define as_half16(x) __builtin_astype(x, half16)
#endif

#ifdef __CLC_HAS_FLOAT16
#define as_float16_t(x) __builtin_astype(x, __clc_float16_t)
#define as_vec2_float16_t(x) __builtin_astype(x, __clc_vec2_float16_t)
#define as_vec3_float16_t(x) __builtin_astype(x, __clc_vec3_float16_t)
#define as_vec4_float16_t(x) __builtin_astype(x, __clc_vec4_float16_t)
#define as_vec8_float16_t(x) __builtin_astype(x, __clc_vec8_float16_t)
#define as_vec16_float16_t(x) __builtin_astype(x, __clc_vec16_float16_t)
#endif

#endif // CLC_AS_TYPE
14 changes: 14 additions & 0 deletions libclc/generic/include/lp64_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#ifndef CLC_LP64_TYPES
#define CLC_LP64_TYPES

#ifdef __FLT16_MAX__
#define __CLC_HAS_FLOAT16
#endif

typedef bool __clc_bool_t;

typedef char __clc_char_t;
Expand Down Expand Up @@ -106,6 +110,16 @@ typedef half __clc_vec16_fp16_t __attribute__((ext_vector_type(16)));

#endif

#ifdef __CLC_HAS_FLOAT16

typedef _Float16 __clc_float16_t;
typedef _Float16 __clc_vec2_float16_t __attribute__((ext_vector_type(2)));
typedef _Float16 __clc_vec3_float16_t __attribute__((ext_vector_type(3)));
typedef _Float16 __clc_vec4_float16_t __attribute__((ext_vector_type(4)));
typedef _Float16 __clc_vec8_float16_t __attribute__((ext_vector_type(8)));
typedef _Float16 __clc_vec16_float16_t __attribute__((ext_vector_type(16)));

#endif
typedef __clc_int64_t __clc_size_t;

#ifdef __SYCL_DEVICE_ONLY__
Expand Down
1 change: 1 addition & 0 deletions libclc/generic/libspirv/SOURCES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
float16.cl
subnormal_config.cl
subnormal_helper_func.ll
async/async_work_group_strided_copy.cl
Expand Down
Loading