View Single Post
  #12   Spotlight this post!  
Unread 06-12-2014, 16:44
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: OPR Programming Challenge

Quote:
Originally Posted by Michael Hill View Post
EDIT: I actually just realized there was some code that slows it down in there. the "gather"s in developing the "out" matrix are more remnants of GPU computing that I didn't take out. They are used for getting the variables out of GPU memory to my RAM. After removing them, It took total computation time to about 0.48 seconds.
Here's another optimization you can try. Replace this code:

X = A\B(:,1);
Y = A\B(:,2);

... with this:

XY = A\B

... then you'll have only one left-divide, and the XY vector will be a 2-column vector containing X and Y.