Commit 9474c2835439c325ea2025a94879f7b311830f61

Authored by Pavel Govyadinov
1 parent 7ada0a48

removed some unused variables that cause the generation of warnings

stim/cuda/cuda_texture.cuh
... ... @@ -134,15 +134,15 @@ namespace stim
134 134 void
135 135 UnmapCudaTexture()
136 136 {
137   - HANDLE_ERROR(
138   - cudaGraphicsUnmapResources(1, &resource)
139   - );
140   - HANDLE_ERROR(
141   - cudaGraphicsUnregisterResource(resource)
142   - );
143   - HANDLE_ERROR(
144   - cudaDestroyTextureObject(tObj)
145   - );
  137 + // HANDLE_ERROR(
  138 + // cudaGraphicsUnmapResources(1, &resource)
  139 + // );
  140 + // HANDLE_ERROR(
  141 + // cudaGraphicsUnregisterResource(resource)
  142 + // );
  143 + // HANDLE_ERROR(
  144 + // cudaDestroyTextureObject(tObj)
  145 + // );
146 146 // HANDLE_ERROR(
147 147 // cudaFreeArray(srcArray)
148 148 // );
... ...
stim/cuda/filter.cuh
... ... @@ -7,6 +7,7 @@
7 7 #include <stdio.h>
8 8 #include <stim/visualization/colormap.h>
9 9 #include <sstream>
  10 +#include <stim/math/constants.h>
10 11 #include <stim/cuda/cudatools/devices.h>
11 12 #include <stim/cuda/cudatools/threads.h>
12 13 #include <stim/cuda/cuda_texture.cuh>
... ... @@ -14,7 +15,6 @@
14 15 #include <stim/cuda/arraymath.cuh>
15 16  
16 17 #define IMAD(a,b,c) ( __mul24((a), (b)) + (c) )
17   -#define M_PI 3.141592654f
18 18  
19 19  
20 20 namespace stim
... ... @@ -73,7 +73,7 @@ namespace stim
73 73 idx = j*kl+i;
74 74 x = i - kr - 0.5;
75 75 y = j - kr - 0.5;
76   - LoG[idx] = (-1.0/M_PI/powf(sigma, 4))* (1 - (powf(x,2)+powf(y,2))/2.0/powf(sigma, 2))
  76 + LoG[idx] = (-1.0/PI/powf(sigma, 4))* (1 - (powf(x,2)+powf(y,2))/2.0/powf(sigma, 2))
77 77 *expf(-(powf(x,2)+powf(y,2))/2/powf(sigma,2));
78 78 t +=LoG[idx];
79 79 }
... ... @@ -98,7 +98,7 @@ namespace stim
98 98 int y = blockIdx.y;
99 99 int xi = threadIdx.x;
100 100 int yi = threadIdx.y;
101   - float val = 0;
  101 + // float val = 0;
102 102 float tu = (x-kr+xi)/(float)DIM_X;
103 103 float tv = (y-kr+yi)/(float)DIM_Y;
104 104 shared[xi][yi] = gpuLoG[yi*kl+xi]*(255.0-(float)tex2D<unsigned char>(texIn, tu, tv));
... ... @@ -111,7 +111,7 @@ namespace stim
111 111 //y = min(y, height - 1);
112 112  
113 113 int idx = y*DIM_X+x;
114   - int k_idx;
  114 + // int k_idx;
115 115 for(unsigned int step = blockDim.x/2; step >= 1; step >>= 1)
116 116 {
117 117 __syncthreads();
... ...
stim/cuda/ivote/down_sample.cuh
... ... @@ -44,7 +44,7 @@ namespace stim{
44 44 unsigned int y_ds = (y/sigma_ds + (y %sigma_ds == 0 ? 0:1));
45 45  
46 46 //get the number of pixels in the image
47   - unsigned int pixels_ds = x_ds * y_ds;
  47 +// unsigned int pixels_ds = x_ds * y_ds;
48 48  
49 49 unsigned int max_threads = stim::maxThreadsPerBlock();
50 50 dim3 threads(max_threads, 1);
... ... @@ -97,4 +97,4 @@ namespace stim{
97 97 }
98 98 }
99 99  
100   -#endif
101 100 \ No newline at end of file
  101 +#endif
... ...
stim/gl/gl_spider.h
... ... @@ -14,6 +14,7 @@
14 14 #include <stim/math/vec3.h>
15 15 #include <stim/math/rect.h>
16 16 #include <stim/math/matrix.h>
  17 +#include <stim/math/constants.h>
17 18 #include <stim/cuda/spider_cost.cuh>
18 19 #include <stim/cuda/cudatools/glbind.h>
19 20 #include <stim/cuda/arraymath.cuh>
... ... @@ -369,7 +370,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
369 370 ///Stored in a display list.
370 371 ///uses the default d vector <0,0,1>
371 372 void
372   - genDirectionVectors(float solidAngle = 5/M_PI*4)
  373 + genDirectionVectors(float solidAngle = M_PI/2)
373 374 {
374 375  
375 376 //Set up the vectors necessary for Rectangle creation.
... ... @@ -584,7 +585,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
584 585 glDeleteFramebuffers(1, &framebufferID);
585 586 glGenFramebuffers(1, &framebufferID);
586 587 glBindFramebuffer(GL_FRAMEBUFFER, framebufferID);
587   - int numChannels = 1;
  588 +// int numChannels = 1;
588 589 // unsigned char* texels = new unsigned char[width * height * numChannels];
589 590 glGenTextures(1, &textureID);
590 591 glBindTexture(GL_TEXTURE_2D, textureID);
... ... @@ -609,7 +610,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
609 610 {
610 611 glGenFramebuffers(1, &fboID);
611 612 glBindFramebuffer(GL_FRAMEBUFFER, fboID);
612   - int numChannels = 1;
  613 +// int numChannels = 1;
613 614 // unsigned char* texels = new unsigned char[width * height * numChannels];
614 615 glGenTextures(1, &texbufferID);
615 616 glBindTexture(GL_TEXTURE_2D, texbufferID);
... ... @@ -938,7 +939,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
938 939 network_time = 0;
939 940 hit_time = 0;
940 941 #endif
941   - stepsize = 3.0;
  942 + stepsize = 2.5;
942 943 t_length = 16.0;
943 944  
944 945 srand(100);
... ... @@ -1386,7 +1387,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1386 1387 void
1387 1388 MonteCarloDirectionVectors(int nSamples, float solidAngle = 2*M_PI)
1388 1389 {
1389   - float PHI[2], Z[2], range;
  1390 + float PHI[2], Z[2];
1390 1391 PHI[0] = asin(solidAngle/2);
1391 1392 PHI[1] = asin(0);
1392 1393  
... ... @@ -1396,9 +1397,6 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1396 1397  
1397 1398 range = Z[0] - Z[1];
1398 1399  
1399   -
1400   - float z, theta, phi;
1401   -
1402 1400 std::vector<stim::vec3<float> > vecsUni;
1403 1401 for(int i = 0; i < numSamplesPos; i++)
1404 1402 {
... ... @@ -1490,8 +1488,6 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1490 1488 void
1491 1489 trace(int min_cost)
1492 1490 {
1493   - bool sEmpty = true;
1494   - float lastmag = 16.0;;
1495 1491 stim::vec3<float> curSeed;
1496 1492 stim::vec3<float> curSeedVec;
1497 1493 float curSeedMag;
... ... @@ -1527,7 +1523,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1527 1523 gpuStartTimer();
1528 1524 #endif
1529 1525  
1530   - float s = 3.0;
  1526 +// float s = 3.0;
1531 1527 GLuint selectBuf[2048];
1532 1528 GLint hits;
1533 1529 glSelectBuffer(2048, selectBuf);
... ... @@ -1541,17 +1537,17 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1541 1537 CHECK_OPENGL_ERROR
1542 1538 //What would that vessel see in front of it.
1543 1539 camSel.setPosition(loc);
1544   - camSel.setFocalDistance(mag/s);
1545   - camSel.LookAt((loc[0]+dir[0]*mag/s),
1546   - (loc[1]+dir[1]*mag/s),
1547   - (loc[2]+dir[2]*mag/s));
  1540 + camSel.setFocalDistance(mag/stepsize);
  1541 + camSel.LookAt((loc[0]+dir[0]*mag/stepsize),
  1542 + (loc[1]+dir[1]*mag/stepsize),
  1543 + (loc[2]+dir[2]*mag/stepsize));
1548 1544 ps = camSel.getPosition();
1549 1545 ups = camSel.getUp();
1550 1546 ds = camSel.getLookAt();
1551 1547 glMatrixMode(GL_PROJECTION);
1552 1548 glPushMatrix();
1553 1549 glLoadIdentity();
1554   - glOrtho(-mag/s/2.0, mag/s/2.0, -mag/s/2.0, mag/s/2.0, 0.0, mag/s/2.0);
  1550 + glOrtho(-mag/stepsize/2.0, mag/stepsize/2.0, -mag/stepsize/2.0, mag/stepsize/2.0, 0.0, mag/stepsize/2.0);
1555 1551 glMatrixMode(GL_MODELVIEW);
1556 1552 glPushMatrix();
1557 1553 glLoadIdentity();
... ... @@ -1597,21 +1593,11 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1597 1593 int
1598 1594 processHits(GLint hits, GLuint buffer[])
1599 1595 {
1600   - GLuint names, *ptr;
1601   - //printf("hits = %u\n", hits);
  1596 + GLuint *ptr;
1602 1597 ptr = (GLuint *) buffer;
1603   - // for (int i = 0; i < hits; i++) { /* for each hit */
1604   - names = *ptr;
1605   - // printf (" number of names for hit = %u\n", names);
1606 1598 ptr++;
1607 1599 ptr++; //Skip the minimum depth value.
1608 1600 ptr++; //Skip the maximum depth value.
1609   - // printf (" the name is ");
1610   - // for (int j = 0; j < names; j++) { /* for each name */
1611   - // printf ("%u ", *ptr); ptr++;
1612   - // }
1613   - // printf ("\n");
1614   - // }
1615 1601  
1616 1602  
1617 1603 if(hits == 0)
... ... @@ -1675,11 +1661,18 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1675 1661 }
1676 1662  
1677 1663 #ifdef TIMING
1678   - double network_time = (std::clock() - s) / (double) CLOCKS_PER_SEC;
1679   - network_time += network_time * 1000.0;
  1664 + double nt = (std::clock() - s) / (double) CLOCKS_PER_SEC;
  1665 + network_time += nt * 1000.0;
1680 1666 #endif
1681 1667 }
1682 1668  
  1669 +// void
  1670 +// addToNetwork(pair<stim::fiber<float>, int> in, stim::vec3<float> spos,
  1671 +// stim::vec<float> smag, stim::vec3<float> sdir)
  1672 +// {
  1673 +//
  1674 +// }
  1675 +
1683 1676  
1684 1677 void
1685 1678 printSizes()
... ... @@ -1783,9 +1776,6 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
1783 1776 }
1784 1777 }
1785 1778 }
1786   -
1787   -
1788   -
1789 1779 };
1790 1780 }
1791 1781 #endif
... ...
stim/math/matrix.h
... ... @@ -53,13 +53,13 @@ struct matrix
53 53  
54 54 template<typename Y>
55 55 vec<Y> operator*(vec<Y> rhs){
56   - unsigned int N = rhs.size();
  56 + unsigned int M = rhs.size();
57 57  
58 58 vec<Y> result;
59   - result.resize(N);
  59 + result.resize(M);
60 60  
61   - for(int r=0; r<N; r++)
62   - for(int c=0; c<N; c++)
  61 + for(int r=0; r<M; r++)
  62 + for(int c=0; c<M; c++)
63 63 result[r] += (*this)(r, c) * rhs[c];
64 64  
65 65 return result;
... ...