Showing results for 
Search instead for 
Did you mean: 

Archives Discussions


Wording of error "argument type to opencl as_* function: expected src and dst have the same size"

Perhaps this should go to the driver section, I am not sure.

The error described in title can be produced by e.g.

ulong foo = 42;


As the specification mandates the return type of as_* calls to have as many bits as the argument.

I've had this issue reported weeks ago and my understanding was just the opposite: I understood it failed because the arguments are the same size!

As far as I am concened, it should read:

"argument type to opencl as_* function: expected src and dst must have the same size"

4 Replies

Thanks for the report. I can see why you would be confused, I would be to.

Before I send this off, can you give me a little context? I want to get it to the right place first time if possible. I'm trying to narrow down what tool/component might be spitting out this error. I'm guessing this is at compile time, and it's the compiler?

I apologize; I've cut it a bit too short.

This was initially reported to me as a screenshot from an user who run an application I wrote.

It is indeed run time error from the compiler. The code is published and the error arises kernel-side from here.

The real issue which originated the problem is some implementation returning 64 bit as get_global_id(i). I don't remember if the user was running an AMD device but that's not relevant in this context.


The wording of an error message is always low priority, but the good thing is, it's usually a totally trivial fix - just changing a string. If I learn anything real, I'll let you know.

Otherwise, Thanks, and I'll get that to the team.


No problem; it's fine to at least have it in the todo list. No need to report it either!