Commit 4fa3f483d835aecbccf022b117b2fb48d9884c59

Authored by Pavel Govyadinov
1 parent 7d3162a2

Fixed the memory leak in MY code, but not ingeneral. The leak is in the image.h save function

stim/cuda/testKernel.cuh
@@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
120 cudaDeviceSynchronize(); 120 cudaDeviceSynchronize();
121 stringstream name; //for debugging 121 stringstream name; //for debugging
122 name << nam.c_str(); 122 name << nam.c_str();
123 - stim::gpu2image<float>(print, name.str(),x,y,0,255); 123 + //stim::gpu2image<float>(print, name.str(),x,y,0,255);
124 124
125 tx.UnmapCudaTexture(); 125 tx.UnmapCudaTexture();
126 cleanUP(); 126 cleanUP();
stim/gl/gl_spider.h
@@ -52,7 +52,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt; @@ -52,7 +52,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
52 stim::vec3<float> p; //vector designating the position of the spider. 52 stim::vec3<float> p; //vector designating the position of the spider.
53 stim::vec3<float> d; //vector designating the orientation of the spider 53 stim::vec3<float> d; //vector designating the orientation of the spider
54 //always a unit vector. 54 //always a unit vector.
55 - stim::vec3<float> m; //magnitude of the spider vector. 55 + stim::vec<float> m; //magnitude of the spider vector.
56 //mag[0] = length. 56 //mag[0] = length.
57 //mag[1] = width. 57 //mag[1] = width.
58 std::vector<stim::vec3<float> > dV; //A list of all the direction vectors. 58 std::vector<stim::vec3<float> > dV; //A list of all the direction vectors.
@@ -983,7 +983,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt; @@ -983,7 +983,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
983 } 983 }
984 984
985 ///Returns the m vector. 985 ///Returns the m vector.
986 - vec<float> 986 + stim::vec<float>
987 getMagnitude() 987 getMagnitude()
988 { 988 {
989 return m; 989 return m;
@@ -1092,7 +1092,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt; @@ -1092,7 +1092,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1092 ///rotates from 0.0, 0.0, 1.0 to dir. 1092 ///rotates from 0.0, 0.0, 1.0 to dir.
1093 ///return is in degrees for use with glRotatef. 1093 ///return is in degrees for use with glRotatef.
1094 stim::vec<float> 1094 stim::vec<float>
1095 - getRotation(stim::vec<float> dir) 1095 + getRotation(stim::vec3<float> dir)
1096 { 1096 {
1097 stim::vec<float> out(0.0,0.0,0.0,0.0); 1097 stim::vec<float> out(0.0,0.0,0.0,0.0);
1098 stim::vec<float> from(0.0,0.0,1.0); 1098 stim::vec<float> from(0.0,0.0,1.0);
@@ -1104,7 +1104,8 @@ class gl_spider : public virtual gl_texture&lt;T&gt; @@ -1104,7 +1104,8 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1104 out[3] = 1.0; 1104 out[3] = 1.0;
1105 } else { 1105 } else {
1106 stim::vec<float> temp(0.0, 0.0, 0.0);; 1106 stim::vec<float> temp(0.0, 0.0, 0.0);;
1107 - temp = (from.cross(dir)).norm(); 1107 + stim::vec<float> dir1(dir[0], dir[1], dir[2]);
  1108 + temp = (from.cross(dir1)).norm();
1108 out[1] = temp[0]; 1109 out[1] = temp[0];
1109 out[2] = temp[1]; 1110 out[2] = temp[1];
1110 out[3] = temp[2]; 1111 out[3] = temp[2];
stim/math/vector.h
@@ -75,12 +75,12 @@ struct vec : public std::vector&lt;T&gt; @@ -75,12 +75,12 @@ struct vec : public std::vector&lt;T&gt;
75 } 75 }
76 } 76 }
77 77
78 - vec( vec3<T>& other){  
79 - resize(3); //resize the current vector to match the copy  
80 - for(size_t i=0; i<3; i++){ //copy each element  
81 - at(i) = other[i];  
82 - }  
83 - } 78 +// vec( vec3<T>& other){
  79 +// resize(3); //resize the current vector to match the copy
  80 +// for(size_t i=0; i<3; i++){ //copy each element
  81 +// at(i) = other[i];
  82 +// }
  83 +// }
84 84
85 //I'm not sure what these were doing here. 85 //I'm not sure what these were doing here.
86 //Keep them now, we'll worry about it later. 86 //Keep them now, we'll worry about it later.