Skip to content

Commit f784a13

Browse files
committed
fix kernel launch and make workflow
1 parent cfd44ee commit f784a13

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Build with Makefile
3636
run: |
3737
# Make sure the Makefile exists and then build the project
38-
if [ -f makefile ]; then
38+
if [ -f Makefile ]; then
3939
make
4040
else
4141
echo "Makefile not found!"

global_bitonic_sort.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
*/
2222
__global__ void globalSwap(int i, int j, int *arr) {
2323
// thread id within grid
24-
int x = threadIdx.x * blockIdx.x * blockDim.x;
24+
int x = threadIdx.x + blockIdx.x * blockDim.x;
25+
2526
// distance between caller and source lanes
2627
int mask = 1 << (i - j);
2728

@@ -67,7 +68,7 @@ void globalBitonicSort(int *arr, int size, int block_size,
6768
int num_blocks) { // make bitonic sequence and sort
6869
for (int i = 0; (1 << i) <= size; i++) {
6970
for (int j = 1; j <= i; j++) {
70-
globalSwap<<<block_size, num_blocks>>>(i, j, arr);
71+
globalSwap<<<num_blocks, block_size>>>(i, j, arr);
7172
}
7273
}
7374
}

0 commit comments

Comments
 (0)