matheus__serpa

Untitled

Feb 6th, 2021 (edited)
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. @cuda.jit
  2. def incrementa(vetor, valor):
  3.     tx = cuda.threadIdx.x
  4.     ty = cuda.blockIdx.x
  5.     bw = cuda.blockDim.x
  6.     pos = tx + ty * bw
  7.  
  8.     if pos < vetor.size:
  9.         vetor[pos] += valor
Advertisement
Add Comment
Please, Sign In to add comment