/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/local_sum.cu

  • Committer: Suren A. Chilingaryan
  • Date: 2009-12-10 03:43:22 UTC
  • Revision ID: csa@dside.dyndns.org-20091210034322-8umwx60j7ix21l86
Enforce naming conventions for buffers and caches

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    int aligned_size = ps->lsum_aligned_size;
25
25
    int short_size = ps->lsum_short_aligned_size;
26
26
 
 
27
    int fft_size = ps->fft_size;
 
28
 
 
29
    cudaMemset(tmp1, 0, fft_size * ps->lsum_alloc_size * sizeof(float));
 
30
    cudaMemset(tmp2, 0, fft_size * ps->lsum_alloc_size * sizeof(float));
 
31
 
27
32
        // All arrays should be aligned
28
33
    cudppMultiScan(ps->cudpp_plan, tmp1 + lsize * alloc_size, in1 + lsize * alloc_size, temp_size, size);
29
34
    cudppMultiScan(ps->cudpp_plan, tmp2 + lsize * alloc_size, in2 + lsize * alloc_size, temp_size, size);
56
61
    if (lsum&&denom) {
57
62
        float *tmp = (float*)malloc(size2*sizeof(float));
58
63
        
59
 
        cudaMemcpy(tmp, ps->cuda_lsum_buffer + icp * alloc_size, size2*sizeof(float), cudaMemcpyDeviceToHost);
 
64
        cudaMemcpy(tmp, ps->cuda_lsum_cache + icp * alloc_size, size2*sizeof(float), cudaMemcpyDeviceToHost);
60
65
        float *real =  (float*)mxGetData(lsum);
61
66
        if (memcmp(tmp, real, size2*sizeof(float))) {
62
67
            printf("lsum fault: %i\n", 1);
69
74
            }
70
75
        }
71
76
 
72
 
        cudaMemcpy(tmp, ps->cuda_denom_buffer + icp * alloc_size, size2*sizeof(float), cudaMemcpyDeviceToHost);
 
77
        cudaMemcpy(tmp, ps->cuda_denom_cache + icp * alloc_size, size2*sizeof(float), cudaMemcpyDeviceToHost);
73
78
        real =  (float*)mxGetData(denom);
74
79
        if (memcmp(tmp, real, size2*sizeof(float))) {
75
80
            for (int i = 0; i < size2; i++) {