Basic principle of the proposed method.
Figure (a) shows two kernels that execute sequentially, the first one creates the distance matrix and the second one identifies the nearest neighbours. Figure (b)–(c) shows the proposed method of computing kNN using chunk, split and segment of the original matrix. The original matrix is never kept in the device memory, each time a chunk is computed and respective NNs are identified. Figure (d) shows an illustrative chunking of data for further scalability by splitting the data set horizontally into number of data chunks.