[PATCH] D35000: [OpenCL] Added extended tests on metadata generation for half data type and arrays.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 13 09:27:24 PDT 2017


Anastasia added a comment.

In https://reviews.llvm.org/D35000#807674, @echuraev wrote:

> In https://reviews.llvm.org/D35000#801132, @Anastasia wrote:
>
> > In https://reviews.llvm.org/D35000#799705, @Anastasia wrote:
> >
> > > Btw, is there any reason to add testing specifically for half? Is there anything specific to half in the implementation of this?
> >
> >
> > Trying to understand the reason for this change though...
>
>
> Sorry for a delay in response. No it is not any reason to add testing specifically for half. We can also do the same tests for other data types. Here we just check that it is no any qualifiers in metadata.


Btw, if I read the spec then it feels like we should put the qualifiers of the pointee type instead:

`CL_KERNEL_ARG_TYPE_VOLATILE` is returned if the argument is a pointer and the referenced type is declared with the `volatile` qualifier. For example, a kernel argument declared as `global int volatile *x` returns `CL_KERNEL_ARG_TYPE_VOLATILE` but a kernel argument declared as `global int *volatile x` does not. Similarly, `CL_KERNEL_ARG_TYPE_RESTRICT` or `CL_KERNEL_ARG_TYPE_CONST` is returned if the argument is a pointer and the referenced type is declared with the `restrict` or `const` qualifier. For example, a kernel argument declared as `global int const *x` returns `CL_KERNEL_ARG_TYPE_CONST` but a kernel argument declared as `global int *const x` does not.

It seems that the function `foo` is attempting to test that too. Perhaps we could unify the testing and create all combinations of pointer and non pointer types which would have qualifier and not.

I don't feel that we should test all possible types though...


https://reviews.llvm.org/D35000





More information about the cfe-commits mailing list