What is Nostr?
uvok /
npub1k90…ag6a
2024-09-29 14:37:04

uvok on Nostr: I am doing https://github.com/srush/GPU-Puzzles/ My solution for puzzle 9 "Pooling" ...

I am doing https://github.com/srush/GPU-Puzzles/

My solution for puzzle 9 "Pooling" is

def pool_test(cuda):
def call(out, a, size) -> None:
shared = cuda.shared.array(TPB, numba.float32)
i = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
local_i = cuda.threadIdx.x

mysum = 0
for j in range(max(0,i-2), i+1):
mysum += a[j]
out[i] = mysum

return call


But I doubt that this is the solution, as I don't utilize the shared memory...

#programming #python #numba
Author Public Key
npub1k90996tz8kj3eljxqqsw0k385zrdu7z8xxh82hsth98f78q38jeqdsag6a