We will now look at CUDA's Vectorized Data Types. These are vectorized versions of the standard datatypes, such as int or double, in that they can store multiple values. There are vectorized versions of the 32-bit types of up to size 4 (for example, int2, int3, int4, and float4), while 64-bit variables can only be vectorized to be twice their original size (for example, double2 and long2). For a size 4 vectorized variable, we access each individual element using the C "struct" notation for the members x, y, z, and w, while we use x,y, and z for a 3-member variable and just x and y for a 2-member variable.
These may seem pointless right now, but these datatypes can be used to improve the performance of loading arrays from the global memory. Now, let's do a small test to see how we can load some int4 variables from an...