/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to cuda/normxcorr_hw_kernel.cu

  • Committer: Suren A. Chilingaryan
  • Date: 2009-12-10 16:34:35 UTC
  • Revision ID: csa@dside.dyndns.org-20091210163435-43ccu65nj1qi96d2
Compile with --use_fast_math option of nvcc

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
    int y = __float2int_rz(__fdividef(blockIdx.x, blocks_size));
183
183
    int x = (blockIdx.x - y * blocks_size) * blockDim.x + threadIdx.x ;
184
184
 
185
 
    int i = x + y * corr_row_pitch + point * pitch;
186
 
    int pos = x + y * row_pitch + point * pitch;
 
185
    int i = x +  + point * pitch;
 
186
    int pos = i + y * row_pitch;
 
187
    i += y * corr_row_pitch;
187
188
 
188
189
    float lsum_scale = lsum_scale_ptr[point] * lsum_mult;
189
190
    float denom_scale = denom_scale_ptr[point];
190
191
 
191
192
    if (denom[pos]&&denom_scale) {
192
 
        res[pos] = (corr[i] * corr_scale - lsum[pos] * lsum_scale) / (denom[pos] * denom_scale);
 
193
        res[pos] = __fdividef((corr[i] * corr_scale - lsum[pos] * lsum_scale), (denom[pos] * denom_scale));
193
194
    }
194
195
}
195
196