Making the test harness for hw3 work

4 views
Skip to first unread message

Vineeth Kashyap

unread,
Apr 21, 2011, 4:58:23 PM4/21/11
to UCSB Computer Science 240A Spring 2011
Hi All,

To make the test harness work for hw3 correctly, you need to make the
following changes in innerproduct.cilk:
1. Change the last argument to all std::inner_product calls to 0.0
2. Change 1000.d to 1000.f (search and replace)

Kyle Klein

unread,
Apr 21, 2011, 5:40:57 PM4/21/11
to ucsb-computer-scien...@googlegroups.com
I had the same issues, but also I had problems with the correctness checks. In my case it seemed to expect far too much accuracy, lowering it to something more reasonable allowed answers to be accepted that clearly should have. This was a result of floating point imprecision causing a solution from summing one element after another to be quite different from a recursive implementation. 

I also seemed to have overflow problems with the way the vectors are currently initialized, so I changed that as well.

best,
Kyle
--
Kyle Klein 
Ph.D. Student 
Department of Computer Science UC Santa Barbara

John Gilbert

unread,
Apr 21, 2011, 5:50:00 PM4/21/11
to ucsb-computer-scien...@googlegroups.com
Sorry about the harness problems!  Kyle, if you'll send me your debugged harness I'll put it on the course web site for everyone to use.

Thanks,

- John

Kyle Klein

unread,
Apr 21, 2011, 6:15:45 PM4/21/11
to ucsb-computer-scien...@googlegroups.com
I might be wrong as it seems Vineeth wasn't having those issues after his fixes. I will check to be sure.

best,
Kyle

Kyle Klein

unread,
Apr 21, 2011, 10:44:16 PM4/21/11
to ucsb-computer-scien...@googlegroups.com
I haven't got to test it, but I think Vineeth's solution will fix the issues I encountered myself. I overlooked the fact he said to change it to 0.0, leaving it as 0 will not work. So to reiterate I'll copy it here:

On Thu, Apr 21, 2011 at 1:58 PM, Vineeth Kashyap <vinee...@gmail.com> wrote:
Hi All,

To make the test harness work for hw3 correctly, you need to make the
following changes in innerproduct.cilk:
1. Change the last argument to all std::inner_product calls to 0.0
2. Change 1000.d to 1000.f (search and replace)

best,
Kyle 
Reply all
Reply to author
Forward
0 new messages