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.

invalid address space for argument to _kernel function

Hi,

I wrote a kernel that takes a vector<int> type as an argument,
but when I run it the compiler seems not to recognize this type,
vector<int> is defined in "c:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector"

my Kernel is defined in a .cl file.

How can I include header files to a .cl file to allow kernels to take structures defined in those files as arguments?

Re: invalid address space for argument to _kernel function

OpenCL just provides buffers. You can put whatever you'd like in them. So if you want a long list of ints just make it the right size and copy them in. You can then access it as an array. You won't have any of the nice OO features of STL, though.

OpenCL will compile your .h files if you include them either from the compile command or with a #include in your kernel and they are in the right location. Otherwise it will not include anything other than the actual string you use to create a program.

Re: invalid address space for argument to _kernel function

Try directly copy-and-pasting your header into the cl code you're passing to clCreateProgram and see if that works. If it does, then it sounds like a driver bug accessing the header file. If not, then there's a problem with your header file.