[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

Alexey Sachkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 08:13:11 PDT 2018


AlexeySachkov marked 7 inline comments as done.
AlexeySachkov added inline comments.


================
Comment at: test/SemaOpenCL/intel-subgroup-avc-ext-types.cl:13
+
+#define CLK_AVC_IME_PAYLOAD_INITIALIZE_INTEL   { 0 }
+#define CLK_AVC_REF_PAYLOAD_INITIALIZE_INTEL   { 0 }
----------------
Anastasia wrote:
> Just 0 would work too?
Yes, it would


================
Comment at: test/SemaOpenCL/intel-subgroup-avc-ext-types.cl:26
+         char4 c4, event_t e, struct st ss) {
+  intel_sub_group_avc_mce_payload_t payload_mce = 0; // No zero initializer for mce types
+  // expected-error at -1 {{initializing 'intel_sub_group_avc_mce_payload_t' with an expression of incompatible type 'int'}}
----------------
Anastasia wrote:
> Would it make sense to add a check for non-zero constant?
> 
> Also can you assign variables of intel_sub_group_avc_mce_payload_t type from the same type? Any other restrictions on assignment (i.e. w integer literals) and operations over these types?
> Also can you assign variables of intel_sub_group_avc_mce_payload_t type from the same type?

Yes, such assignment is allowed.

> Any other restrictions on assignment (i.e. w integer literals)

All of these types can only be initialized using call to a special built-ins or using predefined macros like `CLK_AVC_REF_RESULT_INITIALIZE_INTEL`. Any other assignment should lead to an error. 

I found that I'm able to assign variable of type `intel_sub_group_avc_imc_payload_t` to variable of type `intel_sub_group_avc_mce_payload_t`, so I will update the patch when I implement such diagnostic message.

> and operations over these types?
Variables of these types can only be used as return values or arguments for built-in functions described in the specification. All other operations are restricted


https://reviews.llvm.org/D51484





More information about the cfe-commits mailing list