Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/popsift/sift_octave.cu
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ void Octave::download_and_save_array( const char* basename, int octave )
mkdir("dir-octave", 0700);
}

if (stat("dir-interm", &st) == -1) {
mkdir("dir-interm", 0700);
}

if (stat("dir-octave-dump", &st) == -1) {
mkdir("dir-octave-dump", 0700);
}
Expand Down Expand Up @@ -160,6 +164,22 @@ void Octave::download_and_save_array( const char* basename, int octave )
popsift::dump_plane2Dfloat(ostr2.str().c_str(), false, p );
}

memset( &s, 0, sizeof(cudaMemcpy3DParms) );
s.srcArray = _intm;
s.dstPtr = make_cudaPitchedPtr( array, width * sizeof(float), width, height );
s.extent = make_cudaExtent( width, height, _levels );
s.kind = cudaMemcpyDeviceToHost;
err = cudaMemcpy3D(&s);
POP_CUDA_FATAL_TEST(err, "cudaMemcpy3D failed: ");

for( int l = 0; l<_levels; l++ ) {
Plane2D_float p(width, height, &array[l*width*height], width * sizeof(float));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor, canp be const?
Normally write_plane2Dunscaled should just write it to a file without modifying it. (sorry cannot check atm...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually, it can definitely be const. I’ll try and see if the underlying plane code needs updates for that.


ostringstream ostr;
ostr << "dir-interm/" << basename << "-o-" << octave << "-l-" << l << ".pgm";
popsift::write_plane2Dunscaled( ostr.str().c_str(), false, p );
}

memset( &s, 0, sizeof(cudaMemcpy3DParms) );
s.srcArray = _dog_3d;
s.dstPtr = make_cudaPitchedPtr(array, width * sizeof(float), width, height);
Expand Down
15 changes: 15 additions & 0 deletions testImages/box-12x12.pgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
P2
12 12
255
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 255 255 255 255 0 0 0 0
0 0 0 0 255 0 0 255 0 0 0 0
0 0 0 0 255 0 0 255 0 0 0 0
0 0 0 0 255 255 255 255 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
9 changes: 9 additions & 0 deletions testImages/box-6x6.pgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
P2
6 6
255
0 0 0 0 0 0
0 0 255 255 255 0
0 0 255 0 255 0
0 0 255 255 255 0
0 0 0 0 0 0
0 0 0 0 0 0
32 changes: 32 additions & 0 deletions testImages/input-in-bytes.pgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
P2
32 29
255
66 66 68 68 66 66 62 62 60 60 56 52 52 50 46 48 50 50 56 58 58 56 60 64 86 106 121 129 131 133 135 137
62 64 66 66 62 64 62 62 60 60 58 56 52 50 46 48 50 58 64 70 78 80 84 88 112 121 126 129 131 133 135 137
62 58 62 62 62 62 62 62 62 62 56 52 52 48 44 44 44 56 78 86 78 88 98 104 118 124 126 129 131 133 137 139
64 64 64 62 62 60 60 62 60 56 56 48 48 42 35 33 33 48 76 86 88 94 104 114 118 121 126 129 131 133 137 139
64 64 64 64 62 62 60 62 58 56 52 46 42 42 29 17 29 46 62 70 80 90 108 120 120 126 129 131 133 135 139 143
64 62 62 62 62 60 58 58 58 52 48 42 35 25 19 15 19 33 50 56 72 86 110 124 126 131 133 137 141 137 143 145
64 62 60 60 60 60 58 56 56 52 46 33 31 17 5 0 7 17 27 42 58 78 106 126 126 131 135 141 141 137 143 145
62 62 58 58 58 58 56 56 52 50 44 29 29 15 1 0 0 5 11 19 42 70 108 126 131 135 141 145 145 143 147 149
60 60 58 56 58 56 58 60 58 52 48 33 27 13 0 0 0 0 0 5 31 70 108 121 133 137 143 145 145 149 151 151
56 56 52 52 52 52 56 60 58 52 48 35 23 7 0 0 0 0 0 3 35 78 116 126 135 137 143 143 147 151 153 153
56 50 50 48 50 52 52 56 56 56 50 46 40 29 21 11 7 11 27 46 70 100 121 145 137 141 141 145 147 151 153 157
48 48 46 46 48 48 50 50 52 60 60 60 60 50 42 42 42 46 58 76 90 112 126 135 141 143 143 147 151 155 157 157
48 50 50 48 48 46 46 46 48 64 80 80 80 80 78 78 80 88 94 106 118 129 133 137 143 145 147 151 151 157 157 157
52 50 50 48 46 44 44 42 48 66 92 94 96 100 106 104 104 106 116 121 131 135 137 141 145 147 149 151 153 157 157 157
48 50 48 46 46 42 40 35 46 70 92 104 108 114 114 118 118 121 131 131 129 133 135 137 141 145 151 153 157 159 157 159
48 48 46 44 40 40 33 29 44 70 90 112 121 121 121 126 129 129 133 133 133 141 143 145 147 149 153 157 159 161 159 161
48 48 44 35 33 29 29 23 33 64 92 112 129 131 129 129 121 129 131 135 143 147 145 147 149 151 157 159 159 161 161 161
48 48 42 35 27 25 21 17 25 52 80 106 131 135 135 133 133 137 143 143 143 149 149 149 151 151 157 159 161 161 161 161
44 44 42 33 29 19 15 15 25 44 66 100 121 133 135 135 133 141 145 145 145 149 151 151 157 159 159 161 163 163 163 165
44 44 40 31 25 15 11 11 17 31 60 92 116 133 139 143 143 145 149 147 151 155 155 155 157 161 161 161 163 165 165 165
42 42 42 27 17 11 7 5 7 19 52 80 112 133 141 149 149 149 151 155 155 157 157 159 161 163 163 163 165 165 165 167
44 56 52 27 7 3 5 3 13 21 33 64 108 133 141 149 149 149 151 151 157 159 161 161 165 165 167 167 167 167 167 167
52 64 56 33 17 13 15 15 15 17 31 62 106 133 143 155 149 149 157 159 157 161 163 163 165 165 165 165 169 169 169 169
66 76 73 62 44 33 33 35 33 33 42 66 116 141 149 157 155 151 159 161 161 163 165 165 165 165 169 169 169 169 169 169
84 92 98 94 72 60 62 62 60 62 64 88 131 155 157 159 159 159 159 161 163 165 169 169 169 169 169 169 169 169 169 169
100 112 118 116 94 86 86 88 88 90 94 112 143 157 157 161 161 159 159 165 169 169 169 169 169 171 171 171 171 171 171 171
114 129 133 129 126 116 114 114 114 118 121 131 145 155 159 161 161 161 161 169 169 169 171 171 171 171 171 171 171 171 171 171
120 133 135 139 137 131 126 126 129 131 133 143 151 155 161 163 163 165 165 169 169 171 171 171 171 171 171 171 171 171 171 171
129 135 137 141 145 145 145 147 143 141 141 149 159 161 163 165 165 169 171 171 171 173 173 173 173 173 173 173 173 173 173 173