Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on batchSize #302

Open
gong-yuan opened this issue Oct 2, 2024 · 1 comment
Open

Question on batchSize #302

gong-yuan opened this issue Oct 2, 2024 · 1 comment

Comments

@gong-yuan
Copy link

I saw that batchSize appear in multiple places in the repo, e.g.

uint blockCount = batchSize * arrayLength / SHARED_SIZE_LIMIT;

in bitonicSort.cu.

Would it be possible to explain what does it mean? Given an array of arrayLength, why would we want to do it batchSize times?

Thank you so much for your consideration.

Best regards,
Yuan

@ghost
Copy link

ghost commented Oct 24, 2024

The expression (batchSize * arrayLength) seems to indicate the size of the original array.
So, blockCount should be the number of blocks needed to work with such elements (keeping in mind the size limitation of shared memory).

Note that in all uses of batchSize in the definition of the bitonicSort function, it has been in expressions like this (batchSize * arrayLength).
If you look at the invocation of bitonicSort, you will see that the argument for the batchSize parameter is (N / arrayLength).
Remember that shared memory is allocated per thread block.

The link explaining the algorithm (in the file) is broken. The updated one is https://hwlang.de/algorithmen/sortieren/bitonic/bitonicen.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant