This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by echuraev on Jul 5 2017, 2:05 AM.

Diff Detail

Event Timeline

echuraev created this revision.Jul 5 2017, 2:05 AM
Anastasia edited edge metadata.Jul 5 2017, 9:57 AM

Btw, is there any reason to add testing specifically for half? Is there anything specific to half in the implementation of this?

test/CodeGenOpenCL/kernel-arg-info.cl
79

could you add space b/w half and *. Also could we format consistently below?

echuraev updated this revision to Diff 105375.Jul 5 2017, 11:39 PM
echuraev marked an inline comment as done.

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...

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, 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...

echuraev updated this revision to Diff 106851.Jul 17 2017, 4:49 AM
Anastasia accepted this revision.Jul 17 2017, 7:00 AM

LGTM! Thanks!

This revision is now accepted and ready to land.Jul 17 2017, 7:00 AM
echuraev closed this revision.Jul 17 2017, 11:04 PM