Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Thrust sort_by_key issue when using zip_iterator values
  2. typedef thrust::device_vector<int> IntVec;
  3. IntVec keyVec(100);
  4. IntVec fooVec(100);
  5. IntVec barVec(100);
  6. for (int z = 0; z < 100; z++)
  7. {
  8.    keyVec[z] = rand();
  9.    fooVec[z] = z;
  10.    barVec[z] = z;
  11. }
  12. thrust::sort_by_key( keyVec.begin(), keyVec.end(),
  13.                      thrust::make_zip_iterator( make_tuple( fooVec.begin(), barVec.begin() ) ) );
  14.        
  15. key,foo,bar (presort)
  16.    3,1,1
  17.    2,2,2
  18.    ...
  19.  
  20.    key,foo,bar (what i expect post sort)
  21.    2,2,2
  22.    3,1,1
  23.    ...
  24.  
  25.    key,foo,bar (what i actually get)      
  26.    2,1,1
  27.    3,2,2
  28.    ...
  29.        
  30. OS: RHEL 6.0 x86_64
  31. CUDA Version: 4.1 (also tested with 4.1.1.5)
  32. Thrust Version: 1.5
  33. GPU: 4x nVidia Corporation GF100 [GeForce GTX 480] (rev a3)  
  34. nvidia driver: 290.10
  35. nvcc version: release 4.1, V0.2.1221
  36. compile string: nvcc testfile.cu