From 2f904a130697a3bb27360214e89b98689a6aae1d Mon Sep 17 00:00:00 2001 From: yuchen Date: Mon, 23 Mar 2015 09:11:45 +0800 Subject: [PATCH] add linux little progs for locality --- related_info/lab3/locality/Makefile | 7 +++++++ related_info/lab3/locality/badlocality.c | 12 ++++++++++++ related_info/lab3/locality/goodlocality.c | 12 ++++++++++++ related_info/lab3/locality/locality.md | 7 +++++++ 4 files changed, 38 insertions(+) create mode 100644 related_info/lab3/locality/Makefile create mode 100644 related_info/lab3/locality/badlocality.c create mode 100644 related_info/lab3/locality/goodlocality.c create mode 100644 related_info/lab3/locality/locality.md diff --git a/related_info/lab3/locality/Makefile b/related_info/lab3/locality/Makefile new file mode 100644 index 0000000..62ae3a2 --- /dev/null +++ b/related_info/lab3/locality/Makefile @@ -0,0 +1,7 @@ +all: goodlocality badlocality +goodlocality: + gcc -O0 -g -o goodlocality goodlocality.c +badlocality: + gcc -O0 -g -o badlocality badlocality.c +clean: + rm goodlocality badlocality diff --git a/related_info/lab3/locality/badlocality.c b/related_info/lab3/locality/badlocality.c new file mode 100644 index 0000000..3bd87ee --- /dev/null +++ b/related_info/lab3/locality/badlocality.c @@ -0,0 +1,12 @@ +#include +#define NUM 1024 +#define COUNT 10 +int A[NUM][NUM]; +void main (void) { + int i,j,k; + for (k = 0; k +#define NUM 1024 +#define COUNT 10 +int A[NUM][NUM]; +void main (void) { + int i,j,k; + for (k = 0; k