Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPC support #92

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

ISPC support #92

wants to merge 24 commits into from

Conversation

pema99
Copy link

@pema99 pema99 commented Apr 12, 2022

This PR adds support for ispc, which is Intel's data parallel C dialect. We've been using these changes to generate ISPC code for a new backend for the Futhark compiler. The PR does not add support for every language construct unique to ISPC, but for the large portion of them that were sufficient for our use case.

We've attempted to pattern match from the existing codebase, but couldn't quite figure out how the script for generating Syntax-instances.hs works, so we added the relevant typeclasses instances manually. Hope that is fine.

The PR introduces one new shift-reduce error, which is the dangling else problem but for ISPC's own cif construct. I've added a note.

Added:

  • A new ISPC module which encompasses the added language constructs
  • uniform and varying type qualifiers.
  • foreach, foreach_active, foreach_unique, foreach_tiled loops.
  • export and unmasked storage qualifiers.
  • cif, cfor, cwhile, cdo/while constructs for coherent control flow.
  • An antiquotation, $foreachiters, to parse iteration spaces for foreach loops, such as i = 0 ... n.
  • A new test suite exercising all the added functionality.

Notable missing language constructs:

  • new and delete syntax for allocating arrays.
  • launch construct for multithreading.
  • Short vector notation, ie. float<3>.
  • Struct-of-array qualifiers, ie. soa<8> Point pts[n];
  • Reference syntax for interacting with C++, just typical &.

Most of these are either fairly niche, and not really necessary for writing idiomatic ISPC for most use cases, though.

@pema99
Copy link
Author

pema99 commented Apr 12, 2022

@athas FYI

@pema99
Copy link
Author

pema99 commented Apr 19, 2022

The CI failure seems to be a network issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants