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

  • Committer: Suren A. Chilingaryan
  • Date: 2010-04-26 04:25:33 UTC
  • Revision ID: csa@dside.dyndns.org-20100426042533-3wr2uspls2257szg
Fixed a bug causing invalid device enumeration on a second call to dictDetectHardware

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    cudaGetDeviceCount(&deviceCount);
54
54
    if (!deviceCount) return -1;
55
55
 
 
56
    device_number = 0;
56
57
    for (int i = 0; i < deviceCount; i++) {
57
58
        cudaGetDeviceProperties(&deviceProp, i);
58
59
        if ((deviceProp.major > 1)||((deviceProp.major == 1)&&(deviceProp.minor > 2))) {
61
62
                if (memory < device_memory) device_memory = memory;
62
63
#ifdef DICT_SUPPORT_THREADS
63
64
                devices[device_number++] = i;
 
65
                if (device_number == DICT_HW_MAX_DEVICES) break;
64
66
#else /* DICT_SUPPORT_THREADS */
65
67
                device_number = 1;
66
68
#endif /* DICT_SUPPORT_THREADS */