This is code for vector operations with pinned memory.