kernel_code
stringlengths
49
1.22M
kernel void global_read_write_race(global int* data) { int i = get_global_id(0); if (i > 0) { data[i] = data[i - 1]; } }
kernel void kern(global int* a, global int* b, global int* result) { result[0] = a[0] / b[0]; }
kernel void kernel_fmax_withoutDD8(global float* result_fmax, int N) { float8 t1 = -1 + (float8)(0); float8 t2 = -1 + (float8)(0); float8 t3 = t1; float8 t4 = t3; float8 t5 = t4; float8 t6 = t5; float8 t7 = t6; float8 t8 = t7; float8 t9 = t8; float8 t10 = t9; float8 t11 = -1 + (float8)(0); float...
kernel void vecAdd(global float* const restrict out, global const float* const restrict in1, global const float* const restrict in2) { const size_t id = get_global_id(0); out[id] = in1[id] + in2[id]; }
float d_dx(global float* z) { const size_t current = get_global_id(0); const size_t row = (size_t)current / ((16) * (512 / 16)); const size_t column = current % ((16) * (512 / 16)); const size_t right = row * ((16) * (512 / 16)) + column; const size_t left = row * ((16) * (512 / 16)) + column - 1; const fl...
kernel void test_unsigned_int(unsigned int u, uint4 u2, global unsigned int* out) { *out = u; vstore4(u2, 4, out); }
void F0(private uchar* x, private uchar* F0_OUT) { F0_OUT[0] = (((x[0]) << (1)) | ((x[0]) >> (8 - 1))) ^ (((x[0]) << (2)) | ((x[0]) >> (8 - 2))) ^ (((x[0]) << (7)) | ((x[0]) >> (8 - 7))); } void F1(private uchar* x, private uchar* F1_OUT) { F1_OUT[0] = (((x[0]) << (3)) | ((x[0]) >> (8 - 3))) ^ (((x[0]) << (4)) | (...
inline int get_index(int nelems, int index) { if (index == -1) { index = get_global_id(0); } else { index += get_global_size(0); } if (index >= nelems) index = -1; return index; } kernel void minus_scalar(global float* out, global const float* x, float w, int N) { int id = get_index(N, -1); ...
kernel void kernel8VFloat(const float8 input, global float8* output) { int i = get_global_id(0); if (i < 10) output[i] = convert_float8(input); }
kernel void rotate_longlong(global long* src_0, global long* src_1, global long* dst) { int gid = get_global_id(0); dst[gid] = rotate(src_0[gid], src_1[gid]); }
kernel void vecsum_vecvecadd(global const float4* input_, global float* output_, local float4* scratch_, const int length_) { int local_index = get_local_id(0); int global_index = get_global_id(0); int local_size = get_local_size(0); int global_size = get_global_size(0); int length4 = length_ / 4; float4 ...
kernel void subtract_int16int16(global int16* src_0, global int16* src_1, global int16* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] - src_1[gid]; }
kernel void testShiftCL(global unsigned int* memory, unsigned int size) { memory[get_global_id(0)] <<= size; }
kernel void test_arg_3_3_kern(global int* a0, global int* a1, global int* a2, global int* b0, global int* b1, global int* b2) { unsigned int gtid = get_global_id(0); int tmp0 = a0[gtid] + 0; int tmp1 = a1[gtid] + 1; int tmp2 = a2[gtid] + 2; b0[gtid] = (0 + 1) * (+tmp0 + tmp1 + tmp2); b1[gtid] = (1 + 1) * (+...
kernel void ZeroPad(global float* paddedInputBatch, global float* inputBatch, global int* paddingLookupTable, const int unpaddedVolume, const int paddedVolume, const int miniBatchSize) { const int iUnpadded = get_global_id(0); if (iUnpadded < unpaddedVolume * miniBatchSize) { int iExample = iUnpadded / unpadde...
kernel void warp_axis_m0_d(global double* arr, unsigned int Nx) { unsigned int i_cell = (unsigned int)get_global_id(0); if (i_cell < Nx) { arr[i_cell] = arr[i_cell + Nx]; } }
kernel void relational_greater_than_or_equal_to_ulongulong(global ulong* src_0, global ulong* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = (int)(src_0[gid] >= src_1[gid]); }
kernel void multiply_intint(global int* src_0, global int* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] * src_1[gid]; }
typedef int int4 __attribute((ext_vector_type(4))); typedef long long4 __attribute((ext_vector_type(4))); typedef float float4 __attribute((ext_vector_type(4))); typedef double double4 __attribute((ext_vector_type(4))); kernel void floatops(global int4* out, global float4* fout) { out[0] = (float4)(1, 1, 1, 1) && 1.0...
kernel void Film_MergeRADIANCE_PER_PIXEL_NORMALIZED(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, global float* mergeBuffer, const float scaleR, const float scaleG, const float scaleB) { const size_t gid = get_global_id(0); if (gid > filmWidth * filmHeight) re...
kernel void pre_increment_uchar8(global uchar8* src_0, global uchar8* dst) { int gid = get_global_id(0); dst[gid] = ++src_0[gid]; }
inline unsigned int uintMin(unsigned int a, unsigned int b) { return (b < a) ? b : a; } kernel void floydWarshallPass(global unsigned int* pathDistanceBuffer, global unsigned int* pathBuffer, const unsigned int width, const unsigned int pass) { unsigned int x = get_local_id(0); unsigned int y = get_group_id(0); ...
kernel void test_clamp(global int3* out, global int3* in) { *out = clamp(*in, (int3)7, (int3)42); }
float boundRange(float x, float lowerLimit, float upperLimit) { return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x)); } float Logistic_fn(float x) { if (x < 88.722839f) { if (x > -88.722839f) return (float)1.0 / ((float)1.0 + exp(-x)); else return 0; } return 1; } floa...
kernel void compiler_bitcast_int2_to_long(global int2* src, global ulong* dst) { int tid = get_global_id(0); int2 v = src[tid]; ulong dl = __builtin_astype((v), ulong); dst[tid] = dl; }
kernel void undulator_nf(const float R0, const float Kx, const float Ky, const float phase, const int jend, global float* gamma, global float* wu, global float* w, global float* ddphi, global float* ddpsi, global float* tg, global float* ag, global float2* Is_gl, global float2* Ip_gl) { const float E2W = 1.5192675147...
void subBytes(private uint4* state, int offset); void mixColumns(private uint4* state); void shiftRows(private uint4* state); void round_(private uint4* state, int offset, int id, const constant uint4* key, int key_offset); kernel void bitslice_kernel(global uint4* state, local uint4* cache) { const uint4 c1 = (uint4...
kernel void matvec_mul1_float(global const float* A, int offA, unsigned int A_col_size, unsigned int row_offset, unsigned int trail_item, global const float* v, int offv, float alpha, float beta, global float* result, int offr, local float* work) { unsigned int row_gid = get_group_id(0); unsigned int lid = get_loca...
kernel void compiler_workgroup_scan_inclusive_max_long(global long* src, global long* dst) { long val = src[get_global_id(0)]; long sum = work_group_scan_inclusive_max(val); dst[get_global_id(0)] = sum; }
kernel void kernel_21(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float A = 0; for (int i = 0; i < count; i++) { A += (inputA[i] - inputB[i]) * (inputA[i] - inputB[i]) * (inputA[i] + inputB[i]) / (inputA[i] * inputB[i]); } output[21] = 2 * A; }
kernel void meanAndStandardDeviation(int count, global float* input, global float* results) { double sum, mean; sum = mean = 0.0; int i; for (i = 0; i < count; i++) { sum += input[i]; } results[0] = mean = sum / count; sum = 0.0; for (i = 0; i < count; i++) { sum += (input[i] - mean) * (input[i]...
kernel void clz_int8(global int8* src_0, global int8* dst) { int gid = get_global_id(0); dst[gid] = clz(src_0[gid]); }
kernel void post_decrement_char2(global char2* src_0, global char2* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid]--; }
kernel void compare(global const float* m1, global const float* m2, global int* result, float errorAllowed) { int id = get_global_id(0); float error = m1[id] - m2[id]; if (error > errorAllowed || error < -errorAllowed) atomic_inc(result); }
kernel void add_scalar(global unsigned int const* const src, private unsigned int const addend, global unsigned int* const res) { unsigned int const idx = get_global_id(0); res[idx] = src[idx] + addend; }
kernel void ParallelSelection_half_improved(global short2* in, global short* out) { int i = get_global_id(0); int n = get_global_size(0); global short* in_short = (global short*)in; int ith = in_short[i]; int pos = 0, j = 0; do { short2 tmp = in[j >> 1]; int jth = tmp.x; bool smaller = (jth < it...
typedef enum { LOGISTIC, RELU, RELIE, LINEAR, RAMP, TANH, PLSE, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN } ACTIVATION; kernel void flattenarray(int N, global float* x, int spatial, int layers, int batch, global float* out) { int stepSize = get_local_size(0); int idx = get_global_id(0) * stepSize; int count = 0, ...
kernel void test_clamp(global ushort3* out, global ushort3* in) { *out = clamp(*in, (ushort3)7, (ushort3)42); }
kernel void ratx_kernel(global const float* T, global const float* C, global float* RF, global float* RB, global const float* RKLOW, const float TCONV) { const float TEMP = T[get_global_id(0)] * TCONV; const float ALOGT = log((TEMP)); float CTOT = 0.0; float PR, PCOR, PRLOG, FCENT, FCLOG, XN; float CPRLOG, FL...
kernel void kern(global float* a, global float* b, global float* c, global float* result) { result[0] = maxmag(a[0], b[0]); result[1] = minmag(a[1], b[1]); result[2] = nextafter(a[2], b[2]); result[3] = pow(a[3], b[3]); result[4] = half_recip(a[4]); result[5] = native_recip(a[5]); result[6] = remainder(a[...
kernel void test_signed_int(int i, int4 i2, global int* out) { *out = i; vstore4(i2, 4, out); }
void transHSVtoRGB(float* dst, const float h, const float s, const float v) { if (0.f == s) { dst[0] = dst[1] = dst[2] = v; return; } int Hi = (int)floor(h / 60.f) % 6; float f = h / 60.f - (float)Hi; float p = v * (1.f - s); float q = v * (1.f - s * f); float t = v * (1.f - (1.f - f) * s); if...
kernel void foo(global float3* in, global float3* out) { *out = min(in[0], in[1]); }
kernel void minCl(global const int* a, global int* minData) { size_t i = get_global_id(0); atomic_min(minData, a[i]); }
kernel void reduce(global const double* const in, local double* const tmp, global double* const maximas, const unsigned int n) { const size_t gid = get_global_id(0), lid = get_local_id(0), wgs = get_local_size(0), wgid = get_group_id(0); const unsigned int stride = wgid * wgs; tmp[lid] = stride + gid < n ? fabs(...
kernel void kernel_fabs_withDD1(global float* result_fabs, int N) { float p1 = 0.0; int i = 0; for (i = 0; i < N; i++) { p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fabs(p1); p1 += fab...
kernel void sphere(global float4* vertices, float tick) { int longitude = get_global_id(0) / 16; int latitude = get_global_id(0) % 16; float sign = -2.0f * (longitude % 2) + 1.0f; float phi = 2.0f * 3.14159265358979323846264338327950288f * longitude / 16 + tick; float theta = 3.141592653589793238462643383279...
kernel void test_rotate(global uchar3* out, uchar3 a, uchar3 b) { *out = rotate(a, b); }
kernel void array_max_f32(global float* a, global float* b, float const threshold) { unsigned int i = get_global_id(0); b[i] = max(threshold, a[i]); }
kernel void shortenFFT(global const float* fft, global float* shortFft, int shortLen) { int i = get_global_id(0); float f = fft[i]; if (i < shortLen) { if (i == 1) { shortFft[shortLen / 2] = fft[shortLen]; } else if (i % 2 == 0) { shortFft[i / 2] = f; } else { shortFft[shortLen - (i ...
kernel void asbs_s_cpu_gpu(global float* s1, float fac2, unsigned int options2, global const float* s2, global const float* fac3, unsigned int options3, global const float* s3) { float alpha = fac2; if (options2 & (1 << 0)) alpha = -alpha; if (options2 & (1 << 1)) alpha = ((float)(1)) / alpha; float be...
kernel void kernel_tanpi_withDD1(global float* result_tanpi, int N) { float t1 = 4.3; int i = 0; for (i = 0; i < N; i++) { t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = tanpi(t1); t1 = ta...
kernel void compiler_event(global int* dst, int value) { int id = (int)get_global_id(0); dst[id] += value; }
kernel void max_min_global_stage2(global const float2* data2, global float* maximum, global float* minimum) { local float2 ldata[256]; unsigned int lid = get_local_id(0); unsigned int group_size = min((unsigned int)get_local_size(0), (unsigned int)256); float2 acc = (float2)(-1.0f, -1.0f); if (lid <= group_si...
kernel void neatStuff(global int* target, global int* source) { int id = get_global_id(0); target[id] = source[id] + id; }
kernel void swap(global float* spam, global float* eggs) { unsigned int i = get_global_id(0); float swap = spam[i]; spam[i] = eggs[i]; eggs[i] = swap; }
kernel void mul(global double* a, global double* b, global double* c, global double* d, unsigned long col, unsigned char com, unsigned long offsetar, unsigned long offsetac) { unsigned long i = get_global_id(0); double aa, bb, cc, dd; unsigned long ee; if (com) { for (unsigned long j = 0; j < col; j++) { ...
kernel void kernel_multi_withDD1(float p1, global float* result_multi, int N) { float t2 = 1.0; float t1 = p1; int i = 0; for (i = 0; i < N; i++) { t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= t1; t2 *= ...
kernel void opticalDense(global float* buff) { int gid = get_global_id(0); buff[gid] = -log1p(buff[gid]); }
kernel void matmul(global float* restrict A, global float* restrict B, global float* restrict C, unsigned int n) { for (size_t i = 0; i < n; i++) for (size_t j = 0; j < n; j++) { float dot = 0; for (size_t k = 0; k < n; k++) dot += A[i * n + k] * B[k * n + j]; C[i * n + j] = dot; } }
kernel void post_increment_char8(global char8* src_0, global char8* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid]++; }
kernel void test_arg_5_4_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* b0, global int* b1, global int* b2, global int* b3) { unsigned int gtid = get_global_id(0); int tmp0 = a0[gtid] + 0; int tmp1 = a1[gtid] + 1; int tmp2 = a2[gtid] + 2; int tmp3 = a3[gtid] +...
unsigned __popc(unsigned int x) { if (x == 0) return 0; if ((x &= x - 1) == 0) return 1; if ((x &= x - 1) == 0) return 2; if ((x &= x - 1) == 0) return 3; if ((x &= x - 1) == 0) return 4; if ((x &= x - 1) == 0) return 5; if ((x &= x - 1) == 0) return 6; if ((x &= x - 1) == 0)...
kernel void compiler_convert_uchar_sat(global float* src, global unsigned int* dst) { int i = get_global_id(0); dst[i] = convert_uchar_sat(src[i]); }
kernel void Decrypt(global char* DecStrng, global char* EncStrng, int Key) { unsigned int xid = get_global_id(0); EncStrng[xid] = DecStrng[xid] ^ Key; }
kernel void fill(global int* a, const int size, const int value) { int index = get_global_id(0); if (index >= size) { return; } a[index] = 42; }
kernel void test_step_type(global char* source, global int* dest) { int tid = get_global_id(0); dest[tid] = vec_step(char); }
struct tree_global { volatile int nextNode; volatile int activeNodes; int depth; int pad; }; kernel void applyCoulombsLawBarnesHut(global float4* pointPosition, global float4* pointAcceleration, global float* pointMass, const float repulsion, global unsigned int* nodeState, global int* nodeEntries, global floa...
float boundRange(float x, float lowerLimit, float upperLimit) { return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x)); } float Logistic_fn(float x) { if (x < 88.722839f) { if (x > -88.722839f) return (float)1.0 / ((float)1.0 + exp(-x)); else return 0; } return 1; } floa...
kernel void test(int A, int B, global int* dst) { *dst = A >= B; }
kernel void compiler_bswap(global unsigned int* src0, global unsigned int* dst0, global ushort* src1, global ushort* dst1, int src2, global int* dst2, short src3, global short* dst3, global ulong* src4, global ulong* dst4, long src5, global long* dst5) { if (get_global_id(0) % 2 == 0) { dst0[get_global_id(0)] = _...
kernel void aligned_sequential(global float* buffer, global float* dummyBuffer) { *dummyBuffer = buffer[get_local_id(0)]; }
kernel void advance_ptcls_cycl(global float* xGlob, global float* yGlob, global float* zGlob, global float* vxGlob, global float* vyGlob, global float* vzGlob, const global float* charge, const global float* mass, float Bz, float dt, int nPtcls) { private int n = get_global_id(0); if (n < nPtcls) { private ...
float boundRange(float x, float lowerLimit, float upperLimit) { return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x)); } float Logistic_fn(float x) { if (x < 88.722839f) { if (x > -88.722839f) return (float)1.0 / ((float)1.0 + exp(-x)); else return 0; } return 1; } floa...
kernel void remainder_uintuint(global unsigned int* src_0, global unsigned int* src_1, global unsigned int* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] % src_1[gid]; }
kernel void sub_from_all(global float* data, const float value, const unsigned int len) { const int global_index = get_global_id(0); if (global_index < len) { data[global_index] = data[global_index] - value; } }
float linear_to_gamma_2_2(float value); float gamma_2_2_to_linear(float value); float linear_to_gamma_2_2(float value) { if (value > 0.003130804954f) return 1.055f * native_powr(value, (1.0f / 2.4f)) - 0.055f; return 12.92f * value; } float gamma_2_2_to_linear(float value) { if (value > 0.04045f) return ...
kernel void brahmaKernel(global int* buf) { buf[0] = (2 * 2); buf[1] = (4 * 4); }
kernel void compiler_double_4(global double* src1, global double* src2, global double* dst) { int i = get_global_id(0); dst[i] = src1[i] + src2[i]; }
kernel void ItermPrefixSum(global float2* sum_out, unsigned int loop_limit, unsigned int total_limit) { unsigned int id = get_global_id(0); unsigned int glbl_sz = get_global_size(0); unsigned int groupID = get_group_id(0); unsigned int lcl_id = get_local_id(0); local float2 sum_buffer[256]; float2 my_sum ...
kernel void equal_uint2uint2(global uint2* src_0, global uint2* src_1, global int2* dst) { int gid = get_global_id(0); dst[gid] = (int2)(src_0[gid] == src_1[gid]); }
kernel void test_float(global float* output, int N) { int i = get_global_id(0); output[i] = 1.f * i; }
kernel void integral_sum_rows_D5(global float4* srcsum, global float* sum, int rows, int cols, int src_step, int sum_step, int sum_offset) { int lid = get_local_id(0); int gid = get_group_id(0); float4 src_t[2], sum_t[2]; local float4 lm_sum[2][256 + 8]; local float* sum_p; src_step = src_step >> 4; for (...
kernel void findBlockBounds(int numAtoms, float4 periodicBoxSize, float4 invPeriodicBoxSize, float4 periodicBoxVecX, float4 periodicBoxVecY, float4 periodicBoxVecZ, global const float4* restrict posq, global float4* restrict blockCenter, global float4* restrict blockBoundingBox, global int* restrict rebuildNeighborList...
kernel void rotate_int16int16(global int16* src_0, global int16* src_1, global int16* dst) { int gid = get_global_id(0); dst[gid] = rotate(src_0[gid], src_1[gid]); }
kernel void SAXPY(global float* x, global float* y, float a) { const int i = get_global_id(0); y[i] += a * x[i]; }
kernel void talley_count(global unsigned int* talley, global int* talleyCount, global unsigned int* queueSorted, int segmentSize) { int queryIdx = get_global_id(0); int Q = queryIdx * segmentSize; int ok; int count = 1; unsigned int obj = queueSorted[Q]; int idx = 0; for (int i = 1; i < segmentSize; i+...
kernel void test_arg_1_2_kern(global float4* a0, global float4* b0, global float4* b1) { float4 za = (float4)(0.75f, 0.5f, 0.25f, 0.33f); unsigned int gtid = get_global_id(0); float4 tmp0 = a0[gtid] + 0.1f + za; b0[gtid] = (0.0f + 1.1f) * (+tmp0); b1[gtid] = (1.0f + 1.1f) * (+tmp0); }
kernel void test_arg_6_2_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* a4, global int4* a5, global int4* b0, global int4* b1) { int4 za = (int4)(0, 1, 2, 3); unsigned int gtid = get_global_id(0); int4 tmp0 = a0[gtid] + 0 + za; int4 tmp1 = a1[gtid] + 1 + za; int4 tmp2 = ...
; kernel void test_get_local_size(global int* dst) { int tid = get_global_id(0); int n = get_local_size(0); dst[tid] = n; }
kernel void ComputeBound(global float* data, unsigned int iter) { float frac; float sign = 1.0f; float odd = 1.0f; float sum = 0.0f; float res = 0.0f; while (iter--) { frac = sign / odd; sum += frac; res = 4.0f * sum; sign *= -1.0f; odd += 2.0f; } data[get_global_id(0)] = res; }
kernel void multiply(global float* a, global float* b, global float* result) { int id = get_global_id(0); result[id] = a[id] * b[id]; }
float linear_to_gamma_2_2(float value) { if (value > 0.003130804954f) return 1.055f * native_powr(value, (1.0f / 2.4f)) - 0.055f; return 12.92f * value; } float gamma_2_2_to_linear(float value) { if (value > 0.04045f) return native_powr((value + 0.055f) / 1.055f, 2.4f); return value / 12.92f; } kernel...
kernel void reduction_complete(global float4* data, local float4* partial_sums, global float* sum) { int lid = get_local_id(0); int group_size = get_local_size(0); partial_sums[lid] = data[get_local_id(0)]; barrier(0x01); for (int i = group_size / 2; i > 0; i >>= 1) { if (lid < i) { partial_sums[l...
kernel void test_stream_write_uint(global unsigned int* src, global unsigned int* dst) { int tid = get_global_id(0); dst[tid] = src[tid]; }
kernel void post_decrement_int2(global int2* src_0, global int2* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid]--; }
inline void upsweep_pow2(local int* x, int m) { int lid = get_local_id(0); int bi = (lid * 2) + 1; int depth = 1 + (int)log2((float)m); for (int d = 0; d < depth; d++) { barrier(0x01); int mask = (0x1 << d) - 1; if ((lid & mask) == mask) { int offset = (0x1 << d); int ai = bi - offset; ...
kernel void gegl_color_temperature(global const float4* in, global float4* out, float coeff1, float coeff2, float coeff3) { int gid = get_global_id(0); float4 in_v = in[gid]; float4 out_v; out_v = in_v * (float4)(coeff1, coeff2, coeff3, 1.0f); out[gid] = out_v; }
kernel void Pooling_with_index(global float* out_data, global float* out_index, global const float* in_data, const int in_n_stride, const int in_c_stride, const int in_h_stride, const int in_w_stride, const int in_h, const int in_w, const int out_n_stride, const int out_c_stride, const int out_h_stride, const int out_w...
kernel void bitselect_uchar16uchar16uchar16(global uchar16* src_0, global uchar16* src_1, global uchar16* src_2, global uchar16* dst) { int gid = get_global_id(0); dst[gid] = bitselect(src_0[gid], src_1[gid], src_2[gid]); }