37Liion's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Contributors
Active Posts:
50 (0.03 per day)
Joined:
18-February 10
Profile Views:
1,973
Last Active:
User is offline Feb 27 2014 10:53 PM
Currently:
Offline

Previous Fields

Dream Kudos:
50
Icon   37Liion is on a warm beach somewhere in cyberland :)

Posts I've Made

  1. In Topic: Matrix Multiplication Benchmark. New to C/C++, Any Advice?

    Posted 4 Feb 2014

    View Postbaavgai, on 03 February 2014 - 04:11 AM, said:

    vector<vector <float> > m1 = *(new vector<vector<float> >(MAX_SIZE, vector<float>(MAX_SIZE)));
    
    


    That is a truly bizarre memory leak, there.

    Why not:
    vector<vector <float> > m1(MAX_SIZE, vector<float>(MAX_SIZE));
    
    


    No reason other than having been babied in Java.

    I like your version of the code. Much easier to read than what I had before. Use of typedef is new to me but easily understood.
  2. In Topic: Matrix Multiplication Benchmark. New to C/C++, Any Advice?

    Posted 2 Feb 2014

    View PostSkydiver, on 02 February 2014 - 08:14 PM, said:

    Now as for you can do better than that advice... If instead using a vector of vectors, your allocated the memory as a flat array and just provided the appropriate accessors, you will very likely getting better performance because you'll get better cache locality. Even better, if you make the second matrix reverse the rows and columns, you'll get even better cache locality and improve the speed even more.


    So something like making MAX_SIZE^2 size arrays? So [i][j] would be [i*MAX_SIZE + j]?
    And reverse the second because m1[i][k]*m2[j][k] is faster than m1[i][k]*m2[k][j]?
  3. In Topic: Matrix Multiplication Benchmark. New to C/C++, Any Advice?

    Posted 2 Feb 2014

    Interesting. He explicitly stated not to do anything fancy optimization wise as that will be our next task, but now I'll know a couple of techniques to look into. I probably don't need to store the results in array since I'm not doing anything with them and I currently don't account for the changing of NUM_RUNS and MAX_SIZE.
  4. In Topic: Matrix Multiplication Benchmark. New to C/C++, Any Advice?

    Posted 2 Feb 2014

    Changed it to be a little more clear. :)
  5. In Topic: Can I have a drop down menu inside a table?

    Posted 30 Nov 2013

    Indeed, not using a function seems to have fixed it.
    That helps. Thank you.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

37Liion hasn't added any friends yet.

Comments

37Liion has no profile comments yet. Why not say hello?