Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions challenges/easy/24_rainbow_table/starter/starter.cute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
import cutlass.cute as cute


def fnv1a_hash_u32_scalar(x):
FNV_PRIME = 16777619
OFFSET_BASIS = 2166136261
val = cute.Uint32(x)
hash_val = cute.Uint32(OFFSET_BASIS)
prime = cute.Uint32(FNV_PRIME)
mask = cute.Uint32(0xFF)
for byte_pos in range(4):
byte = (val >> (byte_pos * 8)) & mask
hash_val = (hash_val ^ byte) * prime
return cute.Uint32(hash_val)


# input, output are tensors on the GPU
@cute.jit
def solve(input: cute.Tensor, output: cute.Tensor, N: cute.Int32, R: cute.Int32):
Expand Down
Loading