cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

johnsmith
Journeyman III

Intro OpenCL Tutorial - code formatting

Referring to: http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-resources/introductory-tutorial-to-opencl...

Thanks for the article by the way - it's an excellent introduction!

Just a small point regarding the article: can you please fix the code formatting? It's quite broken. Tabs are not shown, new lines are not there or placed in bad places. I have to pull out the code and reformat it in a text editor before I can read it properly!

Thanks

0 Likes
3 Replies
jtrudeau
Staff

Thanks for the feedback!

I'll have someone look at the code in that article, but it looks fine to me - using Chrome. Might be could use some indentation.... but pretty legible. What you describe is definitely not what's intended.

codesnippet.png

Jim

0 Likes

That's a very basic example. Here's a more complex one:

amd code.PNG.png

And here's 10 seconds of my effort to fix it:

amd code - fixed.PNG.png

You see how a bit of whitespace can make things much more readable? And I can't believe line 8 is the way it's supposed to be with the platformVendor declaration immediately following the platformList output.

0 Likes

Thanks! That helps. I'll look at that blog and see if the code formatting utility that's in place munges things, or if it's just bad coding style.

If the formatting is fixable, I guarantee a fix. (how often do you see THAT from a major corporation) As for the quality/precision of the code around line 8, I'll have someone more competent in OpenCL code than I take a look at it.

0 Likes