CMU-SAFARI / SneakySnake

SneakySnake:snake: is the first and the only pre-alignment filtering algorithm that works efficiently and fast on modern CPU, FPGA, and GPU architectures. It greatly (by more than two orders of magnitude) expedites sequence alignment calculation for both short and long reads. Described in the Bioinformatics (2020) by Alser et al. https://arxiv.org/abs/1910.09020.
GNU General Public License v3.0
48 stars 11 forks source link

Snake-on-GPU - Number_of_blocks_inside_each_kernel corrected #2

Closed TheMightyDuckOfDoom closed 2 years ago

TheMightyDuckOfDoom commented 3 years ago

The team got a message regarding the calculation of Number_of_blocks_inside_each_kernel in Snake-on-GPU.

The line was:

int Number_of_blocks_inside_each_kernel = ceil(NumReads / Concurrent_threads_In_Block);

where NumReads and Concurrent_threads_In_Block are of type int. Because there is no casting to a float or double, an integer division is used which rounds toward zero. Since the division results in an int, ceil isn't doing anything.

The easiest solution would be to add a cast of values into a double.

int Number_of_blocks_inside_each_kernel = ceil(((double) NumReads) / ((double) Concurrent_threads_In_Block));

If possible, we should mention the person who pointed out this error.