Where can I find the definition of _cl_platform_id ?


I try to do a sizeof on a _cl_platform_id but it gives me the error :
invalid application of ‘sizeof’ to incomplete type ‘_cl_platform_id’
I read that I need to get the definition of _cl_platform_id in order to perform this sizeof.

Can someone tell me where I can find this definition please ? I searched in my opencl headers but I can’t find it.

Best regards.

You can’t. The type is implementation defined and not guaranteed to be accessible from user code.

But lets take a step back for a second. Why do you need the sizeof _cl_platform_id? What are you trying to do?

I need to transfer the value of ad cl_platform_id from a processus to another. I’m using an existing buffer class to transfer data and it needs its size. As I figured cl_platform_id is a pointer, I just cast it into an unsigned long and it works. The problem is solved, thank you for your help.