Description
Assignments of values to variable names are done with the assignment operator (=), like

lvalue = expression
The assignment operator stores the value of expression into lvalue. The expression and lvalue must have the same type, or the expression must have a type in https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_C.html#tablebuiltinscalartypes, in which case an implicit conversion will be done on the expression before the assignment is done.
If expression is a scalar type and lvalue is a vector type, the scalar is converted to the element type used by the vector operand. The scalar type is then widened to a vector that has the same number of components as the vector operand. The operation is done componentwise resulting in the same size vector.
Any other desired typeconversions must be specified explicitly. Lvalues must be writable. Variables that are builtin types, entire structures or arrays, structure fields, lvalues with the field selector (.) applied to select components or swizzles without repeated fields, lvalues within parentheses, and lvalues dereferenced with the array subscript operator ([]) are all lvalues. Other binary or unary expressions, function names, swizzles with repeated fields, and constants cannot be lvalues. The ternary operator (?:) is also not allowed as an lvalue.
The order of evaluation of the operands is unspecified. If an attempt is made to modify the result of an assignment operator or to access it after the next sequence point, the behavior is undefined. Other assignment operators are the assignments add into (+=), subtract from (=), multiply into (=), divide into (/=), modulus into (%=), left shift by (<<=), right shift by (>>=), and into (&=), inclusive or into (=), and exclusive or into (^=).
The expression

lvalue op*=* expression
is equivalent to

lvalue = lvalue op expression
and the lvalue and expression must satisfy the requirements for both operator op and assignment (=).
Except for the 
See Also
Document Notes
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright (c) 20142020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.