[PATCH] D32896: [OpenCL] Make CLK_NULL_RESERVE_ID invalid reserve id.

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 13:11:16 PDT 2017


yaxunl added inline comments.


================
Comment at: lib/Headers/opencl-c.h:16020
+// The macro CLK_NULL_RESERVE_ID refers to an invalid reservation ID.
+#define CLK_NULL_RESERVE_ID (__builtin_astype((void *)0, reserve_id_t))
 bool __ovld is_valid_reserve_id(reserve_id_t reserve_id);
----------------
Anastasia wrote:
> Looks good from my side.
> 
> @yaxunl , since you originally committed this. Could you please verify that changing from `SIZE_MAX` to `0` would be fine.
> 
> Btw, we have a similar definition for `CLK_NULL_EVENT`.
`__PIPE_RESERVE_ID_VALID_BIT` is implementation detail and not part of the spec. I would suggest to remove it from this header file.

The spec only requires CLK_NULL_RESERVE_ID to be defined but does not define its value. Naturally a valid id starts from 0 and increases. I don't see significant advantage to change CLK_NULL_RESERVE_ID from __SIZE_MAX to 0.

Is there any reason that this change is needed?


https://reviews.llvm.org/D32896





More information about the cfe-commits mailing list