kernel_code
stringlengths
49
1.22M
constant char4 spiral3d_grid_iteration_order[] = { (char4)(0, 0, 0, 0), (char4)(-1, 0, 0, 0), (char4)(0, -1, 0, 0), (char4)(0, 0, -1, 0), (char4)(-1, -1, 0, 0), (char4)(-1, 0, -1, 0), (char4)(0, -1, -1, 0), (char4)(-1, -1, -1, 0), (char4)(0, 0, 1, 0), (char4)(0, 1, 0, 0), (char4)(1, 0, 0, 0), (char4)(-1, 0, 1,...
kernel void permute_data_kernel(const global float* data, const int data_size, const int num_classes, const int num_data, const int num_dim, global float* new_data) { int index = get_global_id(0); if (index < data_size) { const int i = index % num_dim; const int c = (index / num_dim) % num_classes; con...
kernel void repulsion(global float4* inNodes, global float4* outDirections, const unsigned long count, const float k) { unsigned int i = get_global_id(0); float4 f = (float4)(0.0); for (unsigned long j = 0; j < count; j++) { if (i != j) { float4 direction = inNodes[i] - inNodes[j]; float magnitude...
kernel void uniformAdd(unsigned int n, global unsigned int* dataBase, unsigned int data_offset, global unsigned int* interBase, unsigned int inter_offset) { local unsigned int uni; global unsigned int* data = dataBase + data_offset; global unsigned int* inter = interBase + inter_offset; if (get_local_id(0) ==...
kernel void atomic_global_fence(global int* data, global int* scratch) { int i = get_global_id(0); int l = get_local_id(0); int g = get_group_id(0); if (l == 0) { scratch[g] = 0; } barrier(0x02); atomic_add(scratch + g, i); barrier(0x02); if (l == 0) { data[g] = scratch[g]; } }
kernel void warp_axis_m1plus_c(global double2* arr, unsigned int Nx) { unsigned int i_cell = (unsigned int)get_global_id(0); if (i_cell < Nx) { arr[i_cell].s0 = -arr[i_cell + Nx].s0; arr[i_cell].s1 = -arr[i_cell + Nx].s1; } }
kernel void test_int(global int* in, global int* out) { const int globalid = get_global_id(0); out[globalid] = in[globalid] + 7; }
void GPUResample(global float* spectra, global const float* resamplingTable, global const float* interpolationMatrix, unsigned int inputSpectraLength, global float* resampledSpectra); void preProcess(global const short* spectrum, global const float* resamplingTable, global const float* interpolationMatrix, global const...
kernel void hadd_short4short4(global short4* src_0, global short4* src_1, global short4* dst) { int gid = get_global_id(0); dst[gid] = hadd(src_0[gid], src_1[gid]); }
kernel void PremultiplyAlphaPlugin_Apply(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, global float* channel_ALPHA) { const size_t gid = get_global_id(0); if (gid >= filmWidth * filmHeight) return; if (!isinf(channel_IMAGEPIPELINE[gid * 3])) { const uns...
kernel void test_rowaverage(global float* in, global float* out, const int nrows, const int ncols) { float nrowsf = (float)nrows; for (int i = 0; i < nrows; i++) { for (int j = 0; j < ncols; j++) { out[j] += in[i * ncols + j]; out[j] /= nrowsf; } } }
kernel void add(global int* a, global int* b, global int* c) { int i = get_global_id(0); c[i] = a[i] + b[i]; }
kernel void atan2pi_float8float8(global float8* src_0, global float8* src_1, global float8* dst) { int gid = get_global_id(0); dst[gid] = atan2pi(src_0[gid], src_1[gid]); }
kernel void compiler_short_scatter(global short* dst) { int id = (int)get_global_id(0); dst[id] = (short)id; }
kernel void Embedding(global float* out_data, global const float* in_data, global const float* tabel, const int emb_dim, const int word_num, const int padding_idx, const int out_count) { int tid = get_global_id(0); if (tid < out_count) { int emb_id = tid % emb_dim; int word_id = tid / emb_dim; int word...
kernel void clBlockPrefix(global uint4* blockScan, global unsigned int* blockSum, unsigned int size, local unsigned int* prefixSum) { int globalId = get_global_id(0); int threadid = get_local_id(0); int blockid = get_group_id(0); size_t blockSize = get_local_size(0); prefixSum[threadid] = blockSum[threadid]...
kernel void vecsum4x2(global int4* restrict vsum, global const int4* restrict v1, global const int4* restrict v2, int noct) { const int i = get_global_id(0); const int gws = get_global_size(0); if (i >= noct) return; int4 a0 = v1[i + 0 * gws]; int4 a1 = v1[i + 1 * gws]; int4 b0 = v2[i + 0 * gws]; i...
__inline unsigned int convertKey(unsigned int converted_key) { return converted_key; } kernel void naiveScanAddition(global int* input, global int* output, int size) { if (get_global_id(0) == 0) { output[0] = 0; for (int i = 1; i < size; i++) { output[i] = output[i - 1] + input[i - 1]; } } }
kernel void set_variance(const int nthreads, const int offset, const int variance_size, global const float* variance, global float* dst) { for (int index = get_global_id(0); index < nthreads; index += get_global_size(0)) { float4 var_vec; if (variance_size == 1) var_vec = (float4)(variance[0]); els...
kernel void trunc_float4(global float4* src_0, global float4* dst) { int gid = get_global_id(0); dst[gid] = trunc(src_0[gid]); }
kernel void relational_less_than_floatfloat(global float* src_0, global float* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = (int)(src_0[gid] < src_1[gid]); }
kernel void compiler_abs_short(global short* src, global ushort* dst) { int i = get_global_id(0); dst[i] = abs(src[i]); }
inline int x_if_odd_else_y(int x, int y) { if (x & 1) return x; else return y; } kernel void transform_plus_two(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[index...
kernel void isequal_floatfloat(global float* src_0, global float* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = (int)(isequal(src_0[gid], src_1[gid])); }
kernel void test(global int* dst) { int tid = get_global_id(0); int n = get_global_size(0); dst[tid] = n; }
kernel void array_min_f32(global float* a, global float* b, const float threshold) { unsigned int i = get_global_id(0); b[i] = min(threshold, a[i]); }
kernel void pmax(global float* A, global float* B, const float x, const unsigned int n) { const int globalRow = get_global_id(0); if (globalRow < n) { B[globalRow] = min(A[globalRow], x); } }
constant float4 ZEROS = (float4)(0.0f, 0.0f, 0.0f, 0.0f); constant float4 ONES = (float4)(1.0f, 1.0f, 1.0f, 1.0f); constant float4 INFINITIES = (float4)((__builtin_inff()), (__builtin_inff()), (__builtin_inff()), (__builtin_inff())); constant unsigned int ID_GROUP_MASK = 0x3; int2 positionFromIndex(int i, int width) { ...
kernel void kernelTemplate(global float* input, global float* output, const unsigned int num_elements, local float* cache) { const unsigned int local_id = get_local_id(0); const unsigned int global_id = get_global_id(0); const unsigned int local_size = get_local_size(0); const unsigned int global_size = get_gl...
kernel void ratt8_kernel(global const float* T, global const float* RF, global float* RB, global const float* EG, const float TCONV) { const float TEMP = T[get_global_id(0)] * TCONV; const float ALOGT = log(TEMP); const float SMALL_INV = 1e+20f; const float RU = 8.31451e7f; const float PATM = 1.01325e6f; ...
kernel void Kernel_D(global int* input1, global int* input2, global int* output) { printf("\nExecuting NODE D.."); }
kernel void testWorkGroupUMin(unsigned int a, global unsigned int* res) { res[0] = work_group_reduce_min(a); }
typedef int2 int2; inline float sigmoid(float f) { return 1.0 / (1.0 + exp(-f)); } inline float sigmoid_derivative(float f) { return sigmoid(f) * (1.0 - sigmoid(f)); } kernel void Sigmoid(unsigned int size, global const float* input, global float* output) { unsigned int base = get_local_id(0) + (get_global_id(0...
kernel void half_sqrt_float(global float* src_0, global float* dst) { int gid = get_global_id(0); dst[gid] = half_sqrt(src_0[gid]); }
kernel void addc_f64(unsigned int length, global double* a, double b, global double* out) { const unsigned int id = get_global_id(0); if (id < length) { out[id] = a[id] + b; } }
kernel void test_arg_1_3_kern(global int* a0, global int* b0, global int* b1, global int* b2) { unsigned int gtid = get_global_id(0); int tmp0 = a0[gtid] + 0; b0[gtid] = (0 + 1) * (+tmp0); b1[gtid] = (1 + 1) * (+tmp0); b2[gtid] = (2 + 1) * (+tmp0); }
kernel void precompute(global unsigned char* g_table, const unsigned char crc) { unsigned int tid = get_global_id(0); unsigned char num = tid; unsigned char crcCalc = 0x0; for (unsigned int k = 0; k < 8; k++) { if ((num >> (7 - k)) % 2 == 1) { num ^= crc >> (k + 1); crcCalc ^= crc << (7 - k); ...
kernel void calc_alpha_dev(int nstates, global float* alpha_d, int offset, global float* b_d, int obs_t) { unsigned int idx = get_group_id(0) * get_local_size(0) + get_local_id(0); if (idx < nstates) { alpha_d[offset + idx] = alpha_d[offset + idx] * b_d[(obs_t * nstates) + idx]; } }
kernel void spoc_max(global const double* input, global double* output, const int size) { int i = get_global_id(0); if (i > 1) return; const int NB_THREADS = 256; local double r[NB_THREADS]; double res = 0; r[i] = input[(size / NB_THREADS * i)]; for (int j = (size / NB_THREADS * i); j < (size / NB_THR...
kernel void serial_count_if_char_equal2(unsigned int size, global unsigned int* result, global uchar* _buf0) { unsigned int count = 0; for (unsigned int i = 0; i < size; i++) { const uchar value = _buf0[i]; if (value == 0x10) { count++; } } *result = count; }
float addLogs(float A, float B) { float maxi = fmax(A, B); float corr = native_log(1.0 + native_exp(-fabs(A - B))); return maxi + corr; } kernel void creategamma(global float* llrIN, global float* gamma) { unsigned int _outputs[16] = {0, 0, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 2, 2, 3, 3}; float sgn[2] = {1, -1}; ...
kernel void mul(global const float* A, global const float* B, global float* C) { int i = get_global_id(0); C[i] = A[i] * B[i]; }
kernel void exscan_global(global int* data) { int id = get_global_id(0); data[id] = (id > 0) ? data[id - 1] : 0; barrier(0x02); for (int s = 1; s < get_global_size(0); s *= 2) { int tmp = data[id]; if (id + s < get_global_size(0)) { data[id + s] += tmp; } barrier(0x02); } if (id == 0)...
kernel void aggregate(global int* in1, global int* in2, global int* output) { int i = get_global_id(0); output[i] = in1[i] + in2[i]; }
constant float beta = 0.66666f; kernel void adjust_weights(global const float* direction, float n, float alpha, global float* old_delta, global float* weights) { int gid = get_global_id(0); float new_delta = n * (-direction[gid]) + alpha * old_delta[gid]; weights[gid] += new_delta; old_delta[gid] = new_delta;...
inline int isLeft(const float2 P0, const float2 P1, const float2 P2) { return ((P1.x - P0.x) * (P2.y - P0.y) - (P2.x - P0.x) * (P1.y - P0.y)); } inline int wn_PnPoly(const float2 P, constant float2* V, const ulong n) { int wn = 0; for (ulong i = 0; i < n; i++) { if (V[i].y <= P.y) { if (V[i + 1].y > P...
kernel void kernel7_write(global char* ptr, unsigned long memsize) { int i; global unsigned long* buf = (global unsigned long*)ptr; int idx = get_global_id(0); unsigned long n = memsize / sizeof(unsigned long); int total_num_threads = get_global_size(0); int rand_data_num = (1024 * 1024) / sizeof(unsigned l...
kernel void sample_test(global char2* source, global char* dest) { if (get_global_id(0) != 0) return; char3 tmp; tmp = (char)((char)0); tmp.s2 = source[0].s1; vstore3(tmp, 0, dest); tmp = (char)((char)0); tmp.s1 = source[1].S1; vstore3(tmp, 1, dest); tmp = (char)((char)0); tmp.S1 = source[2].S1...
int Calculate2DIndex(int x, int y, int DATA_W) { return x + y * DATA_W; } int Calculate3DIndex(int x, int y, int z, int DATA_W, int DATA_H) { return x + y * DATA_W + z * DATA_W * DATA_H; } int Calculate4DIndex(int x, int y, int z, int t, int DATA_W, int DATA_H, int DATA_D) { return x + y * DATA_W + z * DATA_W *...
kernel void vector_add(global const float* A, global const float* B, global float* C) { int i = get_global_id(0); C[i] = A[i] + B[i]; }
kernel void bar(global unsigned int* bar_return) { bar_return[0] = 0xdeadbeef; }
kernel void FWD_init_alpha(const int N, global float* b, global float* prior, global float* alpha, global float* beta) { size_t idx = get_global_id(0); if (idx < N) { alpha[idx] = prior[idx] * b[idx]; beta[idx] = 1.0f; } }
struct stable_info { double k1; double theta0; double alfa; double alfainvalfa1; double mu_0; double sigma; double xi; double xxi_th; double c2_part; double c1; double THETA_TH; double beta; double xi_coef; short is_xxi_negative; unsigned int integrand; double final_pdf_factor; double ...
kernel void test_stream_write_char(global char* src, global char* dst) { int tid = get_global_id(0); dst[tid] = src[tid]; }
inline long indexFromImagePosition(int2 imgpos, unsigned int width, unsigned int height) { return imgpos.x + (imgpos.y * width); } kernel void anaglyph(global uchar* input, global uchar* output, global uchar* depth, unsigned int width, unsigned int height, int direction) { int gid = get_global_id(0); size_t gsiz...
kernel void mandelGPU(global int* pixels, const int width, const int height, const float scale, const float offsetX, const float offsetY, const int maxIterations) { const int gid = get_global_id(0); const int gid4 = 4 * gid; const int maxSize = max(width, height); const float kx = (scale / 2.f) * width; const...
kernel void unary_plus_ushort16(global ushort16* src_0, global ushort16* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void compiler_lower_return0(global int* src, global int* dst) { const int id = get_global_id(0); dst[id] = id; if (src[id] > 0) return; dst[id] = src[id]; }
kernel void kern(global float* output, global float* inputA, global float* inputB) { size_t i = get_global_id(0); output[i] = inputA[i] + inputB[i]; }
kernel void set_kernel_arg(global unsigned int* dst, float3 src) { size_t gid = get_global_id(0); switch (gid % 3) { case 0: dst[gid] = src.x; break; case 1: dst[gid] = src.y; break; case 2: dst[gid] = src.z; break; default: break; } }
kernel void multiply_float4float4(global float4* src_0, global float4* src_1, global float4* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] * src_1[gid]; }
kernel void applyRulesOCL(const int rows, const int cols, global int* subMat) { int elements = rows * cols; int wrkID = get_group_id(0); int locID = get_local_id(0); int wrkSize = get_local_size(0); int subIndex = wrkSize * wrkID + locID; if (subIndex < elements) { subMat[subIndex] += 1; } }
void bar() { barrier(0x02); } kernel void foo(global int* data) { int x = data[0]; bar(); data[1] = x; }
inline float scanLocalMem(float val, local float* lmem, int exclusive) { int idx = get_local_id(0); lmem[idx] = 0.0f; idx += get_local_size(0); lmem[idx] = val; barrier(0x01); float t; for (int i = 1; i < get_local_size(0); i *= 2) { t = lmem[idx - i]; barrier(0x01); lmem[idx] += t; barr...
kernel void compiler_mul_uint(global unsigned int* src0, global unsigned int* src1, global unsigned int* dst) { int id = (int)get_global_id(0); dst[id] = src0[id] * src1[id]; }
kernel void unary_plus_int4(global int4* src_0, global int4* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void swap(global float* s1, global float* s2) { float tmp = *s2; *s2 = *s1; *s1 = tmp; }
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 Saxpy_naive(float alpha, global float* x, unsigned int incx, global float* y, unsigned int incy) { unsigned int gid = get_global_id(0); y[gid * incy] += alpha * x[gid * incx]; }
kernel void compiler_if_else(global int* src, global int* dst) { int id = (int)get_global_id(0); dst[id] = src[id]; if (dst[id] >= 0) { dst[id] = src[id + 1]; src[id] = 1; } else { dst[id]--; src[id] = 2; } }
kernel void MaxPoolBackward(const int nthreads, global const float* top_diff_data, int top_diff_offset, global const float* top_mask_data, const int top_mask_offset, const int num, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int kernel_h, const int kerne...
kernel void test_arg_7_1_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* a5, global int* a6, global int* b0) { 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] + 3; int tmp4 =...
kernel void lte(global int* out, float a, float b) { out[0] = a <= b; }
kernel void array_dtanh_f32(global float* a, global float* b) { unsigned int i = get_global_id(0); b[i] = tanh(a[i]); b[i] = 1.0 - b[i] * b[i]; }
size_t my_strlen(constant char* str) { size_t len = 0; if (str) while (*str++) ++len; return len; } void my_strcpy(global char* dest, constant char* src, size_t n) { while (n--) *dest++ = *src++; } void set_error_msg(global char* error_msg, size_t error_msg_size, constant char* msg) { const si...
kernel void templateKernel(global unsigned int* output, global unsigned int* input, const unsigned int multiplier) { unsigned int tid = get_global_id(0); output[tid] = input[tid] * multiplier; }
kernel void neg_f32(unsigned int length, global float* a, global float* out) { const unsigned int id = get_global_id(0); if (id < length) { out[id] = -a[id]; } }
kernel void kernel_tgamma_withDD1(global float* result_tgamma, int N) { float t1 = 1.3; int i = 0; for (i = 0; i < N; i++) { t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); t1 = tgamma(t1); ...
float4 ComputeForce(float4 force, float4 position_a, float4 position_b, float softening_squared) { float4 r; r.x = position_a.x - position_b.x; r.y = position_a.y - position_b.y; r.z = position_a.z - position_b.z; r.w = 1.0f; float distance_squared = mad(r.x, r.x, mad(r.y, r.y, r.z * r.z)); distance_squ...
kernel void fir12(global float* input, global float* output) { int i = get_global_id(0); int j = 0; int coeff[12] = {5, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 7}; for (j = 0; j < 12; j++) { output[i] += coeff[j] * (input[i + 12 - j - 1]); } }
kernel void pre_increment_uint16(global uint16* src_0, global uint16* dst) { int gid = get_global_id(0); dst[gid] = ++src_0[gid]; }
kernel void super_decode(global const char* in, global char* out) { int num = get_global_id(0); out[num] = in[num] + 2; }
kernel void init_histogram(global int* histogram, int size) { const int g_id = get_global_id(0); const int g_size = get_global_size(0); if (g_id < size) histogram[g_id] = 0; if (g_size < size) { for (int i = g_size; i < size; i++) { const int index = g_id + i; if (index < size) his...
kernel void floats_to_complex(global const float* a, global float* out, int n) { int i = get_global_id(0); if (i >= n) return; out[2 * i] = a[i]; out[2 * i + 1] = 0; }
kernel void maxPoly(double x0, global double* coef, double tol, int nParam, global double* argMax) { int i = get_global_id(0); if (i >= nParam) { return; } else { double x = x0; double diff = tol + 1; double firstDeriv, secondDeriv, xNew; while (diff > tol) { firstDeriv = 2 * coef[i] * ...
kernel void test_arg_1_3_kern(global float4* a0, global float4* b0, global float4* b1, global float4* b2) { 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); b2[gt...
kernel void compiler_atomic_functions(global int* dst, local int* tmp, global int* src) { int lid = get_local_id(0); int i = lid % 12; if (lid == 0) { for (int j = 0; j < 12; j = j + 1) { atomic_xchg(&tmp[j], 0); } atomic_xchg(&tmp[4], -1); } barrier(0x01); switch (i) { case 0: ...
kernel void complex_copy_opencl(global double* o_real, global double* o_imaginary, global double* i_real, global double* i_imaginary, unsigned nx) { const int i = get_global_id(0); if (i < nx) { o_real[i] = i_real[i]; o_imaginary[i] = i_imaginary[i]; } }
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); float3 xi = vload3(i, state), eta = vload3(i, state + 3 * n), alpha = vload3(i, state + 6 * n), beta = vload3(i, state + 9 * n); float c_0 = coupling[i]; ...
kernel void arange(global double* a, double alpha) { unsigned long i = get_global_id(0); a[i] += alpha * i; }
unsigned int MurmurHash(const unsigned int value, const unsigned int seed) { const unsigned int c1 = 0xcc9e2d51; const unsigned int c2 = 0x1b873593; const unsigned int r1 = 15; const unsigned int r2 = 13; const unsigned int m = 5; const unsigned int n = 0xe6546b64; unsigned int hash = value; hash *= c1...
kernel void sum(global float* grid, global float* result, const unsigned int num_elements, local float* cache) { const unsigned int local_id = get_local_id(0); const unsigned int global_id = get_global_id(0); const unsigned int group_id = get_group_id(0); const unsigned int local_size = get_local_size(0); ca...
kernel void sampleKernel(global const float* a, global const float* b, global const float* c, global float* d) { int gid = get_global_id(0); d[gid] = sqrt((a[gid] * a[gid]) + (b[gid] * b[gid]) + (c[gid] * c[gid])); }
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 non_branch(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; t1 /= t2; t2 %= t1...
kernel void sumColumn(global float* distances, global const float* column, const ulong dimensions, const ulong offset) { size_t index = get_global_id(0); float distance = column[(index + offset) / dimensions] - column[(index + offset) % dimensions]; distances[index] += distance * distance; }
kernel void arccos_f64(unsigned int length, global double* a, global double* out) { const unsigned int id = get_global_id(0); if (id < length) { out[id] = acos(a[id]); } }
kernel void test_arg_6_3_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* a4, global float* a5, global float* b0, global float* b1, global float* b2) { unsigned int gtid = get_global_id(0); float tmp0 = a0[gtid] + 0.1f; float tmp1 = a1[gtid] + 1.1f; float tmp2 = a2[gtid...
kernel void builtin_local_size(global int* ret, global int* i_dim) { *ret = get_local_size(*i_dim); }
kernel void half_divide_float4float4(global float4* src_0, global float4* src_1, global float4* dst) { int gid = get_global_id(0); dst[gid] = half_divide(src_0[gid], src_1[gid]); }
kernel void batch_sum_fw_kernel(const global float* px, const unsigned size, const unsigned batch, global float* py) { const unsigned i = get_global_id(0); if (i < size) { float temp = .0f; px += i; for (unsigned j = 0; j < batch; ++j, px += size) { temp += *px; } py[i] = temp; } }