Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ISPC has some support for this using the "soa<>" qualifier. For example,

  struct Point { float x, y, z; };
  soa<8> Point pts[...];
  for (int i = 0; i < 8; ++i) {
    pts[i].x + pts[i].y
  }
behaves as if originally written like

  struct Point { float x[8], y[8], z[8]; };
  Point pts;
  for (int i = 0; i < 8; ++i) {
    pts.x[i] + pts.y[i];
  }
See https://ispc.github.io/ispc.html#structure-of-array-types

I've not yet had an excuse to use ISPC myself, unfortunately :(



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: