diff options
author | Jean-Luc Brouillet <jeanluc@google.com> | 2015-04-10 09:36:15 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-06-03 09:40:52 -0700 |
commit | 9c850612691e0b16f3974dd672f8eeb343a78aee (patch) | |
tree | c784c0a9ea1caa3de071c7029acf22648b868f98 /scriptc | |
parent | 9c8e3403d07a2347435ed58d8aa52d9dc4346f16 (diff) | |
download | rs-9c850612691e0b16f3974dd672f8eeb343a78aee.tar.gz |
Add half (fp16) to runtime API.
Bug: 7342860
Change-Id: I25c6e1a9102cb193ed47f7d0c87f5948f59b8036
(cherry picked from commit 6119da9273f88e838b2e8648bde0d40fabe51f5f)
Diffstat (limited to 'scriptc')
-rw-r--r-- | scriptc/rs_allocation_data.rsh | 120 | ||||
-rw-r--r-- | scriptc/rs_value_types.rsh | 41 |
2 files changed, 160 insertions, 1 deletions
diff --git a/scriptc/rs_allocation_data.rsh b/scriptc/rs_allocation_data.rsh index d8785a22..69e9baf8 100644 --- a/scriptc/rs_allocation_data.rsh +++ b/scriptc/rs_allocation_data.rsh @@ -2524,6 +2524,66 @@ extern ulong4 __attribute__((overloadable)) rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); #endif +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half __attribute__((overloadable)) + rsGetElementAt_half(rs_allocation a, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half2 __attribute__((overloadable)) + rsGetElementAt_half2(rs_allocation a, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half3 __attribute__((overloadable)) + rsGetElementAt_half3(rs_allocation a, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half4 __attribute__((overloadable)) + rsGetElementAt_half4(rs_allocation a, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half __attribute__((overloadable)) + rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half2 __attribute__((overloadable)) + rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half3 __attribute__((overloadable)) + rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half4 __attribute__((overloadable)) + rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half __attribute__((overloadable)) + rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half2 __attribute__((overloadable)) + rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half3 __attribute__((overloadable)) + rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern half4 __attribute__((overloadable)) + rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); +#endif + /* * rsGetElementAtYuv_uchar_U: Get the U component of an allocation of YUVs * @@ -3234,4 +3294,64 @@ extern void __attribute__((overloadable)) rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z); #endif +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half(rs_allocation a, half val, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y, uint32_t z); +#endif + +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +extern void __attribute__((overloadable)) + rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y, uint32_t z); +#endif + #endif // RENDERSCRIPT_RS_ALLOCATION_DATA_RSH diff --git a/scriptc/rs_value_types.rsh b/scriptc/rs_value_types.rsh index 9dc7259e..faf397cd 100644 --- a/scriptc/rs_value_types.rsh +++ b/scriptc/rs_value_types.rsh @@ -26,7 +26,7 @@ * 8 bits 16 bits 32 bits 64 bits * Integer: char, int8_t short, int16_t int32_t long, long long, int64_t * Unsigned integer: uchar, uint8_t ushort, uint16_t uint, uint32_t ulong, uint64_t - * Floating point: float double + * Floating point: half float double * * * Vectors: @@ -92,6 +92,45 @@ #define RENDERSCRIPT_RS_VALUE_TYPES_RSH /* + * half: 16 bit floating point value + * + * A 16 bit floating point value. + */ +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +typedef __fp16 half; +#endif + +/* + * half2: Two 16 bit floats + * + * Vector version of the half float type. Provides two half fields packed + * into a single 32 bit field with 32 bit alignment. + */ +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +typedef half __attribute__((ext_vector_type(2))) half2; +#endif + +/* + * half3: Three 16 bit floats + * + * Vector version of the half float type. Provides three half fields packed + * into a single 64 bit field with 64 bit alignment. + */ +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +typedef half __attribute__((ext_vector_type(3))) half3; +#endif + +/* + * half4: Four 16 bit floats + * + * Vector version of the half float type. Provides four half fields packed + * into a single 64 bit field with 64 bit alignment. + */ +#if (defined(RS_VERSION) && (RS_VERSION >= 23)) +typedef half __attribute__((ext_vector_type(4))) half4; +#endif + +/* * int8_t: 8 bit signed integer * * 8 bit signed integer type. |