/frameworks/native/libs/math/tests/ |
D | half_test.cpp | 35 EXPECT_EQ(2UL, sizeof(half)); in TEST_F() 38 EXPECT_EQ(0x0000, half( 0.0f).getBits()); in TEST_F() 39 EXPECT_EQ(0x8000, half(-0.0f).getBits()); in TEST_F() 42 EXPECT_EQ(0x7e00, half(NAN).getBits()); in TEST_F() 45 EXPECT_EQ(0x7C00, half( std::numeric_limits<float>::infinity()).getBits()); in TEST_F() 46 EXPECT_EQ(0xFC00, half(-std::numeric_limits<float>::infinity()).getBits()); in TEST_F() 49 EXPECT_EQ(0x3C01, half(1.0009765625).getBits()); in TEST_F() 50 EXPECT_EQ(0xC000, half(-2).getBits()); in TEST_F() 51 EXPECT_EQ(0x0400, half(6.10352e-5).getBits()); in TEST_F() 52 EXPECT_EQ(0x7BFF, half(65504).getBits()); in TEST_F() [all …]
|
/frameworks/native/libs/math/include/math/ |
D | half.h | 57 class half { 85 CONSTEXPR half(float v) noexcept : mBits(ftoh(v)) { } in half() function 93 friend class std::numeric_limits<half>; 94 friend CONSTEXPR half operator"" _hf(long double v); 97 explicit constexpr half(Binary, uint16_t bits) noexcept : mBits(bits) { } in half() function 103 inline CONSTEXPR half::fp16 half::ftoh(float v) noexcept { in ftoh() 131 inline CONSTEXPR float half::htof(half::fp16 in) noexcept { in htof() 153 inline CONSTEXPR android::half operator"" _hf(long double v) { 154 return android::half(android::half::binary, android::half::ftoh(static_cast<float>(v)).bits); 161 template<> struct is_floating_point<android::half> : public std::true_type {}; [all …]
|
/frameworks/rs/tests/java_api/RsTest/src/com/android/rs/test/ |
D | math_fp16.rs | 3 static volatile half h1; 62 h1 = fn(h1, (half *) &h1); \ 259 half hval; 274 half out = frexp(((half) inp), &exp); \ 275 _RS_ASSERT_EQU(out, ((half) ref)); \ 296 half intPart[3]; \ 297 intPart[0] = (half) 42.0f; \ 298 intPart[2] = (half) 3.14f; \ 299 half out = modf(((half) inp), &intPart[1]); \ 300 _RS_ASSERT_EQU(out, ((half) ref)); \ [all …]
|
D | rsdebug.rs | 32 half halfTest = (half) 1.5f; 33 half2 half2Test = {(half) 1.5f, (half) 2.5f}; 34 half3 half3Test = {(half) 1.5f, (half) 2.5f, (half) 3.5f}; 35 half4 half4Test = {(half) 0.f, (half) -0.f, (half) 1.f/0.f, (half) 0.f/0.f};
|
D | fp16.rs | 6 static half gStart = 12.0f; constant 7 static half gIncr = 0.125; variable 12 static half ElementAt_half(int x, int y, int z) { constant 17 half r = gStart + x + y * gDimX + z * gDimX * gDimY; 23 half r = gStart + x + y * gDimX + z * gDimX * gDimY; 29 half r = gStart + x + y * gDimX + z * gDimX * gDimY; 34 static void compare_half(half x, half y) { 76 SET_KERNEL(half) 92 INVOKE_SET(half) 102 VERIFY_KERNEL(half); [all …]
|
D | fp16_globals.rs | 3 half gHalf; 10 void validateHalf(half h) { 32 void test(half h, half2 h2, half3 h3, half4 h4) {
|
D | single_source_alloc.rs | 49 VERIFY_KERNEL(half) 163 STORE_TO_ALLOC(RS_TYPE_FLOAT_16, half); 185 LAUNCH_VERIFY_KERNEL(RS_TYPE_FLOAT_16, half); 379 TEST_HELPER(half);
|
/frameworks/compile/slang/tests/P_export_types/ |
D | export_types.rs | 4 half h = (half) 1.2f; 5 half2 h2 = {(half) 1.2f, (half) 2.3f}; 6 half3 h3 = {(half) 1.2f, (half) 2.3f, (half) 3.4f}; 7 half4 h4 = {(half) 1.2f, (half) 2.3f, (half) 3.4f, (half) 4.5f};
|
/frameworks/base/tests/HwAccelerationTest/src/com/android/test/hwui/ |
D | BitmapsRectActivity.java | 57 final float half = mBitmap1.getHeight() / 2.0f; in BitmapsView() local 58 mSrcRect = new Rect((int) fourth, (int) (half - half / 2.0f), in BitmapsView() 59 (int) (fourth + fourth), (int) (half + half / 2.0f)); in BitmapsView() 60 mDstRect = new RectF(fourth, half - half / 2.0f, fourth + fourth, half + half / 2.0f); in BitmapsView() 61 mDstRect2 = new RectF(fourth, half - half / 2.0f, in BitmapsView() 62 (fourth + fourth) * 3.0f, (half + half / 2.0f) * 3.0f); in BitmapsView()
|
/frameworks/rs/driver/runtime/ |
D | rs_f16_math.c | 21 extern half __attribute__((overloadable)) copysign(half x, half y) { in copysign() 31 extern half __attribute__((overloadable)) frexp(half x, int *eptr) { in frexp() 33 static const half two12 = 4096; in frexp() 58 extern int __attribute__((overloadable)) ilogb(half x) { in ilogb() 82 extern half __attribute__((overloadable)) modf(half x, half *iptr) { in modf() 117 extern half __attribute__((overloadable)) nextafter(half x, half y) { in nextafter()
|
D | rs_cl.c | 1690 extern half __attribute__((overloadable)) fn(half h) { \ 1691 return (half) fn((float) h); \ 1708 extern half __attribute__((overloadable)) fn(half h1, half h2) { \ 1709 return (half) fn((float) h1, (float) h2); \ 1729 extern half2 __attribute__((overloadable)) fn(half2 v1, half v2) { \ 1732 extern half3 __attribute__((overloadable)) fn(half3 v1, half v2) { \ 1735 extern half4 __attribute__((overloadable)) fn(half4 v1, half v2) { \ 1744 extern half __attribute__((overloadable)) fn(half h1, half h2, half h3) { \ 1745 return (half) fn((float) h1, (float) h2, (float) h3); \ 1769 extern half __attribute__((overloadable)) fn(half h1, int v) { \ [all …]
|
D | rs_convert.c | 41 CVT_FUNC_2(type, half) \ 53 CVT_FUNC(half)
|
D | rs_f16_util.h | 21 half hval;
|
/frameworks/rs/tests/java_api/ImageProcessing_jb/src/com/android/rs/image/ |
D | threshold_half.rs | 31 static half gaussian[MAX_RADIUS * 2 + 1]; constant 37 half e = 2.718281828459045f; 38 half pi = 3.1415926535897932f; 48 half sigma = 0.4f * (half)radius + 0.6f; 54 half coeff1 = 1.0f / (sqrt( 2.0f * pi ) * sigma); 55 half coeff2 = - 1.0f / (2.0f * sigma * sigma); 57 half normalizeFactor = 0.0f; 58 half halfR = 0.0f; 60 halfR = (half)r; 68 halfR = (half)r; [all …]
|
/frameworks/rs/script_api/include/ |
D | rs_vector_math.rsh | 82 extern half __attribute__((const, overloadable)) 83 distance(half left_vector, half right_vector); 87 extern half __attribute__((const, overloadable)) 92 extern half __attribute__((const, overloadable)) 97 extern half __attribute__((const, overloadable)) 119 extern half __attribute__((const, overloadable)) 120 dot(half left_vector, half right_vector); 124 extern half __attribute__((const, overloadable)) 129 extern half __attribute__((const, overloadable)) 134 extern half __attribute__((const, overloadable)) [all …]
|
D | rs_math.rsh | 219 extern half __attribute__((const, overloadable)) 220 acos(half v); 258 extern half __attribute__((const, overloadable)) 259 acosh(half v); 299 extern half __attribute__((const, overloadable)) 300 acospi(half v); 338 extern half __attribute__((const, overloadable)) 339 asin(half v); 377 extern half __attribute__((const, overloadable)) 378 asinh(half v); [all …]
|
D | rs_value_types.rsh | 29 * Floating point: half float double 95 * half: 16 bit floating point value 100 typedef __fp16 half; 106 * Vector version of the half float type. Provides two half fields packed 110 typedef half __attribute__((ext_vector_type(2))) half2; 116 * Vector version of the half float type. Provides three half fields packed 120 typedef half __attribute__((ext_vector_type(3))) half3; 126 * Vector version of the half float type. Provides four half fields packed 130 typedef half __attribute__((ext_vector_type(4))) half4;
|
/frameworks/compile/slang/tests/P_all_api_24/ |
D | all24.rs | 6502 *(half*)buf32 = acos(*(half*)buf33); 6510 *(half*)buf48 = acosh(*(half*)buf49); 6518 *(half*)buf64 = acospi(*(half*)buf65); 6526 *(half*)buf80 = asin(*(half*)buf81); 6534 *(half*)buf96 = asinh(*(half*)buf97); 6542 *(half*)buf112 = asinpi(*(half*)buf113); 6550 *(half*)buf128 = atan(*(half*)buf129); 6558 *(half*)buf148 = atan2(*(half*)buf149, *(half*)buf150); 6566 *(half*)buf172 = atan2pi(*(half*)buf173, *(half*)buf174); 6574 *(half*)buf192 = atanh(*(half*)buf193); [all …]
|
/frameworks/compile/slang/lit-tests/padding/ |
D | more_structs.rs | 104 half f5; 116 void check_five_struct(char arg1, long arg2, short arg3, long arg4, half arg5) {
|
/frameworks/wilhelm/tests/sandbox/ |
D | intbufq.c | 66 frame_t half[HALF_FRAMES]; variable 165 half[i].left = sine[i].left; in main() 166 half[i].right = sawtooth[i].right / 2; in main() 197 buffer = half; in main() 198 size = sizeof(half); in main()
|
/frameworks/rs/tests/cpp_api/cppf16/ |
D | compute.cpp | 34 sp<const Element> half = Element::F16(rs); in main() local 40 testAllocationCreation(rs, half, nDims); in main()
|
/frameworks/compile/slang/tests/P_reduce_general_inputs/ |
D | reduce_general_inputs.rs | 18 static void my_half_half_0_accum(int *accum, half a, half b) { } 21 static void my_half_half_1_accum(int *accum, half a, half b, rs_kernel_context context) { } 24 static void my_half_half2_0_accum(int *accum, half a, half2 b) { } 27 static void my_half_half2_1_accum(int *accum, half a, half2 b, rs_kernel_context context) { } 30 static void my_half_half4_0_accum(int *accum, half a, half4 b) { } 33 static void my_half_half4_1_accum(int *accum, half a, half4 b, rs_kernel_context context) { } 36 static void my_half_float_0_accum(int *accum, half a, float b) { } 39 static void my_half_float_1_accum(int *accum, half a, float b, rs_kernel_context context) { } 42 static void my_half_float2_0_accum(int *accum, half a, float2 b) { } 45 static void my_half_float2_1_accum(int *accum, half a, float2 b, rs_kernel_context context) { } [all …]
|
/frameworks/rs/driver/runtime/ll64/ |
D | allocation.ll | 672 !61 = !{!"half", !15} 673 define void @rsSetElementAtImpl_half(%struct.rs_allocation* nocapture readonly %a.coerce, half %val… 675 %2 = bitcast i8* %1 to half* 676 store half %val, half* %2, align 2, !tbaa !61 680 define half @rsGetElementAtImpl_half(%struct.rs_allocation* nocapture readonly %a.coerce, i32 %x, i… 682 %2 = bitcast i8* %1 to half* 683 %3 = load half, half* %2, align 2, !tbaa !61 684 ret half %3 688 …entAtImpl_half2(%struct.rs_allocation* nocapture readonly %a.coerce, <2 x half> %val, i32 %x, i32 … 690 %2 = bitcast i8* %1 to <2 x half>* [all …]
|
/frameworks/rs/driver/runtime/ll32/ |
D | allocation.ll | 657 !61 = !{!"half", !15} 658 define void @rsSetElementAtImpl_half([1 x i32] %a.coerce, half %val, i32 %x, i32 %y, i32 %z) #1 { 660 %2 = bitcast i8* %1 to half* 661 store half %val, half* %2, align 2, !tbaa !61 665 define half @rsGetElementAtImpl_half([1 x i32] %a.coerce, i32 %x, i32 %y, i32 %z) #0 { 667 %2 = bitcast i8* %1 to half* 668 %3 = load half, half* %2, align 2, !tbaa !61 669 ret half %3 673 define void @rsSetElementAtImpl_half2([1 x i32] %a.coerce, <2 x half> %val, i32 %x, i32 %y, i32 %z)… 675 %2 = bitcast i8* %1 to <2 x half>* [all …]
|
/frameworks/compile/slang/tests/P_invoke_half_parameter/ |
D | invoke_half_parameter.rs | 4 void test(half h, half2 h2, half3 h3, half4 h4) {
|