Skip to contentSkip to conversation

realtime: fix min and max calculations in matrix multiplication test

PATCH In review Gowrishankar 2 participants 2 messages Jun 29, 2010 – Jul 1, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 realtime: fix min and max calculations in matrix multiplication test

From: gowrishankar <[email protected]>

In matrix multiplication test, the min and max calculations are done on stats_container_t data with its index field never set to the last element position. Due to this min and max are always shown with the first record value (as index was initiated with -1).

---
 testcases/realtime/func/matrix_mult/matrix_mult.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/realtime/func/matrix_mult/matrix_mult.c +2 -0
index 419f697..fa0e352 100644
@@ -222,6 +222,7 @@ void main_thread(void)
 
 	/* run matrix mult operation sequentially */
 	curdat = &sdat;
+	curdat->index = iterations-1;
 	printf("\nRunning sequential operations\n");
 	start = rt_gettime();
 	for (i = 0; i < iterations; i++)
@@ -252,6 +253,7 @@ void main_thread(void)
 	pthread_barrier_init(&mult_start, NULL, numcpus+1);
 	set_priority(PRIO);
 	curdat = &cdat;
+	curdat->index = iterations-1;
 	online_cpu_id = -1; /* Redispatch cpus */
 	/* Create numcpus-1 concurrent threads */
 	for (j = 0; j < numcpus; j++) {
Signature · 11 lines
1.7.1


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 8 lines · Gowrishankar

From: gowrishankar <[email protected]>

In matrix multiplication test, the min and max calculations are done on stats_container_t data with its index field never set to the last element position. Due to this min and max are always shown with the first record value (as index was initiated with -1).

Thanks.

Regards--
Subrata

Quoted 20 lines
---
 testcases/realtime/func/matrix_mult/matrix_mult.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
testcases/realtime/func/matrix_mult/matrix_mult.c +1 -0
index 419f697..fa0e352 100644
@@ -222,6 +222,7 @@ void main_thread(void)
 
 	/* run matrix mult operation sequentially */
 	curdat = &sdat;
+	curdat->index = iterations-1;
 	printf("\nRunning sequential operations\n");
 	start = rt_gettime();
 	for (i = 0; i < iterations; i++)

testcases/realtime/func/matrix_mult/matrix_mult.c void main_thread(void) · line 259

Quoted 7 lines
testcases/realtime/func/matrix_mult/matrix_mult.c +1 -0
@@ -252,6 +253,7 @@ void main_thread(void)
 	pthread_barrier_init(&mult_start, NULL, numcpus+1);
 	set_priority(PRIO);
 	curdat = &cdat;
+	curdat->index = iterations-1;
 	online_cpu_id = -1; /* Redispatch cpus */
 	/* Create numcpus-1 concurrent threads */
 	for (j = 0; j < numcpus; j++) {

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list