matheus__serpa icon

Untitled

matheus__serpa | PRO | 02/07/21 09:04:15 PM UTC (Edited) | 0 ⭐ | 494 👁️ | Never ⏰ | []
Python |

200 B

|

None

|

0 👍

/

0 👎

@cuda.jit
def incrementa(vetor, valor):
    tx = cuda.threadIdx.x
    ty = cuda.blockIdx.x
    bw = cuda.blockDim.x
    pos = tx + ty * bw
 
    if pos < vetor.size:
        vetor[pos] += valor

Comments