       {
         offsets[cnt++] = off;
         printf("%d ", off);
-        if ((off/int(sizeof(float))) > max_offset)
-          max_offset = off/int(sizeof(float));
+        if ((off*PARAM_ELMT_SIZE/int(sizeof(float))) > max_offset)
+          max_offset = off*PARAM_ELMT_SIZE/int(sizeof(float));
         off_set.insert(off);
       }
     }

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

  for (int i = 0; i<NUM_ELMTS && pass; i++)
  {
    float out_value = ALIGN_OFFSET+i*BYTES_PER_ELMT/sizeof(float);
    int out_index = ALIGN_OFFSET+(h_offsets[i]*BYTES_PER_ELMT/sizeof(float));
    for (int j = 0; j<(BYTES_PER_ELMT/sizeof(float)); j++)
    {
      if (h_odata[out_index] != (out_value+float(j)))
