kernel_code
stringlengths
49
1.22M
typedef float4 float4; kernel void compact(global float4* keypoints, global float4* output, global int* counter, int start_keypoint, int end_keypoint) { int gid0 = (int)get_global_id(0); if (gid0 < start_keypoint) { output[gid0] = keypoints[gid0]; } else if (gid0 < end_keypoint) { float4 k = keypoints[gid...
kernel void relational_greater_than_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]; }
kernel void compiler_overflow_uint4_add(global uint4* src0, global uint4* src1, global uint4* dst) { global uint4* A = &src0[get_global_id(0)]; global uint4* B = &src1[get_global_id(0)]; global uint4* C = &dst[get_global_id(0)]; *C = *A + *B; uint4 carry = -convert_uint4(*C < *B); (*C).y += carry.x; carry...
kernel void row_info_extractor(global const unsigned int* row_indices, global const unsigned int* column_indices, global const float* elements, global float* result, unsigned int size, unsigned int option) { for (unsigned int row = get_global_id(0); row < size; row += get_global_size(0)) { float value = 0; un...
kernel void test_template_empty1(global int const* const input, global int* const output) { const size_t tid = get_global_id(0); int tmp = input[tid]; __asm__(""); tmp = tmp << 2; __asm__(""); tmp += 1; __asm__(""); output[tid] = tmp; }
kernel void select_int3_uint3(global int* dest, global int* src1, global int* src2, global unsigned int* cmp) { size_t tid = get_global_id(0); size_t size = get_global_size(0); if (tid + 1 < size) vstore3(select(vload3(tid, src1), vload3(tid, src2), vload3(tid, cmp)), tid, dest); else if (tid + 1 == size) {...
constant int array[32] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; kernel void with_branch4(global int* out) { int lid = get_local_id(0); int gid = get_global_id(0); int id = lid % 32; int t1 = id; int t2 = 1; if (id == 0 || id ...
kernel void resid_squares(global float* outcome, global float* x, global float* beta, global float* resid2, unsigned int num_of_predictors) { unsigned int id = get_global_id(0); float predicted_outcome = 0; for (unsigned int i = 0; i < num_of_predictors; i++) { predicted_outcome += beta[i] * x[id * num_of_pre...
kernel void RecursiveGaussian_kernel(global const uchar4* input, global uchar4* output, const int width, const int height, const float a0, const float a1, const float a2, const float a3, const float b1, const float b2, const float coefp, const float coefn) { unsigned int x = get_global_id(0); if (x >= width) r...
kernel void test_int16(global int* pin, global int* pout) { int x = get_global_id(0); int16 value; value = vload16(x, pin); value += (int16){(int)1, (int)2, (int)3, (int)4, (int)5, (int)6, (int)7, (int)8, (int)9, (int)10, (int)11, (int)12, (int)13, (int)14, (int)15, (int)16}; vstore16(value, x, pout); }
kernel void hadd_charchar(global char* src_0, global char* src_1, global char* dst) { int gid = get_global_id(0); dst[gid] = hadd(src_0[gid], src_1[gid]); }
kernel void D(global int* x) { int i = 10; __attribute__((opencl_unroll_hint)) do { } while (i--) ; }
kernel void half_powr_float2float2(global float2* src_0, global float2* src_1, global float2* dst) { int gid = get_global_id(0); dst[gid] = half_powr(src_0[gid], src_1[gid]); }
kernel void test_arg_3_4_kern(global int* a0, global int* a1, global int* a2, 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; b0[gtid] = (0 + 1) * (+tmp0 + tmp1 + tmp2); b1[gtid...
kernel void updateAlpha(global float* oldRDotR, global float* apDotp, global float* alpha) { *alpha = (*oldRDotR) / (*apDotp); }
kernel void reset_uchar_kernel(global uchar* d_out) { d_out[get_global_id(0)] = 0; }
kernel void vandermonde_prod(global float* vander, global float* vector, global float* result, unsigned int size) { for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) { float mul = vander[i]; float pwr = 1; float val = 0; for (unsigned int j = 0; j < size; j++) { val = v...
struct CvRect { int x; int y; int width; int height; }; struct float4 { float x; float y; float s; float xp; float yp; float sp; float x0; float y0; int width; int height; float w; }; inline void AtomicAddG(volatile global float* source, const float operand) { union { unsigned int i...
kernel void test_unsigned_short(ushort u, ushort4 u2, global ushort* out) { *out = u; vstore4(u2, 4, out); }
kernel void mad_hi_uchar4uchar4uchar4(global uchar4* src_0, global uchar4* src_1, global uchar4* src_2, global uchar4* dst) { int gid = get_global_id(0); dst[gid] = mad_hi(src_0[gid], src_1[gid], src_2[gid]); }
kernel void cl_posterize(global const float4* in, global float4* out, float levels) { int gid = get_global_id(0); float4 in_v = in[gid]; in_v.xyz = trunc(in_v.xyz * levels + (float3)(0.5f)) / levels; out[gid] = in_v; }
kernel void dfun(global float* state, global float* coupling, global float* param, global float* deriv) { int i = get_global_id(0), n = get_global_size(0); int n_param = 12; float v1 = state[0 * n + i], y1 = state[1 * n + i], v2 = state[2 * n + i], y2 = state[3 * n + i], v3 = state[4 * n + i], y3 = state[5 * n +...
kernel void identity_deriv_assign(global float* vec1, uint4 size1, global float* float2, uint4 size2) { for (unsigned int i = get_global_id(0); i < size1.z; i += get_global_size(0)) { vec1[i * size1.y + size1.x] = 1; } }
kernel void postinc(global uchar* out, uchar in) { out[0] = in++; }
kernel void prefixSum_kernel(global float* inArray, global float* outArray, global int* arrayLength) { unsigned int gid = get_global_id(0); float prefixSum = 0.0; int count; for (int count = 0; count < gid; count++) { int value = gid; prefixSum += inArray[count]; } outArray[gid] = prefixSum; }
kernel void CreateMaxPoolingTable(global int* poolingTable, const int stride, const int inputWidth, const int outputWidth) { const int i = get_global_id(0); const int outputArea = outputWidth * outputWidth; if (i < outputArea) { int iOutputRow = i / outputWidth; int iOutputCol = i % outputWidth; in...
int get_indexed_value(global int* array, int index); void set_indexed_value(global int* array, int index, int value); int get_indexed_value(global int* array, int index) { const int triple[3] = {0, 1, 2}; const int sum1 = array[index] + array[0] + triple[index]; const int sum2 = triple[0] + triple[1] + triple[2...
kernel void cfc(global const int* in, global int* out, int limit) { size_t x = get_global_id(0); int temp[32]; for (int i = 0; i < 32; ++i) { temp[i] = in[i]; } if (x < limit) { out[x] = x; } else { out[x] = temp[x % 32]; } }
kernel void lte(global int* out, unsigned int a, unsigned int b) { out[0] = a <= b; }
kernel void mic(global float* a, global float* b) { const size_t ix = get_global_id(0); a[ix] = a[ix] + b[ix]; }
unsigned int float_vector1_index_norm_inf_impl(global const float* vec, unsigned int size, local float* float_buffer, local unsigned int* index_buffer) { float cur_max = 0.0f; float tmp; for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) { tmp = fabs(vec[i]); if (cur_max < tmp) { ...
kernel void kernel_add_withDD4(global float* result_add, int N) { float t1 = 1.0f; float4 t2 = t1 + (float4)(0, 0.1, 0.2, 0.3); int i = 0; for (i = 0; i < N; i++) { t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; t2 += 10.f; ...
inline unsigned int get_bitcount(unsigned int b) { b = (b & 0x55) + (b >> 1 & 0x55); b = (b & 0x33) + (b >> 2 & 0x33); b = (b + (b >> 4)) & 0x0f; return b; } inline unsigned int fetchChildOffset(global unsigned int* octree, unsigned int const a_node, unsigned int const a_node_before, unsigned int* local_root, ...
kernel void compiler_overflow_uint4_sub(global uint4* src0, global uint4* src1, global uint4* dst) { global uint4* A = &src0[get_global_id(0)]; global uint4* B = &src1[get_global_id(0)]; global uint4* C = &dst[get_global_id(0)]; uint4 borrow; unsigned result; size_t num = sizeof(*A) / sizeof((*A)[0]); for...
float sstep(float a, float x) { if (x >= a) { return 1; } return 0; } float pulse(float a, float b, float x) { return sstep(a, x) - sstep(b, x); } int windowTile(float x, float y) { float xp = pulse(0.28 / 2, 1 - 0.28 / 2, x); float yp = pulse(0.12 / 2, 1 - 0.12 / 2, y); if (xp == 1 && yp == 0) { ...
kernel void kernel_movinv32_readwrite(global char* ptr, unsigned long memsize, unsigned int pattern, unsigned int lb, unsigned int sval, unsigned int offset, volatile global unsigned int* err_count, global unsigned long* err_addr, global unsigned long* err_expect, global unsigned long* err_current, global unsigned long...
inline float activation(float in) { float output = in; return output; } inline float4 activation_type4(float4 in ) { float4 output = in; return output; } kernel void depthwise_conv2d(const int numel, global float* input_data, const int height, const int width, const int conved_channel, const int conved_heigh...
kernel void abs_uint8(global uint8* src_0, global uint8* dst) { int gid = get_global_id(0); dst[gid] = abs(src_0[gid]); }
kernel void filter(float input, int currentPos, int filterOrder, global float* table, global float* workBuffer, global float* output) { int idx = get_global_id(0); int flt = idx / filterOrder; int pos = idx % filterOrder; int index = (pos + currentPos) % filterOrder; float value = table[flt * filterOrder + po...
kernel void test_fa1_1_5_kern(global float* a0, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4) { unsigned int gtid = get_global_id(0); float tmp0 = a0[gtid] + 0.1f; b0[gtid] = (0.0f + 1.1f) * (+tmp0); b1[gtid] = (1.0f + 1.1f) * (+tmp0); b2[gtid] = (2.0f + 1.1f) * (+t...
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 half_rsqrt_float4(global float4* src_0, global float4* dst) { int gid = get_global_id(0); dst[gid] = half_rsqrt(src_0[gid]); }
inline int x_if_odd_else_y(int x, int y) { if (x & 1) return x; else return y; } kernel void bind_custom_function2(global int* _buf0, const unsigned int count) { unsigned int index = get_local_id(0) + (32 * get_group_id(0)); for (unsigned int i = 0; i < 4; i++) { if (index < count) { _buf0[in...
struct Bucket { unsigned int key; unsigned int val; }; typedef struct Bucket Bucket; kernel void init(global unsigned int* out, const ulong out_count, const unsigned int empty) { for (unsigned int i = 0; i < out_count; ++i) { out[i] = empty; } }
kernel void compiler_generic_pointer_int(global int* src, global int* dst) { size_t gid = get_global_id(0); size_t lid = get_local_id(0); private int pdata[16]; local int ldata[16]; int* p1 = &pdata[lid]; int* p2 = &ldata[lid]; int* p = (gid & 1) ? p1 : p2; *p = src[gid]; if (gid & 1) { ldata[lid...
kernel void gr_base(global const float* P, global const float* T, global const float* Y, global float* C, const float TCONV, const float PCONV) { const float TEMP = T[get_global_id(0)] * TCONV; const float PRES = P[get_global_id(0)] * PCONV; const float SMALL = 0x1.0p-126f; float SUM, ctmp; SUM = 0.0; (...
kernel void helloWorld(global float* input, global float* output, const unsigned int count) { int id = get_global_id(0); if (id < count) { output[id] = input[id] * input[id]; } }
kernel void compiler_abs_diff_short3(global short3* x, global short3* y, global ushort3* diff) { int i = get_global_id(0); diff[i] = abs_diff(x[i], y[i]); }
kernel void kernel_sinh_withDD8(global float* result_sinh, int N) { float t1 = 0.0; float8 t2 = t1 + (float8)(0); int i = 0; for (i = 0; i < N; i++) { t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); t2 = sinh(t2); ; }...
kernel void compiler_unstructured_branch3(global int* src, global int* dst) { int id = (int)get_global_id(0); dst[id] = src[id]; if (dst[id] >= 2) goto label1; dst[id] = 1; if (src[id] < 2) goto label2; dst[id]--; label1: dst[id] -= 2; label2: dst[id] += 2; }
constant int array[32] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; kernel void with_branch32(global int* out) { int lid = get_local_id(0); int gid = get_global_id(0); int id = lid % 32; int t1 = id; int t2 = 1; if (id == 0) { ...
kernel void vectorAddition(global float* a, global float* b, global float* result) { int index = get_global_id(0); result[index] = a[index] + b[index]; }
kernel void CopyBufferToBufferLeftLeftover(const global uchar* pSrc, global uchar* pDst, unsigned int srcOffsetInBytes, unsigned int dstOffsetInBytes) { unsigned int gid = get_global_id(0); pDst[gid + dstOffsetInBytes] = pSrc[gid + srcOffsetInBytes]; }
kernel void test_mix(const global float* x, const global float* y, const global float* z, global float* out) { unsigned int gid = get_global_id(0); out[gid] = mix(x[gid], y[gid], z[gid]); }
kernel void matrix_add(global int* mat1_data, global int* mat2_data, global int* out_data) { int i = get_global_id(0); out_data[i] = mat1_data[i] + mat2_data[i]; }
kernel void unary_plus_char2(global char2* src_0, global char2* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void kernel_readwrite(global char* ptr, unsigned long memsize, unsigned long p1, unsigned long p2, volatile global unsigned int* err_count, global unsigned long* err_addr, global unsigned long* err_expect, global unsigned long* err_current, global unsigned long* err_second_read) { int i; global unsigned long...
kernel void integrateBodies(const int nBody, const float dt, global float* px, global float* py, global float* pz, global float* vx, global float* vy, global float* vz) { int i = get_global_id(0); if (i < nBody) { px[i] += dt * vx[i]; py[i] += dt * vy[i]; pz[i] += dt * vz[i]; } }
kernel void kernelUShort(ushort8 input, global ushort8* output) { output[0] = input; }
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 compiler_math(global float* dst, global float* src) { int i = get_global_id(0); const float x = src[i]; switch (i) { case 0: dst[i] = cos(x); break; case 1: dst[i] = sin(x); break; case 2: dst[i] = log2(x); break; case 3: dst[i] = sqrt(x); ...
kernel void foo(int k, global int* A, int b) { *A = k + b; }
kernel void spmv_ellpackr_kernel(global const float* restrict val, global const float* restrict vec, global const int* restrict cols, global const int* restrict rowLengths, const int dim, global float* restrict out, global unsigned long* bitmap, const int rowsetzf, global int* rowinfo, int start) { int t = get_global...
kernel void kernelFinalizeSum(global float* mean, int cols, int rows, int window_count) { int xIndex = get_global_id(0); if (xIndex >= cols) return; float sum = 0, sum2 = 0; float2 minmaxv = (float2)(0x1.fffffep127f, -0x1.fffffep127f); for (int i = 0; i < rows; i++) { sum += mean[cols * i + xIndex]; ...
kernel void set_winner(global bool* firstPlayerHasWon, global int* whoHasWon, global bool* illegalMove, int currentPlayer, char parasiteEnvironment) { if (get_global_id(0) == 0) { if (*illegalMove) { if (currentPlayer == -1) *firstPlayerHasWon = false; else *firstPlayerHasWon = true; ...
kernel void evaluatePyramid(global const float* parameter, global const float* samplingValues, global float* outputBuffer, int numKnotsU, int numKnotsV) { int numElements = numKnotsU * numKnotsV; int iGID = get_global_id(0); if (iGID >= numElements) { return; } int gridWidth = (int)sqrt((float)numElement...
float t_logpdf(float theta, float df, float loc, float scale) { float part1 = lgamma((df + 1.0f) / 2.0f) - lgamma(0.5f * df) - log(pow(df * 3.14159265358979323846264338327950288f, 0.5f) * scale); float part2 = -0.5f * (df + 1.0f) * log(1.0f + (1.0f / df) * pow((float)(theta - loc) / scale, 2.0f)); return part1 + ...
kernel void ReverseUpdate(global int* globalArray, int length, int step) { int localID = get_local_id(0); int groupID = get_group_id(0); int groupSize = get_local_size(0); int startOffset = groupID * (groupSize << 1) * step; if (groupID) { int value = globalArray[startOffset]; int posi1 = startOffset...
kernel void kernel_2(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float L = 0; for (int i = 0; i < count; i++) { float x = fabs(inputA[i] - inputB[i]); L += powr(x, 2); } L = powr(L, 0.5f); output[2] = L; }
kernel void bodyForces(const int nBody, const float dt, global float* px, global float* py, global float* pz, global float* vx, global float* vy, global float* vz) { int i = get_global_id(0); if (i < nBody) { float Fx = 0.0f; float Fy = 0.0f; float Fz = 0.0f; for (int j = 0; j < nBody; j++) { ...
kernel void square(global float* input, global float* output, private int n) { size_t i = get_global_id(0); float temp = 0; if (i < n) temp = input[i]; output[i] = temp * temp; }
kernel void compiler_char_convert_double(global char* src0, global uchar* src1, global double* dst0, global double* dst1) { int i = get_global_id(0); double d = src0[i]; dst0[i] = d; d = src1[i]; dst1[i] = d; }
int reduce_int(int v) { return v; } int reduce_int2(int2 v) { return v.x + v.y; } int reduce_int4(int4 v) { return v.x + v.y + v.z + v.w; } int init_val_int(int i) { return i; } int2 init_val_int2(int i) { return (int2)(i, i); } int4 init_val_int4(int i) { return (int4)(i, i, i, i); } int first_element_in...
kernel void test_arg_5_4_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, global float4* a4, global float4* b0, global float4* b1, global float4* b2, global float4* b3) { float4 za = (float4)(0.75f, 0.5f, 0.25f, 0.33f); unsigned int gtid = get_global_id(0); float4 tmp0 = a0[gtid] +...
kernel void matvecmult_kern(unsigned int n, global float* aa, global float* b, global float* c) { int i = get_global_id(0); int j; float tmp = 0.0f; for (j = 0; j < n; j++) tmp += aa[i * n + j] * b[j]; c[i] = tmp; }
; ; ; ; kernel void builtin_convert_uint_to_char_sat(global unsigned int* src, global char* dst) { int i = get_global_id(0); dst[i] = convert_char_sat(src[i]); }
; ; ; ; ; ; ; ; ; ; ; kernel void compiler_half_math_fmod(global float4* src0, global float4* src1, global float4* dst) { int i = get_global_id(0); dst[i] = fmod(src0[i], src1[i]); }
typedef unsigned char(uchar); kernel void log_lstat64(global uchar* log, local uchar* output, global uchar* storage) { uchar* input = log[get_global_id(0)]; output[get_local_id(0)] = input; barrier(0x01); int i; uchar** store; if (get_local_id(0) == 0) { for (i = 0; i < get_local_size(0); i++) { ...
kernel void clkernel_log(const int num, global const float* in, global float* out) { const int i = get_global_id(0); if (i >= num) return; out[i] = log(in[i]); }
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; kernel void builtin_convert_uint_to_short_sat(global unsigned int* src, global short* dst) { int i = get_global_id(0); dst[i] = convert_short_sat(src[i]); }
kernel void test_block_1_2_kern(global float* a0, global float* b0, global float* b1, local float* c0) { int i; unsigned int gtid = get_global_id(0); unsigned int ltid = get_local_id(0); size_t lsz = get_local_size(0); c0[ltid] = a0[gtid] + 0.1f; barrier(0x01); float tmp0 = 0; for (i = 0; i < lsz; i++) ...
kernel void est_pi_dev(global float* pi_d, global float* alpha_d, global float* beta_d, float sum_ab, int nstates) { unsigned int idx = get_group_id(0) * get_local_size(0) + get_local_id(0); if (idx < nstates) { pi_d[idx] = alpha_d[idx] * beta_d[idx] / sum_ab; } }
kernel void exp2_f32(unsigned int length, global float* a, global float* out) { const unsigned int id = get_global_id(0); float result = 1; if (id < length) { out[id] = exp2(a[id]); } }
kernel void set_boolean_output_best(global char* last_boolean_output, global const float* last_output, unsigned int size) { int bestOutput = 0; if (get_global_id(0) == 0) { for (unsigned int i = 1; i < size; i++) { if (last_output[bestOutput] <= last_output[i]) bestOutput = i; } for (unsig...
kernel void array_multiply_u16(global const ushort* a, global const ushort* b, global ushort* c) { unsigned int i = get_global_id(0); c[i] = a[i] * b[i]; }
kernel void dfun(global float* state, global float* coupling, global float* params, global float* deriv) { int i = get_global_id(0), n = get_global_size(0); float3 xi = vload3(i, state), eta = vload3(i, state + 3 * n), tau = vload3(i, state + 6 * n), alpha = vload3(i, state + 9 * n), beta = vload3(i, state + 12 * ...
kernel void partially_uninitialized_fract(global float4* output) { float4 f; f.xzw = 4.2; *(output + 1) = fract(f, output); }
kernel void copy(global float4* srcpos, global float4* srcvel, global float4* destpos, global float4* destvel) { int i = get_global_id(0); destpos[i] = srcpos[i]; destvel[i] = srcvel[i]; }
kernel void compute_l2norm(global const float* w, global float* ret, int dim) { float r = 0.f; for (int i = 0; i < dim; ++i) r += w[i] * w[i]; ret[0] = sqrt(r); }
kernel void vectors_kernel(global int* aVec, global int* bVec, global int* cVec) { unsigned int groupID = get_group_id(0); cVec[groupID] = aVec[groupID] + bVec[groupID]; }
kernel void square_array(global float* array) { int id = get_global_id(0); array[id] = array[id] * array[id]; }
kernel void test_arg_1_1_kern(global int* a0, global int* b0) { unsigned int gtid = get_global_id(0); int tmp0 = a0[gtid] + 0; b0[gtid] = (0 + 1) * (+tmp0); }
kernel void builtin_nextafter(global float* src1, global float* src2, global float* dst) { int i = get_global_id(0); dst[i] = nextafter(src1[i], src2[i]); }
inline int x_if_odd_else_y(int x, int y) { if (x & 1) return x; else return y; } kernel void bind_custom_function1(global int* _buf0, const unsigned int count) { unsigned int index = get_local_id(0) + (32 * get_group_id(0)); for (unsigned int i = 0; i < 4; i++) { if (index < count) { _buf0[in...
kernel void kernelULong(ulong16 input, global ulong16* output) { output[0] = input + 4294967297; }
kernel void test_arg_1_8_kern(global float* a0, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4, global float* b5, global float* b6, global float* b7) { unsigned int gtid = get_global_id(0); float tmp0 = a0[gtid] + 0.1f; b0[gtid] = (0.0f + 1.1f) * (+tmp0); b1[gtid] = (1....
kernel void decode_bbox_corner_variance_kernel(const global float* loc_data, const global float* prior_data, const int num_priors, const int share_location, const int num_loc_classes, const int background_label_id, global float* bbox_data) { int index = get_global_id(0); const int c = index % num_loc_classes; con...
kernel void frameDiff3(global char* v, global char* v2, global char* v3) { unsigned int i = get_global_id(0); if (abs(v[i] - v2[i]) < 20) { v[i] = 0; } else if (abs(v[i] - v3[i]) < 20) { v[i] = 255; } }
kernel void testuchars(global unsigned char* in, global unsigned char* out) { const int globalid = get_global_id(0); out[globalid] = in[globalid] + 7; }
kernel void foo(global int* in1, global int* in2, global int* out, int a) { global int* x = (a == 0) ? in1 : in2; *out = *x; }