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
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