Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.10 KB | None | 0 0
  1. Last login: Fri Mar 30 22:59:05 on ttys000
  2. -bash: //: is a directory
  3. emilyzhong@airbears2-10-142-37-171:~ $ssh cs61c-aex@hive11.cs.berkeley.edu
  4. cs61c-aex@hive11.cs.berkeley.edu's password:
  5. Your Hardware Enablement Stack (HWE) is supported until April 2019.
  6. ----------------------------------------------------------------------
  7. Instructional Support Group (ISG), EECS email:inst@eecs.berkeley.edu
  8.  
  9. Ubuntu 14.04.5 LTS 4.4.0-45-generic
  10.  
  11. Host: hive11 SystemBuiltOn: 24Jan15-03:56
  12. ----------------------------------------------------------------------
  13. Last login: Tue Mar 6 11:53:04 2018 from airbears2-136-152-143-39.airbears2.berkeley.edu
  14.  
  15. 'cs61c-aex' is using 118/4194 MB (2%) of its disk quota on /home/cc.
  16. 'cs61c-aex' is using 0/20971 MB (0%) of its disk quota on /home/tmp.
  17.  
  18. (Type 'more /share/b/pub/disk.quotas' for more information.)
  19.  
  20.  
  21. (11:17:00 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  22. ~ $ cp -r ~cs61c/labs/10/ ~/labs/10/
  23.  
  24. (11:17:14 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  25. ~ $ cd labs/10
  26.  
  27. (11:17:18 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  28. ~/labs/10 $ ^C
  29.  
  30. (11:29:24 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  31. ~/labs/10 $ logout
  32. Clearing out files
  33. Connection to hive11.cs.berkeley.edu closed.
  34. [11:29:32] emilyzhong@airbears2-10-142-37-171:~ $ssh cs61c-aex@hive11.cs.berkeley.edu
  35. cs61c-aex@hive11.cs.berkeley.edu's password:
  36. Your Hardware Enablement Stack (HWE) is supported until April 2019.
  37. ----------------------------------------------------------------------
  38. Instructional Support Group (ISG), EECS email:inst@eecs.berkeley.edu
  39.  
  40. Ubuntu 14.04.5 LTS 4.4.0-45-generic
  41.  
  42. Host: hive11 SystemBuiltOn: 24Jan15-03:56
  43. ----------------------------------------------------------------------
  44. Last login: Mon Apr 2 11:16:59 2018 from airbears2-136-152-143-37.airbears2.berkeley.edu
  45.  
  46. 'cs61c-aex' is using 118/4194 MB (2%) of its disk quota on /home/cc.
  47. 'cs61c-aex' is using 0/20971 MB (0%) of its disk quota on /home/tmp.
  48.  
  49. (Type 'more /share/b/pub/disk.quotas' for more information.)
  50.  
  51.  
  52. (11:41:22 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  53. ~ $ make sseTest.s
  54. make: *** No rule to make target `sseTest.s'. Stop.
  55.  
  56. (11:41:24 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  57. ~ $ cd labs/10
  58.  
  59. (11:41:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  60. ~/labs/10 $ make sseTest.s
  61. gcc -std=gnu99 -O2 -DNDEBUG -g0 -msse4.2 -masm=intel -S sseTest.c
  62.  
  63. (11:41:29 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  64. ~/labs/10 $ vim sseTest.s
  65.  
  66. (11:44:49 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  67. ~/labs/10 $ cd lab10-branch_prediction
  68.  
  69. (11:44:50 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  70. ~/labs/10/lab10-branch_prediction $ vim common.h
  71.  
  72. (12:06:15 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  73. ~/labs/10/lab10-branch_prediction $ make
  74. gcc --std=c99 randomized.c -o randomized
  75. In file included from randomized.c:4:0:
  76. common.h: In function ‘sum_simd’:
  77. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  78. __m128i a = _mm_loadu_si128(&vals + i);
  79. ^
  80. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  81. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  82. from common.h:4,
  83. from randomized.c:4:
  84. /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 **’
  85. _mm_loadu_si128 (__m128i const *__P)
  86. ^
  87. In file included from randomized.c:4:0:
  88. common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  89. _mm_storeu_si128(&four, temp_result);
  90. ^
  91. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  92. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  93. from common.h:4,
  94. from randomized.c:4:
  95. /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]’
  96. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  97. ^
  98. gcc --std=c99 sorted.c -o sorted
  99. In file included from sorted.c:4:0:
  100. common.h: In function ‘sum_simd’:
  101. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  102. __m128i a = _mm_loadu_si128(&vals + i);
  103. ^
  104. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  105. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  106. from common.h:4,
  107. from sorted.c:4:
  108. /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 **’
  109. _mm_loadu_si128 (__m128i const *__P)
  110. ^
  111. In file included from sorted.c:4:0:
  112. common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  113. _mm_storeu_si128(&four, temp_result);
  114. ^
  115. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  116. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  117. from common.h:4,
  118. from sorted.c:4:
  119. /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]’
  120. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  121. ^
  122.  
  123. (12:06:19 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  124. ~/labs/10/lab10-branch_prediction $ ./randomized
  125. Let's generate a randomized array.
  126. Starting randomized sum.
  127. Time taken: 26.148203 s
  128. Sum: 412646965248
  129. Starting randomized unrolled sum.
  130. Time taken: 20.952498 s
  131. Sum: 412646965248
  132. Starting randomized SIMD sum.
  133. Segmentation fault (core dumped)
  134.  
  135. (12:07:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  136. ~/labs/10/lab10-branch_prediction $ vim common.h
  137.  
  138. (12:09:34 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  139. ~/labs/10/lab10-branch_prediction $ vim common.h
  140.  
  141. (12:10:34 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  142. ~/labs/10/lab10-branch_prediction $ vim common.h
  143.  
  144. (12:10:42 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  145. ~/labs/10/lab10-branch_prediction $ make
  146. gcc --std=c99 randomized.c -o randomized
  147. In file included from randomized.c:4:0:
  148. common.h: In function ‘sum_simd’:
  149. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  150. __m128i a = _mm_loadu_si128(&vals + i);
  151. ^
  152. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  153. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  154. from common.h:4,
  155. from randomized.c:4:
  156. /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 **’
  157. _mm_loadu_si128 (__m128i const *__P)
  158. ^
  159. In file included from randomized.c:4:0:
  160. common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  161. _mm_storeu_si128(four, temp_result);
  162. ^
  163. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  164. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  165. from common.h:4,
  166. from randomized.c:4:
  167. /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 *’
  168. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  169. ^
  170. gcc --std=c99 sorted.c -o sorted
  171. In file included from sorted.c:4:0:
  172. common.h: In function ‘sum_simd’:
  173. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  174. __m128i a = _mm_loadu_si128(&vals + i);
  175. ^
  176. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  177. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  178. from common.h:4,
  179. from sorted.c:4:
  180. /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 **’
  181. _mm_loadu_si128 (__m128i const *__P)
  182. ^
  183. In file included from sorted.c:4:0:
  184. common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  185. _mm_storeu_si128(four, temp_result);
  186. ^
  187. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  188. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  189. from common.h:4,
  190. from sorted.c:4:
  191. /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 *’
  192. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  193. ^
  194.  
  195. (12:10:45 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  196. ~/labs/10/lab10-branch_prediction $ ./randomized
  197. Let's generate a randomized array.
  198. Starting randomized sum.
  199. Time taken: 25.468856 s
  200. Sum: 412646965248
  201. Starting randomized unrolled sum.
  202. Time taken: 20.164071 s
  203. Sum: 412646965248
  204. Starting randomized SIMD sum.
  205. Segmentation fault (core dumped)
  206.  
  207. (12:11:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  208. ~/labs/10/lab10-branch_prediction $ cgdb ./randomized
  209.  
  210. (12:14:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  211. ~/labs/10/lab10-branch_prediction $ cgdb a.out ./randomized
  212.  
  213. (12:14:52 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  214. ~/labs/10/lab10-branch_prediction $ cgdb run ./randomized
  215.  
  216. (12:15:03 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  217. ~/labs/10/lab10-branch_prediction $ ls
  218. common.h Makefile randomized randomized.c sorted sorted.c
  219.  
  220. (12:15:07 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  221. ~/labs/10/lab10-branch_prediction $ cgdb ./randomized
  222.  
  223. (12:16:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  224. ~/labs/10/lab10-branch_prediction $ vim common.h
  225.  
  226. (12:19:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  227. ~/labs/10/lab10-branch_prediction $ cgdb randomized
  228.  
  229. (12:19:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  230. ~/labs/10/lab10-branch_prediction $ cgdb randomized.out
  231.  
  232. (12:19:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  233. ~/labs/10/lab10-branch_prediction $ ls
  234. common.h Makefile randomized randomized.c sorted sorted.c
  235.  
  236. (12:19:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  237. ~/labs/10/lab10-branch_prediction $ cd ran
  238. -bash: cd: ran: No such file or directory
  239.  
  240. (12:19:31 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  241. ~/labs/10/lab10-branch_prediction $ vim randomized
  242.  
  243. (12:20:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  244. ~/labs/10/lab10-branch_prediction $ vim common.h
  245.  
  246. (12:25:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  247. ~/labs/10/lab10-branch_prediction $ ls
  248. common.h Makefile randomized randomized.c sorted sorted.c
  249.  
  250. (12:26:05 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  251. ~/labs/10/lab10-branch_prediction $ cgdb randomized
  252.  
  253. (12:26:38 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  254. ~/labs/10/lab10-branch_prediction $ make -g
  255. make: invalid option -- 'g'
  256. Usage: make [options] [target] ...
  257. Options:
  258. -b, -m Ignored for compatibility.
  259. -B, --always-make Unconditionally make all targets.
  260. -C DIRECTORY, --directory=DIRECTORY
  261. Change to DIRECTORY before doing anything.
  262. -d Print lots of debugging information.
  263. --debug[=FLAGS] Print various types of debugging information.
  264. -e, --environment-overrides
  265. Environment variables override makefiles.
  266. -f FILE, --file=FILE, --makefile=FILE
  267. Read FILE as a makefile.
  268. -h, --help Print this message and exit.
  269. -i, --ignore-errors Ignore errors from commands.
  270. -I DIRECTORY, --include-dir=DIRECTORY
  271. Search DIRECTORY for included makefiles.
  272. -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
  273. -k, --keep-going Keep going when some targets can't be made.
  274. -l [N], --load-average[=N], --max-load[=N]
  275. Don't start multiple jobs unless load is below N.
  276. -L, --check-symlink-times Use the latest mtime between symlinks and target.
  277. -n, --just-print, --dry-run, --recon
  278. Don't actually run any commands; just print them.
  279. -o FILE, --old-file=FILE, --assume-old=FILE
  280. Consider FILE to be very old and don't remake it.
  281. -p, --print-data-base Print make's internal database.
  282. -q, --question Run no commands; exit status says if up to date.
  283. -r, --no-builtin-rules Disable the built-in implicit rules.
  284. -R, --no-builtin-variables Disable the built-in variable settings.
  285. -s, --silent, --quiet Don't echo commands.
  286. -S, --no-keep-going, --stop
  287. Turns off -k.
  288. -t, --touch Touch targets instead of remaking them.
  289. -v, --version Print the version number of make and exit.
  290. -w, --print-directory Print the current directory.
  291. --no-print-directory Turn off -w, even if it was turned on implicitly.
  292. -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
  293. Consider FILE to be infinitely new.
  294. --warn-undefined-variables Warn when an undefined variable is referenced.
  295.  
  296. This program built for x86_64-pc-linux-gnu
  297. Report bugs to <bug-make@gnu.org>
  298.  
  299. (12:26:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  300. ~/labs/10/lab10-branch_prediction $ make --g
  301. make: unrecognized option '--g'
  302. Usage: make [options] [target] ...
  303. Options:
  304. -b, -m Ignored for compatibility.
  305. -B, --always-make Unconditionally make all targets.
  306. -C DIRECTORY, --directory=DIRECTORY
  307. Change to DIRECTORY before doing anything.
  308. -d Print lots of debugging information.
  309. --debug[=FLAGS] Print various types of debugging information.
  310. -e, --environment-overrides
  311. Environment variables override makefiles.
  312. -f FILE, --file=FILE, --makefile=FILE
  313. Read FILE as a makefile.
  314. -h, --help Print this message and exit.
  315. -i, --ignore-errors Ignore errors from commands.
  316. -I DIRECTORY, --include-dir=DIRECTORY
  317. Search DIRECTORY for included makefiles.
  318. -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
  319. -k, --keep-going Keep going when some targets can't be made.
  320. -l [N], --load-average[=N], --max-load[=N]
  321. Don't start multiple jobs unless load is below N.
  322. -L, --check-symlink-times Use the latest mtime between symlinks and target.
  323. -n, --just-print, --dry-run, --recon
  324. Don't actually run any commands; just print them.
  325. -o FILE, --old-file=FILE, --assume-old=FILE
  326. Consider FILE to be very old and don't remake it.
  327. -p, --print-data-base Print make's internal database.
  328. -q, --question Run no commands; exit status says if up to date.
  329. -r, --no-builtin-rules Disable the built-in implicit rules.
  330. -R, --no-builtin-variables Disable the built-in variable settings.
  331. -s, --silent, --quiet Don't echo commands.
  332. -S, --no-keep-going, --stop
  333. Turns off -k.
  334. -t, --touch Touch targets instead of remaking them.
  335. -v, --version Print the version number of make and exit.
  336. -w, --print-directory Print the current directory.
  337. --no-print-directory Turn off -w, even if it was turned on implicitly.
  338. -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
  339. Consider FILE to be infinitely new.
  340. --warn-undefined-variables Warn when an undefined variable is referenced.
  341.  
  342. This program built for x86_64-pc-linux-gnu
  343. Report bugs to <bug-make@gnu.org>
  344.  
  345. (12:27:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  346. ~/labs/10/lab10-branch_prediction $ gcc -g -o randomized randomized.c
  347. In file included from randomized.c:4:0:
  348. common.h: In function ‘sum_simd’:
  349. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  350. __m128i a = _mm_loadu_si128(&vals + i);
  351. ^
  352. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  353. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  354. from common.h:4,
  355. from randomized.c:4:
  356. /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 **’
  357. _mm_loadu_si128 (__m128i const *__P)
  358. ^
  359. In file included from randomized.c:4:0:
  360. common.h:75:2: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  361. _mm_storeu_si128(four, temp_result);
  362. ^
  363. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  364. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  365. from common.h:4,
  366. from randomized.c:4:
  367. /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 *’
  368. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  369. ^
  370. In file included from randomized.c:4:0:
  371. common.h: In function ‘sum_simd_unrolled’:
  372. common.h:89:10: warning: unused variable ‘_127’ [-Wunused-variable]
  373. __m128i _127 = _mm_set1_epi32(127);
  374. ^
  375.  
  376. (12:27:11 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  377. ~/labs/10/lab10-branch_prediction $ gcc -g -o randomized.c
  378. gcc: fatal error: no input files
  379. compilation terminated.
  380.  
  381. (12:27:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  382. ~/labs/10/lab10-branch_prediction $ vim common.h
  383.  
  384. (12:27:59 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  385. ~/labs/10/lab10-branch_prediction $ ls
  386. common.h Makefile randomized randomized.c sorted sorted.c
  387.  
  388. (12:28:16 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  389. ~/labs/10/lab10-branch_prediction $ ./randomized
  390. Let's generate a randomized array.
  391. Starting randomized sum.
  392. Time taken: 25.305304 s
  393. Sum: 412646965248
  394. Starting randomized unrolled sum.
  395. Time taken: 20.125977 s
  396. Sum: 412646965248
  397. Starting randomized SIMD sum.
  398. Segmentation fault (core dumped)
  399.  
  400. (12:29:37 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  401. ~/labs/10/lab10-branch_prediction $ vim common.h
  402.  
  403. (12:39:08 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  404. ~/labs/10/lab10-branch_prediction $ make
  405. gcc --std=c99 randomized.c -o randomized
  406. In file included from randomized.c:4:0:
  407. common.h: In function ‘sum_simd’:
  408. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  409. __m128i a = _mm_loadu_si128(&vals + i);
  410. ^
  411. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  412. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  413. from common.h:4,
  414. from randomized.c:4:
  415. /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 **’
  416. _mm_loadu_si128 (__m128i const *__P)
  417. ^
  418. In file included from randomized.c:4:0:
  419. common.h:65:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  420. _mm_storeu_si128(&four, temp_result);
  421. ^
  422. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  423. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  424. from common.h:4,
  425. from randomized.c:4:
  426. /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]’
  427. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  428. ^
  429. gcc --std=c99 sorted.c -o sorted
  430. In file included from sorted.c:4:0:
  431. common.h: In function ‘sum_simd’:
  432. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  433. __m128i a = _mm_loadu_si128(&vals + i);
  434. ^
  435. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  436. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  437. from common.h:4,
  438. from sorted.c:4:
  439. /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 **’
  440. _mm_loadu_si128 (__m128i const *__P)
  441. ^
  442. In file included from sorted.c:4:0:
  443. common.h:65:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  444. _mm_storeu_si128(&four, temp_result);
  445. ^
  446. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  447. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  448. from common.h:4,
  449. from sorted.c:4:
  450. /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]’
  451. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  452. ^
  453.  
  454. (12:39:12 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  455. ~/labs/10/lab10-branch_prediction $ ./randomized
  456. Let's generate a randomized array.
  457. Starting randomized sum.
  458. Time taken: 26.049458 s
  459. Sum: 412646965248
  460. Starting randomized unrolled sum.
  461. Time taken: 21.435025 s
  462. Sum: 412646965248
  463. Starting randomized SIMD sum.
  464. Segmentation fault (core dumped)
  465.  
  466. (12:40:02 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  467. ~/labs/10/lab10-branch_prediction $ vim common.h
  468.  
  469. (12:54:03 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  470. ~/labs/10/lab10-branch_prediction $ cgdb randomized
  471.  
  472. (12:54:13 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  473. ~/labs/10/lab10-branch_prediction $ cgdb common.h
  474.  
  475. (12:54:22 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  476. ~/labs/10/lab10-branch_prediction $ cgdb common
  477.  
  478. (12:54:28 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  479. ~/labs/10/lab10-branch_prediction $ ls
  480. common.h Makefile randomized randomized.c sorted sorted.c
  481.  
  482. (12:54:30 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  483. ~/labs/10/lab10-branch_prediction $ make
  484. gcc --std=c99 randomized.c -o randomized
  485. In file included from randomized.c:4:0:
  486. common.h: In function ‘sum_simd’:
  487. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  488. __m128i a = _mm_loadu_si128(&vals + i);
  489. ^
  490. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  491. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  492. from common.h:4,
  493. from randomized.c:4:
  494. /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 **’
  495. _mm_loadu_si128 (__m128i const *__P)
  496. ^
  497. In file included from randomized.c:4:0:
  498. common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  499. _mm_storeu_si128(&four, temp_result);
  500. ^
  501. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  502. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  503. from common.h:4,
  504. from randomized.c:4:
  505. /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]’
  506. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  507. ^
  508. In file included from randomized.c:4:0:
  509. common.h: In function ‘sum_simd_unrolled’:
  510. common.h:97:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  511. __m128i a = _mm_loadu_si128(&vals + i);
  512. ^
  513. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  514. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  515. from common.h:4,
  516. from randomized.c:4:
  517. /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 **’
  518. _mm_loadu_si128 (__m128i const *__P)
  519. ^
  520. In file included from randomized.c:4:0:
  521. common.h:101:12: error: redefinition of ‘a’
  522. __m128i a = _mm_loadu_si128(&vals + i);
  523. ^
  524. common.h:97:12: note: previous definition of ‘a’ was here
  525. __m128i a = _mm_loadu_si128(&vals + i);
  526. ^
  527. common.h:101:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  528. __m128i a = _mm_loadu_si128(&vals + i);
  529. ^
  530. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  531. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  532. from common.h:4,
  533. from randomized.c:4:
  534. /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 **’
  535. _mm_loadu_si128 (__m128i const *__P)
  536. ^
  537. In file included from randomized.c:4:0:
  538. common.h:102:12: error: redefinition of ‘mask’
  539. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  540. ^
  541. common.h:98:12: note: previous definition of ‘mask’ was here
  542. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  543. ^
  544. common.h:105:12: error: redefinition of ‘a’
  545. __m128i a = _mm_loadu_si128(&vals + i);
  546. ^
  547. common.h:101:12: note: previous definition of ‘a’ was here
  548. __m128i a = _mm_loadu_si128(&vals + i);
  549. ^
  550. common.h:105:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  551. __m128i a = _mm_loadu_si128(&vals + i);
  552. ^
  553. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  554. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  555. from common.h:4,
  556. from randomized.c:4:
  557. /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 **’
  558. _mm_loadu_si128 (__m128i const *__P)
  559. ^
  560. In file included from randomized.c:4:0:
  561. common.h:106:12: error: redefinition of ‘mask’
  562. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  563. ^
  564. common.h:102:12: note: previous definition of ‘mask’ was here
  565. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  566. ^
  567. common.h:109:12: error: redefinition of ‘a’
  568. __m128i a = _mm_loadu_si128(&vals + i);
  569. ^
  570. common.h:105:12: note: previous definition of ‘a’ was here
  571. __m128i a = _mm_loadu_si128(&vals + i);
  572. ^
  573. common.h:109:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  574. __m128i a = _mm_loadu_si128(&vals + i);
  575. ^
  576. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  577. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  578. from common.h:4,
  579. from randomized.c:4:
  580. /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 **’
  581. _mm_loadu_si128 (__m128i const *__P)
  582. ^
  583. In file included from randomized.c:4:0:
  584. common.h:110:12: error: redefinition of ‘mask’
  585. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  586. ^
  587. common.h:106:12: note: previous definition of ‘mask’ was here
  588. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  589. ^
  590. common.h:117:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  591. _mm_storeu_si128(&four, temp_result);
  592. ^
  593. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  594. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  595. from common.h:4,
  596. from randomized.c:4:
  597. /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]’
  598. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  599. ^
  600. make: *** [randomized] Error 1
  601.  
  602. (12:54:37 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  603. ~/labs/10/lab10-branch_prediction $ make randomized
  604. gcc --std=c99 randomized.c -o randomized
  605. In file included from randomized.c:4:0:
  606. common.h: In function ‘sum_simd’:
  607. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  608. __m128i a = _mm_loadu_si128(&vals + i);
  609. ^
  610. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  611. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  612. from common.h:4,
  613. from randomized.c:4:
  614. /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 **’
  615. _mm_loadu_si128 (__m128i const *__P)
  616. ^
  617. In file included from randomized.c:4:0:
  618. common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  619. _mm_storeu_si128(&four, temp_result);
  620. ^
  621. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  622. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  623. from common.h:4,
  624. from randomized.c:4:
  625. /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]’
  626. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  627. ^
  628. In file included from randomized.c:4:0:
  629. common.h: In function ‘sum_simd_unrolled’:
  630. common.h:97:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  631. __m128i a = _mm_loadu_si128(&vals + i);
  632. ^
  633. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  634. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  635. from common.h:4,
  636. from randomized.c:4:
  637. /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 **’
  638. _mm_loadu_si128 (__m128i const *__P)
  639. ^
  640. In file included from randomized.c:4:0:
  641. common.h:101:12: error: redefinition of ‘a’
  642. __m128i a = _mm_loadu_si128(&vals + i);
  643. ^
  644. common.h:97:12: note: previous definition of ‘a’ was here
  645. __m128i a = _mm_loadu_si128(&vals + i);
  646. ^
  647. common.h:101:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  648. __m128i a = _mm_loadu_si128(&vals + i);
  649. ^
  650. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  651. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  652. from common.h:4,
  653. from randomized.c:4:
  654. /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 **’
  655. _mm_loadu_si128 (__m128i const *__P)
  656. ^
  657. In file included from randomized.c:4:0:
  658. common.h:102:12: error: redefinition of ‘mask’
  659. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  660. ^
  661. common.h:98:12: note: previous definition of ‘mask’ was here
  662. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  663. ^
  664. common.h:105:12: error: redefinition of ‘a’
  665. __m128i a = _mm_loadu_si128(&vals + i);
  666. ^
  667. common.h:101:12: note: previous definition of ‘a’ was here
  668. __m128i a = _mm_loadu_si128(&vals + i);
  669. ^
  670. common.h:105:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  671. __m128i a = _mm_loadu_si128(&vals + i);
  672. ^
  673. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  674. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  675. from common.h:4,
  676. from randomized.c:4:
  677. /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 **’
  678. _mm_loadu_si128 (__m128i const *__P)
  679. ^
  680. In file included from randomized.c:4:0:
  681. common.h:106:12: error: redefinition of ‘mask’
  682. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  683. ^
  684. common.h:102:12: note: previous definition of ‘mask’ was here
  685. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  686. ^
  687. common.h:109:12: error: redefinition of ‘a’
  688. __m128i a = _mm_loadu_si128(&vals + i);
  689. ^
  690. common.h:105:12: note: previous definition of ‘a’ was here
  691. __m128i a = _mm_loadu_si128(&vals + i);
  692. ^
  693. common.h:109:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  694. __m128i a = _mm_loadu_si128(&vals + i);
  695. ^
  696. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  697. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  698. from common.h:4,
  699. from randomized.c:4:
  700. /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 **’
  701. _mm_loadu_si128 (__m128i const *__P)
  702. ^
  703. In file included from randomized.c:4:0:
  704. common.h:110:12: error: redefinition of ‘mask’
  705. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  706. ^
  707. common.h:106:12: note: previous definition of ‘mask’ was here
  708. __m128i mask = _mm_cmpgt_epi32( a, _127 );
  709. ^
  710. common.h:117:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  711. _mm_storeu_si128(&four, temp_result);
  712. ^
  713. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  714. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  715. from common.h:4,
  716. from randomized.c:4:
  717. /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]’
  718. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  719. ^
  720. make: *** [randomized] Error 1
  721.  
  722. (12:54:41 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  723. ~/labs/10/lab10-branch_prediction $ vim common.h
  724.  
  725. (12:55:19 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  726. ~/labs/10/lab10-branch_prediction $ make randomized
  727. gcc --std=c99 randomized.c -o randomized
  728. In file included from randomized.c:4:0:
  729. common.h: In function ‘sum_simd’:
  730. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  731. __m128i a = _mm_loadu_si128(&vals + i);
  732. ^
  733. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  734. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  735. from common.h:4,
  736. from randomized.c:4:
  737. /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 **’
  738. _mm_loadu_si128 (__m128i const *__P)
  739. ^
  740. In file included from randomized.c:4:0:
  741. common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  742. _mm_storeu_si128(&four, temp_result);
  743. ^
  744. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  745. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  746. from common.h:4,
  747. from randomized.c:4:
  748. /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]’
  749. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  750. ^
  751.  
  752. (12:55:21 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  753. ~/labs/10/lab10-branch_prediction $ cgdb randomized
  754.  
  755. (12:55:55 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  756. ~/labs/10/lab10-branch_prediction $ gcc randomized.c
  757. In file included from randomized.c:4:0:
  758. common.h: In function ‘sum_simd’:
  759. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  760. __m128i a = _mm_loadu_si128(&vals + i);
  761. ^
  762. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  763. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  764. from common.h:4,
  765. from randomized.c:4:
  766. /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 **’
  767. _mm_loadu_si128 (__m128i const *__P)
  768. ^
  769. In file included from randomized.c:4:0:
  770. common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  771. _mm_storeu_si128(&four, temp_result);
  772. ^
  773. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  774. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  775. from common.h:4,
  776. from randomized.c:4:
  777. /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]’
  778. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  779. ^
  780. In file included from randomized.c:4:0:
  781. common.h: In function ‘sum_simd_unrolled’:
  782. common.h:90:10: warning: unused variable ‘_127’ [-Wunused-variable]
  783. __m128i _127 = _mm_set1_epi32(127);
  784. ^
  785.  
  786. (12:56:17 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  787. ~/labs/10/lab10-branch_prediction $ vim common.h
  788.  
  789. (12:56:51 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  790. ~/labs/10/lab10-branch_prediction $ gcc -g -o common common.o
  791. gcc: error: common.o: No such file or directory
  792. gcc: fatal error: no input files
  793. compilation terminated.
  794.  
  795. (12:57:57 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  796. ~/labs/10/lab10-branch_prediction $ gcc -g -o common common.h
  797. common.h: In function ‘sum’:
  798. common.h:10:2: error: unknown type name ‘clock_t’
  799. clock_t start = clock();
  800. ^
  801. common.h:10:2: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
  802. common.h:20:2: error: unknown type name ‘clock_t’
  803. clock_t end = clock();
  804. ^
  805. common.h:21:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
  806. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  807. ^
  808. common.h:21:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
  809. common.h:21:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
  810. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  811. ^
  812. common.h:21:61: note: each undeclared identifier is reported only once for each function it appears in
  813. common.h: In function ‘sum_unrolled’:
  814. common.h:26:2: error: unknown type name ‘clock_t’
  815. clock_t start = clock();
  816. ^
  817. common.h:46:2: error: unknown type name ‘clock_t’
  818. clock_t end = clock();
  819. ^
  820. common.h:47:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
  821. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  822. ^
  823. common.h:47:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
  824. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  825. ^
  826. common.h: In function ‘sum_simd’:
  827. common.h:52:2: error: unknown type name ‘clock_t’
  828. clock_t start = clock();
  829. ^
  830. common.h:60:4: warning: passing argument 1 of ‘_mm_loadu_si128’ from incompatible pointer type [enabled by default]
  831. __m128i a = _mm_loadu_si128(&vals + i);
  832. ^
  833. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  834. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  835. from common.h:4:
  836. /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 **’
  837. _mm_loadu_si128 (__m128i const *__P)
  838. ^
  839. common.h:66:3: warning: passing argument 1 of ‘_mm_storeu_si128’ from incompatible pointer type [enabled by default]
  840. _mm_storeu_si128(&four, temp_result);
  841. ^
  842. In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/xmmintrin.h:1246:0,
  843. from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:34,
  844. from common.h:4:
  845. /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]’
  846. _mm_storeu_si128 (__m128i *__P, __m128i __B)
  847. ^
  848. common.h:83:2: error: unknown type name ‘clock_t’
  849. clock_t end = clock();
  850. ^
  851. common.h:84:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
  852. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  853. ^
  854. common.h:84:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
  855. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  856. ^
  857. common.h: In function ‘sum_simd_unrolled’:
  858. common.h:89:2: error: unknown type name ‘clock_t’
  859. clock_t start = clock();
  860. ^
  861. common.h:98:2: error: unknown type name ‘clock_t’
  862. clock_t end = clock();
  863. ^
  864. common.h:99:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
  865. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  866. ^
  867. common.h:99:61: error: ‘CLOCKS_PER_SEC’ undeclared (first use in this function)
  868. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  869. ^
  870. common.h:90:10: warning: unused variable ‘_127’ [-Wunused-variable]
  871. __m128i _127 = _mm_set1_epi32(127);
  872. ^
  873.  
  874. (12:58:01 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  875. ~/labs/10/lab10-branch_prediction $ cgdb common
  876.  
  877. (12:58:15 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  878. ~/labs/10/lab10-branch_prediction $ ls
  879. a.out common.h Makefile randomized randomized.c sorted sorted.c
  880.  
  881. (12:58:16 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  882. ~/labs/10/lab10-branch_prediction $ vim common.h
  883.  
  884. (12:59:45 Mon Apr 02 2018 cs61c-aex@hive11 Linux x86_64)
  885. ~/labs/10/lab10-branch_prediction $ vim common.h
  886.  
  887. #ifndef COMMON_H
  888. #define COMMON_H
  889.  
  890. #include <x86intrin.h>
  891.  
  892. #define NUM_ELEMS ((1 << 16) + 10)
  893. #define OUTER_ITERATIONS (1 << 16)
  894.  
  895. long long int sum(unsigned int vals[NUM_ELEMS]) {
  896. clock_t start = clock();
  897.  
  898. long long int sum = 0;
  899. for(unsigned int w = 0; w < OUTER_ITERATIONS; w++) {
  900. for(unsigned int i = 0; i < NUM_ELEMS; i++) {
  901. if(vals[i] >= 128) {
  902. sum += vals[i];
  903. }
  904. }
  905. }
  906. clock_t end = clock();
  907. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  908. return sum;
  909. }
  910.  
  911. long long int sum_unrolled(unsigned int vals[NUM_ELEMS]) {
  912. clock_t start = clock();
  913. long long int sum = 0;
  914.  
  915. for(unsigned int w = 0; w < OUTER_ITERATIONS; w++) {
  916. for(unsigned int i = 0; i < NUM_ELEMS / 4 * 4; i += 4) {
  917. if(vals[i] >= 128) sum += vals[i];
  918. if(vals[i + 1] >= 128) sum += vals[i + 1];
  919. if(vals[i + 2] >= 128) sum += vals[i + 2];
  920. if(vals[i + 3] >= 128) sum += vals[i + 3];
  921. }
  922.  
  923. //This is what we call the TAIL CASE
  924. //For when NUM_ELEMS isn't a multiple of 4
  925. //NONTRIVIAL FACT: NUM_ELEMS / 4 * 4 is the largest multiple of 4 less than NUM_ELEMS
  926. for(unsigned int i = NUM_ELEMS / 4 * 4; i < NUM_ELEMS; i++) {
  927. if (vals[i] >= 128) {
  928. sum += vals[i];
  929. }
  930. }
  931. }
  932. clock_t end = clock();
  933. printf("Time taken: %Lf s\n", (long double)(end - start) / CLOCKS_PER_SEC);
  934. "common.h" 110L, 3245C 1,1 Top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement