Skip to content

Commit

Permalink
Fix kernel bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruestle committed Mar 20, 2023
1 parent b4a4cb3 commit afd9a56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions risc0/sys/kernels/zkp/cuda/poseidon.cu
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ extern "C" __global__ void poseidon_fold(const Fp* ROUND_CONSTANTS,
const Fp* input,
uint32_t output_size) {
uint32_t gid = blockDim.x * blockIdx.x + threadIdx.x;
if (gid >= output_size) { return; }
Fp cells[CELLS];
for (size_t i = 0; i < CELLS_OUT; i++) {
cells[i] = input[2 * gid * CELLS_OUT + i];
Expand All @@ -134,6 +135,7 @@ extern "C" __global__ void poseidon_rows(const Fp* ROUND_CONSTANTS,
uint32_t count,
uint32_t col_size) {
uint32_t gid = blockDim.x * blockIdx.x + threadIdx.x;
if (gid >= count) { return; }
Fp cells[CELLS];
uint used = 0;
for (uint i = 0; i < col_size; i++) {
Expand Down

0 comments on commit afd9a56

Please sign in to comment.