Instead of representing vectors as a pointer to a length field, we would represent them as a pair of a length and a pointer to the data. We pay a bit more for pointers, but it means we don't have to dereference memory as often to find the length. In particular, this means we'll be able to launch kernels without incurring a copy.
Instead of representing vectors as a pointer to a length field, we would represent them as a pair of a length and a pointer to the data. We pay a bit more for pointers, but it means we don't have to dereference memory as often to find the length. In particular, this means we'll be able to launch kernels without incurring a copy.