Preliminary support for OpenGL <-> OpenCL interop #28

merged 4 commits into from Feb 8, 2012

2 participants


I've started implementing OpenGL interop.

  • Some of the complexity is that Apple's OpenCL implementation violates the spec regarding the defined constants for GL context sharing. I've accounted for this with #ifdefs in the code.

  • The context is treated as a Ptr (). I don't know if it's worth trying to use a more descriptive type. I suspect not as this is inherently low-level, platform-dependent plumbing, and should really be sealed up in a library.

  • To that end, it may be helpful to add a module, or release a separate package, including the requisite glue-code for each platform. I've written this code on OS X (it's just a few lines of FFI), but not yet released it anywhere public. One argument for not including this in the OpenCL package is that it seems to violate the package's design principle of being a direct, low-level mapping to the OpenCL API. I will probably add this to my CLUtil library in the near term.

@zhensydow zhensydow merged commit 5a64212 into IFCA:develop Feb 8, 2012
IFCA Advanced Computing and e-Science group member

Most of the opaque values from OpenCL are treated as Ptr (), but we don't operate with them in haskell. We only pass it between functions. So, It's rigth to treat context as a Ptr ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment