The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unrecognized Token during Kernel Compilation

Hi

I'm trying to compile a kernel that I've written myself from scratch. For the host program to invoke the compilation process, I used the source code from Matthew Scarpino's book in chapter 2, "program_build." While the original version compiles both original kernels fine, I get a whole series of "unrecognized token" errors on the same line until it gives up after 100 errors.

Any clues to what this could be?

I'm using C in Visual Studio 2008
I was using AMD Catalyst 12.4 and have updated to 12.8.
I was using the beta version of the SDK (I was running a 4850). However, I've just upgraded and updated to 2.7.923.1
The problem persists.

Last 2 lines of my code are:

Code :

}

The brace is line 279, the line below (line 280) exists but there's nothing there, not even a space. It exists only because there's a carriage return after the brace in line 279.

Re: Unrecognized Token during Kernel Compilation

As I was saying, I was using source code from Matthew Scarpino's book in chapter 2, "program_build" that reads in a .cl file for compilation. There appears to be a bug in this source code in the line:

Code :

program_handle = fopen(file_name[i], "r");

Further investigation says about ftell (which is used a few lines further) from http://www.cplusplus.com/reference/c.../cstdio/ftell/Returns the current value of the position indicator of the stream.
For binary streams, the value returned corresponds to the number of bytes from the beginning of the file.
For text streams, the value is not guaranteed to be the exact number of bytes from the beginning of the file, but the value returned can still be used to restore the position indicator to this position using fseek.