Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Plug memory leak in CG. (patch by João Muranho)
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 23, 2009
1 parent abc23a5 commit e4c9833
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cg.hpp
Expand Up @@ -98,7 +98,8 @@ namespace iterative_cuda
a(q, d);

gpu_scalar_t alpha(1);
divide(alpha, *delta_new, *d.dot(q));
std::auto_ptr<gpu_scalar_t> d_dot_q(d.dot(q));
divide(alpha, *delta_new, *d_dot_q);

x.set_to_linear_combination(1, x, 1, alpha, d);

Expand Down

0 comments on commit e4c9833

Please sign in to comment.