minor update

This commit is contained in:
Blaise Tine
2021-06-28 11:20:07 -04:00
parent 86aabbbf5d
commit 3a0a9edaca
5 changed files with 2009 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
__kernel void psort (__global const float *in, __global float *out)
{
int gid = get_global_id(0);
int n = get_global_size(0);
float ref = in[gid];
int pos = 0;
for (int i = 0; i < n; ++i) {
float cur = in[i];
pos += (cur < ref) || (cur == ref && i < gid);
}
out[pos] = ref;
}