Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Last login: Fri Mar 30 22:59:05 on ttys000
- -bash: //: is a directory
- emilyzhong@airbears2-10-142-37-171:~ $ssh cs61c-aex@hive11.cs.berkeley.edu
- cs61c-aex@hive11.cs.berkeley.edu's password:
- Your Hardware Enablement Stack (HWE) is supported until April 2019.
- ----------------------------------------------------------------------
- Instructional Support Group (ISG), EECS email:inst@eecs.berkeley.edu
- Ubuntu 14.04.5 LTS 4.4.0-45-generic
- Host: hive11 SystemBuiltOn: 24Jan15-03:56
- ----------------------------------------------------------------------
- Last login: Tue Mar 6 11:53:04 2018 from airbears2-136-152-143-39.airbears2.berkeley.edu
- 'cs61c-aex' is using 118/4194 MB (2%) of its disk quota on /home/cc.
- 'cs61c-aex' is using 0/20971 MB (0%) of its disk quota on /home/tmp.
- (Type 'more /share/b/pub/disk.quotas' for more information.)
- (11:17:00 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~ $ cp -r ~cs61c/labs/10/ ~/labs/10/
- (11:17:14 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~ $ cd labs/10
- (11:17:18 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10 $ ^C
- (11:29:24 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10 $ logout
- Clearing out files
- Connection to hive11.cs.berkeley.edu closed.
- [11:29:32] emilyzhong@airbears2-10-142-37-171:~ $ssh cs61c-aex@hive11.cs.berkeley.edu
- cs61c-aex@hive11.cs.berkeley.edu's password:
- Your Hardware Enablement Stack (HWE) is supported until April 2019.
- ----------------------------------------------------------------------
- Instructional Support Group (ISG), EECS email:inst@eecs.berkeley.edu
- Ubuntu 14.04.5 LTS 4.4.0-45-generic
- Host: hive11 SystemBuiltOn: 24Jan15-03:56
- ----------------------------------------------------------------------
- Last login: Mon Apr 2 11:16:59 2018 from airbears2-136-152-143-37.airbears2.berkeley.edu
- 'cs61c-aex' is using 118/4194 MB (2%) of its disk quota on /home/cc.
- 'cs61c-aex' is using 0/20971 MB (0%) of its disk quota on /home/tmp.
- (Type 'more /share/b/pub/disk.quotas' for more information.)
- (11:41:22 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~ $ make sseTest.s
- make: *** No rule to make target `sseTest.s'. Stop.
- (11:41:24 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~ $ cd labs/10
- (11:41:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10 $ make sseTest.s
- gcc -std=gnu99 -O2 -DNDEBUG -g0 -msse4.2 -masm=intel -S sseTest.c
- (11:41:29 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10 $ vim sseTest.s
- (11:44:49 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10 $ cd lab10-branch_prediction
- (11:44:50 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:06:15 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- gcc --std=c99 sorted.c -o sorted
- In file included from sorted.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from sorted.c:4:0:
- common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- (12:06:19 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ./randomized
- Let's generate a randomized array.
- Starting randomized sum.
- Time taken: 26.148203 s
- Sum: 412646965248
- Starting randomized unrolled sum.
- Time taken: 20.952498 s
- Sum: 412646965248
- Starting randomized SIMD sum.
- Segmentation fault (core dumped)
- (12:07:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:09:34 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:10:34 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:10:42 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int *’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- gcc --std=c99 sorted.c -o sorted
- In file included from sorted.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from sorted.c:4:0:
- common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int *’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- (12:10:45 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ./randomized
- Let's generate a randomized array.
- Starting randomized sum.
- Time taken: 25.468856 s
- Sum: 412646965248
- Starting randomized unrolled sum.
- Time taken: 20.164071 s
- Sum: 412646965248
- Starting randomized SIMD sum.
- Segmentation fault (core dumped)
- (12:11:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb ./randomized
- (12:14:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb a.out ./randomized
- (12:14:52 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb run ./randomized
- (12:15:03 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- common.h Makefile randomized randomized.c sorted sorted.c
- (12:15:07 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb ./randomized
- (12:16:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:19:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb randomized
- (12:19:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb randomized.out
- (12:19:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- common.h Makefile randomized randomized.c sorted sorted.c
- (12:19:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cd ran
- -bash: cd: ran: No such file or directory
- (12:19:31 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim randomized
- (12:20:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:25:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- common.h Makefile randomized randomized.c sorted sorted.c
- (12:26:05 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb randomized
- (12:26:38 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make -g
- make: invalid option -- 'g'
- Usage: make [options] [target] ...
- Options:
- -b, -m Ignored for compatibility.
- -B, --always-make Unconditionally make all targets.
- -C DIRECTORY, --directory=DIRECTORY
- Change to DIRECTORY before doing anything.
- -d Print lots of debugging information.
- --debug[=FLAGS] Print various types of debugging information.
- -e, --environment-overrides
- Environment variables override makefiles.
- -f FILE, --file=FILE, --makefile=FILE
- Read FILE as a makefile.
- -h, --help Print this message and exit.
- -i, --ignore-errors Ignore errors from commands.
- -I DIRECTORY, --include-dir=DIRECTORY
- Search DIRECTORY for included makefiles.
- -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
- -k, --keep-going Keep going when some targets can't be made.
- -l [N], --load-average[=N], --max-load[=N]
- Don't start multiple jobs unless load is below N.
- -L, --check-symlink-times Use the latest mtime between symlinks and target.
- -n, --just-print, --dry-run, --recon
- Don't actually run any commands; just print them.
- -o FILE, --old-file=FILE, --assume-old=FILE
- Consider FILE to be very old and don't remake it.
- -p, --print-data-base Print make's internal database.
- -q, --question Run no commands; exit status says if up to date.
- -r, --no-builtin-rules Disable the built-in implicit rules.
- -R, --no-builtin-variables Disable the built-in variable settings.
- -s, --silent, --quiet Don't echo commands.
- -S, --no-keep-going, --stop
- Turns off -k.
- -t, --touch Touch targets instead of remaking them.
- -v, --version Print the version number of make and exit.
- -w, --print-directory Print the current directory.
- --no-print-directory Turn off -w, even if it was turned on implicitly.
- -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
- Consider FILE to be infinitely new.
- --warn-undefined-variables Warn when an undefined variable is referenced.
- This program built for x86_64-pc-linux-gnu
- Report bugs to <bug-make@gnu.org>
- (12:26:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make --g
- make: unrecognized option '--g'
- Usage: make [options] [target] ...
- Options:
- -b, -m Ignored for compatibility.
- -B, --always-make Unconditionally make all targets.
- -C DIRECTORY, --directory=DIRECTORY
- Change to DIRECTORY before doing anything.
- -d Print lots of debugging information.
- --debug[=FLAGS] Print various types of debugging information.
- -e, --environment-overrides
- Environment variables override makefiles.
- -f FILE, --file=FILE, --makefile=FILE
- Read FILE as a makefile.
- -h, --help Print this message and exit.
- -i, --ignore-errors Ignore errors from commands.
- -I DIRECTORY, --include-dir=DIRECTORY
- Search DIRECTORY for included makefiles.
- -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
- -k, --keep-going Keep going when some targets can't be made.
- -l [N], --load-average[=N], --max-load[=N]
- Don't start multiple jobs unless load is below N.
- -L, --check-symlink-times Use the latest mtime between symlinks and target.
- -n, --just-print, --dry-run, --recon
- Don't actually run any commands; just print them.
- -o FILE, --old-file=FILE, --assume-old=FILE
- Consider FILE to be very old and don't remake it.
- -p, --print-data-base Print make's internal database.
- -q, --question Run no commands; exit status says if up to date.
- -r, --no-builtin-rules Disable the built-in implicit rules.
- -R, --no-builtin-variables Disable the built-in variable settings.
- -s, --silent, --quiet Don't echo commands.
- -S, --no-keep-going, --stop
- Turns off -k.
- -t, --touch Touch targets instead of remaking them.
- -v, --version Print the version number of make and exit.
- -w, --print-directory Print the current directory.
- --no-print-directory Turn off -w, even if it was turned on implicitly.
- -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
- Consider FILE to be infinitely new.
- --warn-undefined-variables Warn when an undefined variable is referenced.
- This program built for x86_64-pc-linux-gnu
- Report bugs to <bug-make@gnu.org>
- (12:27:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ gcc -g -o randomized randomized.c
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int *’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd_unrolled’:
- common.h:89:10: warning: unused variable ‘_127’ [-Wunused-variable]
- __m128i _127 = _mm_set1_epi32(127);
- ^
- (12:27:11 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ gcc -g -o randomized.c
- gcc: fatal error: no input files
- compilation terminated.
- (12:27:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:27:59 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- common.h Makefile randomized randomized.c sorted sorted.c
- (12:28:16 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ./randomized
- Let's generate a randomized array.
- Starting randomized sum.
- Time taken: 25.305304 s
- Sum: 412646965248
- Starting randomized unrolled sum.
- Time taken: 20.125977 s
- Sum: 412646965248
- Starting randomized SIMD sum.
- Segmentation fault (core dumped)
- (12:29:37 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:39:08 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:65:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- gcc --std=c99 sorted.c -o sorted
- In file included from sorted.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from sorted.c:4:0:
- common.h:65:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from sorted.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- (12:39:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ./randomized
- Let's generate a randomized array.
- Starting randomized sum.
- Time taken: 26.049458 s
- Sum: 412646965248
- Starting randomized unrolled sum.
- Time taken: 21.435025 s
- Sum: 412646965248
- Starting randomized SIMD sum.
- Segmentation fault (core dumped)
- (12:40:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:54:03 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb randomized
- (12:54:13 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb common.h
- (12:54:22 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb common
- (12:54:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- common.h Makefile randomized randomized.c sorted sorted.c
- (12:54:30 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd_unrolled’:
- common.h:97:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:101:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:97:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:101:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:102:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:98:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:105:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:101:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:105:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:106:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:102:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:109:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:105:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:109:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:110:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:106:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:117:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- make: *** [randomized] Error 1
- (12:54:37 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make randomized
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd_unrolled’:
- common.h:97:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:101:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:97:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:101:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:102:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:98:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:105:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:101:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:105:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:106:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:102:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:109:12: error: redefinition of ‘a’
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:105:12: note: previous definition of ‘a’ was here
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- common.h:109:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:110:12: error: redefinition of ‘mask’
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:106:12: note: previous definition of ‘mask’ was here
- __m128i mask = _mm_cmpgt_epi32( a, _127 );
- ^
- common.h:117:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- make: *** [randomized] Error 1
- (12:54:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:55:19 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ make randomized
- gcc --std=c99 randomized.c -o randomized
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- (12:55:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb randomized
- (12:55:55 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ gcc randomized.c
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd’:
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- In file included from randomized.c:4:0:
- common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4,
- from randomized.c:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- In file included from randomized.c:4:0:
- common.h: In function ‘sum_simd_unrolled’:
- common.h:90:10: warning: unused variable ‘_127’ [-Wunused-variable]
- __m128i _127 = _mm_set1_epi32(127);
- ^
- (12:56:17 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:56:51 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ gcc -g -o common common.o
- gcc: error: common.o: No such file or directory
- gcc: fatal error: no input files
- compilation terminated.
- (12:57:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ gcc -g -o common common.h
- common.h: In function ‘sum’:
- common.h:10:2: error: unknown type name ‘clock_t’
- clock_t start = clock();
- ^
- common.h:10:2: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
- common.h:20:2: error: unknown type name ‘clock_t’
- clock_t end = clock();
- ^
- common.h:21:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:21:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- common.h:21:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:21:61: note: each undeclared identifier is reported only once for each function it appears in
- common.h: In function ‘sum_unrolled’:
- common.h:26:2: error: unknown type name ‘clock_t’
- clock_t start = clock();
- ^
- common.h:46:2: error: unknown type name ‘clock_t’
- clock_t end = clock();
- ^
- common.h:47:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:47:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h: In function ‘sum_simd’:
- common.h:52:2: error: unknown type name ‘clock_t’
- clock_t start = clock();
- ^
- common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
- __m128i a = _mm_loadu_si128(&vals + i);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:682:1: note: expected ‘const __vector(2) long long int *’ but argument is of type ‘unsigned int **’
- _mm_loadu_si128 (__m128i const *__P)
- ^
- common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
- _mm_storeu_si128(&four, temp_result);
- ^
- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
- from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
- from common.h:4:
- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:700:1: note: expected ‘__vector(2) long long int *’ but argument is of type ‘int (*)[4]’
- _mm_storeu_si128 (__m128i *__P, __m128i __B)
- ^
- common.h:83:2: error: unknown type name ‘clock_t’
- clock_t end = clock();
- ^
- common.h:84:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:84:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h: In function ‘sum_simd_unrolled’:
- common.h:89:2: error: unknown type name ‘clock_t’
- clock_t start = clock();
- ^
- common.h:98:2: error: unknown type name ‘clock_t’
- clock_t end = clock();
- ^
- common.h:99:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:99:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- ^
- common.h:90:10: warning: unused variable ‘_127’ [-Wunused-variable]
- __m128i _127 = _mm_set1_epi32(127);
- ^
- (12:58:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ cgdb common
- (12:58:15 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ ls
- a.out common.h Makefile randomized randomized.c sorted sorted.c
- (12:58:16 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- (12:59:45 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
- ~/labs/10/lab10-branch_prediction $ vim common.h
- #ifndef COMMON_H
- #define COMMON_H
- #include <x86intrin.h>
- #define NUM_ELEMS ((1 << 16) + 10)
- #define OUTER_ITERATIONS (1 << 16)
- long long int sum(unsigned int vals[NUM_ELEMS]) {
- clock_t start = clock();
- long long int sum = 0;
- for(unsigned int w = 0; w < OUTER_ITERATIONS; w++) {
- for(unsigned int i = 0; i < NUM_ELEMS; i++) {
- if(vals[i] >= 128) {
- sum += vals[i];
- }
- }
- }
- clock_t end = clock();
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- return sum;
- }
- long long int sum_unrolled(unsigned int vals[NUM_ELEMS]) {
- clock_t start = clock();
- long long int sum = 0;
- for(unsigned int w = 0; w < OUTER_ITERATIONS; w++) {
- for(unsigned int i = 0; i < NUM_ELEMS / 4 * 4; i += 4) {
- if(vals[i] >= 128) sum += vals[i];
- if(vals[i + 1] >= 128) sum += vals[i + 1];
- if(vals[i + 2] >= 128) sum += vals[i + 2];
- if(vals[i + 3] >= 128) sum += vals[i + 3];
- }
- //This is what we call the TAIL CASE
- //For when NUM_ELEMS isn't a multiple of 4
- //NONTRIVIAL FACT: NUM_ELEMS / 4 * 4 is the largest multiple of 4 less than NUM_ELEMS
- for(unsigned int i = NUM_ELEMS / 4 * 4; i < NUM_ELEMS; i++) {
- if (vals[i] >= 128) {
- sum += vals[i];
- }
- }
- }
- clock_t end = clock();
- printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
- "common.h" 110L, 3245C 1,1 Top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement