Let get_work_dim take exactly 0 arguments

Without void, an arbitrary number of arguments is allowed to be passed (per the C standard). This does not seem to be the intention of the specification of this function.

Index: amdgcn/lib/workitem/get_work_dim.cl

Without void, an arbitrary number of arguments is allowed to be
passed (per the C standard). This does not seem to be the intention
of the specification of this function.

I'm surprised CLC would allow programs to call functions without proper
prototype.
LGTM.
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>

Jan

Thanks for the review.

I think it’s allowed because it’s perfectly valid C, and I’m actually not aware of anyrestrictions in the spec that stop you from writing this. It’s a bit odd though not to
get an error message when you pass an argument to get_work_dim.

Jeroen

P.S. I will check in this patch and the other myself, but it might take a bit, because
I’m somewhat behind the tip of the tree at the moment.

Thanks for the review.

I think it's allowed because it’s perfectly valid C, and I’m actually not aware of any
restrictions in the spec that stop you from writing this. It’s a bit odd though not to
get an error message when you pass an argument to get_work_dim.

Right, quite an obscure feature.
I remember getting "error: function with no prototype cannot use the
spir_function calling convention" from the link-program piglit on
beignet, so I thought it was CLC restriction.
anyway I learnt something new.

thanks,
Jan

Thanks for the review.

I think it’s allowed because it’s perfectly valid C, and I’m actually not aware of any
restrictions in the spec that stop you from writing this. It’s a bit odd though not to
get an error message when you pass an argument to get_work_dim.

Right, quite an obscure feature.
I remember getting “error: function with no prototype cannot use the
spir_function calling convention” from the link-program piglit on
beignet, so I thought it was CLC restriction.

That could be. Compiling a call to the get_work_dim function without void in the
prototype results in an LLVM call instruction with a bitcast in it, and I don’t think
that’s allowed by SPIR. Thing is that the SPIR is a bit more strict in this respect
(and also in some other respects) than OpenCL C.

Jeroen