In addition to the previously described initializations, all of the remaining memory allocation is performed. The CUB library from NVIDIA is used to perform sorting (See Sec. III B 1). This library requires some additional memory to be allocated, so calls to the sorting functions are done to determine the largest needed size of the work buffer.