Buckets:
| /* | |
| * Copyright 2020 The Emscripten Authors. All rights reserved. | |
| * Emscripten is available under two separate licenses, the MIT license and the | |
| * University of Illinois/NCSA Open Source License. Both these licenses can be | |
| * found in the LICENSE file. | |
| */ | |
| int main() { | |
| printf ("{ \"workload\": %u, \"results\": [\n", N); | |
| float *src_flt = alloc_float_buffer(); | |
| float *src2_flt = alloc_float_buffer(); | |
| float *dst_flt = alloc_float_buffer(); | |
| for(int i = 0; i < N; ++i) src_flt[i] = (float)(1.0 + (double)rand() / RAND_MAX); | |
| for(int i = 0; i < N; ++i) src2_flt[i] = (float)(1.0 + (double)rand() / RAND_MAX); | |
| double *src_dbl = alloc_double_buffer(); | |
| double *src2_dbl = alloc_double_buffer(); | |
| double *dst_dbl = alloc_double_buffer(); | |
| for(int i = 0; i < N; ++i) src_dbl[i] = 1.0 + (double)rand() / RAND_MAX; | |
| for(int i = 0; i < N; ++i) src2_dbl[i] = 1.0 + (double)rand() / RAND_MAX; | |
| int *src_int = alloc_int_buffer(); | |
| int *src2_int = alloc_int_buffer(); | |
| int *dst_int = alloc_int_buffer(); | |
| for(int i = 0; i < N; ++i) src_int[i] = rand(); | |
| for(int i = 0; i < N; ++i) src2_int[i] = rand(); | |
| float scalarTime = 0.f; | |
| // Benchmarks start: | |
| SETCHART("abs"); | |
| UNARYOP_I_I("_mm_abs_epi8", _mm_abs_epi8, _mm_load_si128((__m128i*)src_int)); | |
| UNARYOP_I_I("_mm_abs_epi16", _mm_abs_epi16, _mm_load_si128((__m128i*)src_int)); | |
| UNARYOP_I_I("_mm_abs_epi32", _mm_abs_epi32, _mm_load_si128((__m128i*)src_int)); | |
| // TODO _mm_alignr_epi8 | |
| SETCHART("horizontal add"); | |
| BINARYOP_I_II("_mm_hadd_epi16", _mm_hadd_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_hadd_epi32", _mm_hadd_epi32, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_hadds_epi16", _mm_hadds_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| SETCHART("horizontal sub"); | |
| BINARYOP_I_II("_mm_hsub_epi16", _mm_hsub_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_hsub_epi32", _mm_hsub_epi32, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_hsubs_epi16", _mm_hsubs_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| SETCHART("mul & shuffle"); | |
| BINARYOP_I_II("_mm_maddubs_epi16", _mm_maddubs_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_mulhrs_epi16", _mm_mulhrs_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_shuffle_epi8", _mm_shuffle_epi8, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| SETCHART("sign"); | |
| BINARYOP_I_II("_mm_sign_epi8", _mm_sign_epi8, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_sign_epi16", _mm_sign_epi16, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| BINARYOP_I_II("_mm_sign_epi32", _mm_sign_epi32, _mm_load_si128((__m128i*)src_int), _mm_load_si128((__m128i*)src2_int)); | |
| // Benchmarks end: | |
| printf("]}\n"); | |
| } | |
Xet Storage Details
- Size:
- 3.15 kB
- Xet hash:
- dd50cdd6ba45b655d03719e50b4f2cc05d17b70830f172258edc572f865265e8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.