Note that there are some explanatory texts on larger screens.

plurals
  1. POBetter way to get OpenCL syntax highlighting in Eclipse 4.2.1?
    text
    copied!<p>I'm wondering if there's a better way to get syntax highlighting for OpenCL in Eclipse 4.2.1 CDT. The only way I could figure out was something I did by accident, which seems to work so far, but I hope there's a better way because this way seems almost like a bug or something:</p> <blockquote> <p>Go to: Window -> Preferences -> General -> Content Types -> Text -> C Source File -> C++ Source File</p> <p>Under file associations, click Add, and in the popup window, type: *.cl</p> <p>Click OK, then click OK</p> <p>Open any .cl file from the Project Explorer to see that it's almost good. There is now some syntax highlighting, but there are syntax errors showing for perfectly valid OpenCL code...</p> <p>Go back to the same area of the Preferences menu where you were before, remove the *.cl rule that you previously added.</p> <p>Click OK, then click OK</p> <p>Close the .cl file and open it again, now it should mostly be good!</p> </blockquote> <p>Of course, this method only highlights code that's valid C++ (not even all of it), and ignores OpenCL-specific stuff, but it's the closest thing to proper syntax highlighting I can figure out how to get in Eclipse.</p> <p>This appears to "work" because it allows the .cl file to be opened with Eclipse's C/C++ Editor (enabling some syntax highlighting), and also excludes the file from both the static analyzer (removes some syntax errors) and the automatically generated project Makefile (prevents Eclipse from trying to build the .cl file as if it were C++ source).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload