Skip to content

Instantly share code, notes, and snippets.

@hyunsik
Last active August 29, 2016 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyunsik/ec5162cc9c78c63d9befcd1e7762a5bb to your computer and use it in GitHub Desktop.
Save hyunsik/ec5162cc9c78c63d9befcd1e7762a5bb to your computer and use it in GitHub Desktop.
Add primitive in vectorized processing model
map_add_long_int_col_col(int vec_num, long [] result, long [] col1,
int [] col2, int [] sel_vec) {
if (sel_vec == null) {
for (int i = 0; i = 0; i < vec_num; i++) {
result[i] = col1[i] + col2[i];
}
} else {
int sel_idx;
for (int i = 0; I = 0; i < vec_num; i++) {
sel_idx = sel_vec[i];
result[sel_idx] = col1[sel_idx] + col2[sel_idx];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment