title: Sorting arrays of structures in CUDA
body: <p>I have a laptop with an NVIDIA GT750M 4Gb (compute capability 3.0) graphics card. I need to sort an array of structures on CUDA (about 3 × 10^7 elements). But I cannot figure out how, since I do not have enough experience in CUDA. When using <code>thrust::sort</code> I get strange results (it takes a few tens of minutes, while <code>std::sort</code> takes <code>1</code> minute).</p>
  
  <pre><code>struct MyStruct
  {
      float key;
      float a;
      float b;
      int c;
      int d;
      int e;
      int f;
      bool flag;
  }
  bool minCompare(const MyStruct lhs, const MyStruct rhs)
  {
      return lhs.key &lt; rhs.key;
  }
  </code></pre>