/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 dict_hw/src/normxcorr_hw.cu.h

  • Committer: Suren A. Chilingaryan
  • Date: 2010-04-23 00:02:19 UTC
  • Revision ID: csa@dside.dyndns.org-20100423000219-xagi3lp4su6g1y8e
Tags: single_gpu
CUDAfication of real-time module

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
        return DICT_ERROR_CUDA_MALLOC;
145
145
    }
146
146
        
147
 
        // DS: We don't actually need that to be CP_BLOCK, just unblock computations in loadbase and set to single
148
147
    cuda_err = cudaMalloc((void**)&ps->cuda_base_buffer, CP_BLOCK * ps->fft_alloc_size * sizeof(cufftReal));
149
148
    if (cuda_err) {
150
149
        reportError("Device memory allocation of %u*cufftReal bytes for cuda_base_buffer is failed", ps->fft_alloc_size);
172
171
    printf("Temp buffer : %i\n", size/1024/1024);
173
172
    printf("Points      : %i\n", 2 * ps->ncp_alloc_size * sizeof(float) / 1024 / 1024);
174
173
    printf("Input buffer: %i\n", CP_BLOCK * side_alloc_size2 * sizeof(uint8_t) / 1024 / 1024);
175
 
    printf("Data buffer : 2 x %i\n", CP_BLOCK * ps->fft_alloc_size * sizeof(cufftReal) / 1024 / 1024);
 
174
    printf("Data buffer : 2x %i\n", CP_BLOCK * ps->fft_alloc_size * sizeof(cufftReal) / 1024 / 1024);
176
175
    printf("Lsum temp   : %i\n", 4 * lsum_alloc_size2  * sizeof(float) / 1024 / 1024);
177
176
    printf("Cache       : %i\n", ps->ncp * ps->fft_alloc_size * (2 * sizeof(float) + sizeof(cufftComplex)) / 1024 / 1024);
178
177
    printf("No Cache    : %i\n", CP_BLOCK * ps->fft_alloc_size * (2 * sizeof(float) + sizeof(cufftComplex)) / 1024 / 1024);
179
178
*/
180
179
 
181
180
        // Counting necessary memory, here is cache memory, 64MB is considered for other needs (base and current images)
182
 
    if ((ps->use_cache)&&((cache_memory + 67108864) > device_memory)) ps->use_cache = 0;
183
 
//    ps->use_cache = 0;
 
181
    if ((ps->use_cache)&&((cache_memory + CUDA_EXTRA_MEMORY) > device_memory)) ps->use_cache = 0;
184
182
    
185
183
    ncp_cache = ps->use_cache?ps->ncp:CP_BLOCK;
186
184