Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __global__ void addVectors(float* vec1, float* vec2, float* result) {
- int index = threadIdx.x;
- result[index] = vec1[index] + vec2[index];
- }
- int main() {
- ...
- addVectors<<<1, N>>>(vec1, vec2, result);
- ...
- }
Add Comment
Please, Sign In to add comment