Last active
August 29, 2015 13:57
-
-
Save fltermare/9449819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct node { | |
int value; | |
node* next; | |
}; | |
__kernel void vector_add(__global node **a, __global node **b, __global node **c) { | |
// Get the index of the current element | |
int i = get_global_id(0); | |
// Do the operation | |
for(int j = 0; j < 3; ++j) { | |
c[i]->value = a[i]->value + b[i]->value; | |
//a[i]->value | |
//*(a + sizeof(struct)*1) -> value; | |
c[i] = c[i]->next; | |
a[i] = a[i]->next; | |
b[i] = b[i]->next; | |
} | |
} | |
__kernel int lookup() { | |
addr = table [....] | |
} | |
__kernel void foo(__global node *A, __global int idx, table) { | |
idx = idx + get_global_id(0); | |
while (lookup(A[idx]->next, table)) { | |
A[idx]->value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment