Skip to content

Commit

Permalink
compile on school machine
Browse files Browse the repository at this point in the history
  • Loading branch information
souhhcong committed May 19, 2024
1 parent 86e141d commit a316ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NVCC = /usr/local/cuda/bin/nvcc

raytracer:
$(NVCC) raytracer.cu -o raytracer -O3 -arch=sm_60 -std=c++11 -I/usr/local/cuda/include
$(NVCC) raytracer.cu -o raytracer -O3 -arch=sm_86 -std=c++17 -I/usr/local/cuda/include

clean:
rm -f raytracer
4 changes: 2 additions & 2 deletions raytracer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

__global__ void hello_world_thread() {
size_t index = blockIdx.x * blockDim.x + threadIdx.x;
printf("Hello world %llu\n", size_t);
printf("Hello world %llu\n", index);
}

void hello_world_gpu() {
const size_t BLOCK_SIZE = 2;
size_t GRID_SIZE = 2;
hello_world_thread<<<BLOCKS_NUM, THREADS_PER_BLOCK>>>();
hello_world_thread<<<GRID_SIZE, BLOCK_SIZE>>>();
cudaDeviceSynchronize();
}

Expand Down

0 comments on commit a316ef8

Please sign in to comment.