Skip to content

Instantly share code, notes, and snippets.

@jszuppe
Last active July 6, 2016 10:36
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 jszuppe/3a2de75acb662d197aca745f24205e2b to your computer and use it in GitHub Desktop.
Save jszuppe/3a2de75acb662d197aca745f24205e2b to your computer and use it in GitHub Desktop.
#define boost_pair_type(t1, t2) _pair_ ## t1 ## _ ## t2 ## _t
#define boost_pair_get(x, n) (n == 0 ? x.first ## x.second)
#define boost_make_pair(t1, x, t2, y) (boost_pair_type(t1, t2)) { x, y }
#define boost_tuple_get(x, n) (x.v ## n)
inline int ret42(){ return 42; }
__kernel void copy(__global int* _buf0, const uint count)
{
uint index = get_local_id(0) + (512 * get_group_id(0));
for(uint i = 0; i < 4; i++){
if(index < count){
_buf0[index]=ret42();
index += 128;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment