   bool pass = true;
   for (int i=0; i<NUM_ELMTS && pass; i++)
   {
-    int in_index = ALIGN_OFFSET+(h_offsets[i]/sizeof(float));
+    int in_index = ALIGN_OFFSET+(h_offsets[i]*BYTES_PER_ELMT/sizeof(float));
     int out_index = ALIGN_OFFSET+i*BYTES_PER_ELMT/sizeof(float);
 #if 0
     printf("elment %d result: ",i);

        return true;
      }
      tries++;
      int off = (rand() % (262144));
      off *= PARAM_ALIGNMENT;
      // Check if the offset is good
      bool good = true;

  extern __shared__ float buffer[];

  cudaDMAIndirect<false,false,ALIGNMENT,BYTES_PER_ELMT>
    dma0(num_elmts);

  initialize_buffer(buffer, buffer_size);
  __syncthreads();
  float *base_ptr = &(odata[ALIGN_OFFSET]);
  dma0.execute_dma(offsets, &(buffer[ALIGN_OFFSET]), base_ptr);
}

template<int ALIGNMENT, int ALIGN_OFFSET>
