Skip to content

Commit

Permalink
optimize occupancy
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBoessen committed Jan 20, 2025
1 parent a1a7a57 commit 3ca01bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bool isSorted(int *arr, int size) {
}

int main() {
const int SIZE = 1024; // Must be a multiple of 32 for this example
const int SIZE = 1048576; // Must be a multiple of 32 for this example

// Allocate and initialize host array
int *h_arr = new int[SIZE];
Expand Down
2 changes: 1 addition & 1 deletion smem_bitonic_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ __global__ void smemBitonicSort(int *arr, int size) {
}

void launchBitonicSort(int *arr, int size) {
const int BLOCK_SIZE = 1024;
const int BLOCK_SIZE = 512;
smemBitonicSort<<<(size + BLOCK_SIZE - 1) / BLOCK_SIZE, BLOCK_SIZE,
BLOCK_SIZE * sizeof(int)>>>(arr, size);
}
2 changes: 1 addition & 1 deletion warp_bitonic_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ __global__ void warpBitonicSort(int *arr, int size) {
}

void launchBitonicSort(int *arr, int size) {
const int BLOCK_SIZE = 256;
const int BLOCK_SIZE = 512;
warpBitonicSort<<<size / BLOCK_SIZE, BLOCK_SIZE>>>(arr, size);
}

0 comments on commit 3ca01bb

Please sign in to comment.