kernel_code
stringlengths
49
1.22M
kernel void s_vector_scale_mem(global float* a, global float* alpha, int N) { int i = get_global_id(0); if (i < N) a[i] *= alpha[0]; }
kernel void compiler_shift_right(global unsigned int* src, global int* dst) { int i = get_global_id(0); dst[i] = src[i] >> 24; }
kernel void post_decrement_uint(global unsigned int* src_0, global unsigned int* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid]--; }
kernel void vecMultiplication(global const float* a, global const float* b, global float* c) { int gid = get_global_id(0); c[gid] = a[gid] * b[gid]; }
kernel void hello(global float* x) { int ind = get_global_id(0); x[ind] = x[ind] * 2; }
kernel void huergb_pkd(global unsigned char* input, global unsigned char* output, const double hue, const double sat, const unsigned int height, const unsigned int width) { int id = get_global_id(0); double r, g, b, min, max, delta; double temp1, temp2, temp3; id = id * 3; if (id < 3 * height * width) { ...
uint4 inc128(uint4 u) { int4 h = (u == (uint4)(0xFFFFFFFF)); uint4 c = (uint4)(h.y & h.z & h.w & 1, h.z & h.w & 1, h.w & 1, 1); return u + c; } uint4 neg128(uint4 u) { return inc128(u ^ (uint4)(0xFFFFFFFF)); } int greaterFixedPoint(uint4 a, uint4 b) { int aAndBAreNegative = 0; if (a.x > 0x7fffffffu && b....
float calc(int idx, int xx, int yy) { const int j = idx / xx; const int i = idx % xx; float ei = i / (float)xx; float ej = j / (float)yy; if (ei > 0.5) ei = 1.0 - ei; if (ej > 0.5) ej = 1.0 - ej; return ei * ei + ej * ej; } kernel void applyAbsFilter(global float* mid, int xx, int yy, float d2b) ...
kernel void zipWith(global float* A, global float* B, global float* R, char ops) { int id = get_global_id(0); if (ops == '+') R[id] = A[id] + B[id]; else if (ops == '-') R[id] = A[id] - B[id]; else if (ops == '*') R[id] = A[id] * B[id]; else if (ops == '/') R[id] = A[id] / B[id]; }
kernel void ratt6_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; ...
int linear_interpolation_GPU(double ratio, int nL, int nR, int vL, int vR, double nI) { double dnL = nL, dnR = nR, dvL = vL, dvR = vR; if (ratio > 1.0) return 0; double dvI = dvL * (dnR - nI) + dvR * (nI - dnL); int vI = (int)dvI; return vI; } double windows_GPU(double t, double nT) { if (t <= nT && t...
void helper_bicgstab_kernel2_parallel_reduction(local float* tmp_buffer) { for (unsigned int stride = get_local_size(0) / 2; stride > 0; stride /= 2) { barrier(0x01); if (get_local_id(0) < stride) tmp_buffer[get_local_id(0)] += tmp_buffer[get_local_id(0) + stride]; } } float bicgstab_kernel2_inner_pr...
kernel void compiler_double_2(global float* src, global double* dst) { int i = get_global_id(0); float d = 1.234567890123456789f; if (i < 14) dst[i] = d * (d + src[i]); else dst[i] = 14; }
float distsqr(global float* a, global float* b) { float result = 0.0f; for (int i = 0; i < 3; ++i) { result += (a[i] - b[i]) * (a[i] - b[i]); } return result; } float distsqr__(float* a, global float* b) { float result = 0.0f; for (int i = 0; i < 3; ++i) { result += (a[i] - b[i]) * (a[i] - b[i])...
kernel void test_block_1_2_kern(global int* a0, global int* b0, global int* b1, local int* 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; barrier(0x01); int tmp0 = 0; for (i = 0; i < lsz; i++) tmp0 += c...
kernel void matrix_dot_vector(global const float4* matrix, global const float4* vector, global float* result) { int gid = get_global_id(0); result[gid] = dot(matrix[gid], vector[0]); }
kernel void add(global unsigned int* const a, global const unsigned int* const inc, const unsigned int n) { const size_t gid = get_global_id(0); if (gid < n) a[gid] += inc[gid / (2 * get_local_size(0))]; }
kernel void add(global float* a, global float* b, global float* answer) { int gid = get_global_id(0); answer[gid] = a[gid] + b[gid]; }
kernel void powr_float8float8(global float8* src_0, global float8* src_1, global float8* dst) { int gid = get_global_id(0); dst[gid] = powr(src_0[gid], src_1[gid]); }
kernel void sigmoid(global const float* inputMatrix, global float* resultMatrix) { int id = get_global_id(0); resultMatrix[id] = 1.0f / (1.0f + native_exp(-inputMatrix[id])); }
kernel void mandelbrot(global int* A, const int N, const int largeur, const int hauteur) { int idx = get_global_id(0); int y = idx / hauteur; int x = idx - (y * largeur); if (y >= hauteur || x >= largeur) return; else { int cpt = 0; float x1 = 0.f; float y1 = 0.f; float x2 = 0.f; fl...
inline float _distance_2_point(float x, float y, float rx, float ry, float sw, float sh, float ez, float ex, float ey) { float dx = x / rx * sw - sw / 2.0f + ex; float dy = y / ry * sh - sh / 2.0f - ey; return sqrt(ez * ez + dx * dx + dy * dy); } inline float _subtended_angle(float x1, float y1, float x2, float ...
kernel void vector_copy(global int* in, global int* out) { int id = get_global_id(0); out[id] = in[id]; }
kernel void arrayDivide(global const float* m1, global const float* m2, global float* mr) { int iGID = get_global_id(0); mr[iGID] = m1[iGID] / m2[iGID]; }
constant ulong sBox4_S80[] = {0xc000000000000000, 0x5000000000000000, 0x6000000000000000, 0xb000000000000000, 0x9000000000000000, 0x0000000000000000, 0xa000000000000000, 0xd000000000000000, 0x3000000000000000, 0xe000000000000000, 0xf000000000000000, 0x8000000000000000, 0x4000000000000000, 0x7000000000000000, 0x10000000...
kernel void matrixVectorMultSecond(global float* inputOutput, global float* biases, const int useBias, const int activationtype, const int outputSize, const int numberOfPartitions) { float sum = 0.0; int currentRow = get_global_id(0); for (int i = 0; i < numberOfPartitions; i++) { sum += inputOutput[mad24(out...
kernel void test_ulong8(global ulong* pin, global ulong* pout) { int x = get_global_id(0); ulong8 value; value = vload8(x, pin); value += (ulong8){(ulong)1, (ulong)2, (ulong)3, (ulong)4, (ulong)5, (ulong)6, (ulong)7, (ulong)8}; vstore8(value, x, pout); }
kernel void atomic_cmpxchg_false_race(global int* data, local int* scratch) { int l = get_local_id(0); if (l == 0) { scratch[0] = 0; } barrier(0x01); bool done = false; int before, old; int result; for (int i = 0; i < get_local_size(0); i++) { barrier(0x01); before = scratch[0]; barrier...
kernel void wgf_reduce(const int numElems, global const int* src, global int* dst) { unsigned int global_id = get_global_id(0); int sum = 0; for (int i = global_id; i < numElems; i += get_global_size(0)) sum += src[i]; sum = work_group_reduce_add(sum); if (get_local_id(0) == 0) dst[get_group_id(0)]...
kernel void kernel_8(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float A = 0; for (int i = 0; i < count; i++) { A += (fabs(inputA[i] - inputB[i]) / (fmax(inputA[i], inputB[i]))); } output[8] = A; }
kernel void forwardNaive(const int N, global const unsigned char* mask, global const float* input, global float* output) { const int globalId = get_global_id(0); if (globalId >= N) { return; } output[globalId] = mask[globalId] == 1 ? input[globalId] : 0.0f; }
kernel void atomics(volatile global int* global_int_data, volatile local int* local_int_data, volatile global unsigned int* global_uint_data, volatile local unsigned int* local_uint_data, volatile global float* global_float_data, volatile local float* local_float_data) { int val_int = 1; int val_uint = 2; unsigne...
kernel void setArgNumNoType(float input, global float* output) { int i = get_global_id(0); if (i < 10) output[i] = input; }
kernel void kernel_nextafter_withoutDD1(global float* result_nextafter, int N) { float t1; float t2; float t3; float t4; float t5; float t6; float t7; float t8; float t9; float t10; float i = 0.0; float j = 2; float n = 7 * (float)(N); for (i = 0.0; i < n; i = i + 1.0) { t1 = nextafter...
unsigned char invert(unsigned char in) { return 255 - in; } kernel void render(global char* input, global char* output, int width, int height) { unsigned int i = get_global_id(0); unsigned int i_mul_4 = i * 4; output[i_mul_4] = invert(input[i_mul_4]); output[i_mul_4 + 1] = invert(input[i_mul_4 + 1]); out...
kernel void setupLowProcTest(global unsigned int* input, global unsigned int* output) { unsigned int tid = get_global_id(0); output[0] = input[0] * 2; }
kernel void loop0(global float* a) { int id = get_local_id(0); float16 v = vload16(id, a); vstore16(v * 2, id, a); }
kernel void Reduction_DecompUnroll(const global unsigned int* inArray, global unsigned int* outArray, unsigned int N, local unsigned int* block) { int LID = get_local_id(0); int Elem = get_local_size(0) * get_group_id(0) * 2 + LID; int LSize = get_local_size(0); block[LID] = inArray[Elem] + inArray[Elem + LSize...
constant unsigned int constant_a[2] = {0xabcd5432u, 0xaabb5533u}; kernel void test(global unsigned int* in, global unsigned int* out) { int i = get_global_id(0); int j = get_global_id(0) % (sizeof(constant_a) / sizeof(constant_a[0])); out[i] = constant_a[j]; }
kernel void compiler_abs_diff_ushort3(global ushort3* x, global ushort3* y, global ushort3* diff) { int i = get_global_id(0); diff[i] = abs_diff(x[i], y[i]); }
kernel void compiler_bitcast_long_to_short4(global ulong* src, global ushort4* dst) { int tid = get_global_id(0); ulong v = src[tid]; ushort4 dl = __builtin_astype((v), ushort4); dst[tid] = dl; }
kernel void sub_sat_uint8uint8(global uint8* src_0, global uint8* src_1, global uint8* dst) { int gid = get_global_id(0); dst[gid] = sub_sat(src_0[gid], src_1[gid]); }
kernel void test(float global* a, const int n) { float sum = 0.0; float c = a[0]; for (int i = 0; i < 10; i++) sum += 10.0 + c; a[get_global_id(0)] = sum; }
kernel void test_arg_1_4_kern(global float* a0, global float* b0, global float* b1, global float* b2, global float* b3) { 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) * (+tmp0); b3[gtid] =...
kernel void rotate_ulongulong(global ulong* src_0, global ulong* src_1, global ulong* dst) { int gid = get_global_id(0); dst[gid] = rotate(src_0[gid], src_1[gid]); }
union BufferType { float f; unsigned int u; }; kernel void getBoundsGroup(global float4* pointPosition, global float4* minBoundGroup, global float4* maxBoundGroup, const int workGroupSize, const int numPoints) { int p = get_global_id(0); float4 minBound = (float4)0x1.fffffep127f; float4 maxBound = (float4)-0...
kernel void foo(global int* out) { *out = (short)get_local_size(0); }
kernel void simplekernel(global int* array, const int singlevalue) { int i = get_global_id(0); array[i] = array[i] * array[i]; }
float metric(int x1, int y1, int x2, int y2) { float x = x1 - x2; float y = y1 - y2; return x * x + y * y; } int xor_shift(int x) { x ^= x << 13; x ^= x >> 17; x ^= x << 15; return x; } kernel void JFA(global const unsigned int* M_g, global const unsigned int* P1_g, global const unsigned int* P2_g, glob...
kernel void foo(global uchar2* a, global uchar2* b, global uchar2* c) { *a = bitselect(*a, *b, *c); }
kernel void lt(global int* out, ushort a, ushort b) { out[0] = a < b; }
kernel void _idctrow(global int* blk, const int offset) { private int8 x; private int8 y; private int x8; x.s01234567 = vload8(offset, blk).s04621753; x.s01 <<= 11; x.s0 += 128; x8 = 565 * (x.s4 + x.s5); x.s4 = x8 + (2841 - 565) * x.s4; x.s5 = x8 - (2841 + 565) * x.s5; x8 = 2408 * (x.s6 + x.s7)...
kernel void desaturate(global const float* src, global float* dst, int size) { int idx = get_global_id(0); if (idx < size) { float r = src[idx * 3]; float g = src[idx * 3 + 1]; float b = src[idx * 3 + 2]; float val = 0.2126f * r + 0.7152f * g + 0.0722f * b; dst[idx * 3] = dst[idx * 3 + 1] = dst...
kernel void add(global const float* a, global const float* b, global float* c, int vectorsLength) { int id = get_global_id(0); int nproc = get_global_size(0); int i; for (i = id; i < vectorsLength; i = i + nproc) { c[i] = a[i] + b[i]; } }
void apple(global int* B, global int* A, int n) { A[n] = B[n + 2]; } kernel void bar(global int* A, int n, global int* B) { apple(B, A, n); }
kernel void A(global float* a, global float* b, const int c) { int d = get_global_id(0); if (d < c) { a[d] += 1; } }
kernel void init_stretch(global float4* out_min, global float4* out_max) { int gid = get_global_id(0); out_min[gid] = (float4)(0x1.fffffep127f); out_max[gid] = (float4)(-0x1.fffffep127f); }
kernel void IntersectionP(const global float* vertex, const global float* dir, const global float* o, const global float* bounds, global unsigned char* tHit, int count, int size) { int iGID = get_global_id(0); if (iGID >= count) return; float4 e1, e2, s1, s2, d; float divisor, invDivisor, b1, b2, t; fl...
kernel void kernel_mad_withoutDD1(global float* result_mad, int N) { float t1 = 0.0; float t2 = 0.0; float t3 = 0.0; float t4 = 0.0; float t5 = 0.0; float t6 = 0.0; float t7 = 0.0; float t8 = 0.0; float t9 = 0.0; float t10 = 0.0; float t11 = 0.0; float t12 = 0.0; float t13 = 0.0; float t14 =...
kernel void op_log(global double* a, const int offset) { int i = get_global_id(0) + offset; a[i] = log(a[i]); }
constant const uchar sigma[16][16] = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3}, {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4}, {7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8}, {9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13}, {2...
kernel void Test(global const int* a, global const int* b, global int* c, int iNumElements) { int iGID = get_global_id(0); if (iGID >= iNumElements) { return; } c[iGID] = iGID; }
kernel void test_block_1_3_kern(global int* a0, global int* b0, global int* b1, global int* b2, local int* 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; barrier(0x01); int tmp0 = 0; for (i = 0; i < lsz; i+...
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 mult(global float4* a, global float4* b, global float4* out) { int gX = get_global_id(0); out[gX] = a[gX] * b[gX]; }
kernel void compiler_abs_diff_int(global int* x, global int* y, global unsigned int* diff) { int i = get_global_id(0); diff[i] = abs_diff(x[i], y[i]); }
kernel void complex_mult(global double2* a, global double2* b, global double2* c) { unsigned int n = get_global_id(0); c[n].x = a[n].x * b[n].x - a[n].y * b[n].y; c[n].y = a[n].x * b[n].y + a[n].y * b[n].x; }
kernel void brahmaKernel(global int* buf) { int x = 1; int y = (x + 1); buf[0] = y; }
kernel void blockAddition(global float* input, global float* output) { int globalId = get_global_id(0); int groupId = get_group_id(0); int localId = get_local_id(0); local float value[1]; if (localId == 0) { value[0] = input[groupId]; } barrier(0x01); output[globalId] += value[0]; }
kernel void test_arg_6_1_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, global float4* a4, global float4* a5, global float4* b0) { 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; float4 tmp1 = a1[gtid] +...
kernel void plaquette_reduction(global float* plaq_buf, global float* tplaq_buf, global float* splaq_buf, global float* plaq, global float* tplaq, global float* splaq, const unsigned int bufElems) { int id = get_global_id(0); if (id == 0) { for (unsigned int i = 1; i < bufElems; i++) { plaq_buf[0] += plaq...
kernel void func_kernel(global float* a, global float* b, global float* c) { unsigned int i = get_global_id(0); int j = 1; int iej = i != j; c[i] = 0.1 * iej; }
kernel void max_uchar16uchar16(global uchar16* src_0, global uchar16* src_1, global uchar16* dst) { int gid = get_global_id(0); dst[gid] = max(src_0[gid], src_1[gid]); }
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 copy_word(global int* in, global int* out) { int index = get_global_id(0); out[index] = in[index]; }
inline int scan_simt_exclusive(local int* input, size_t idx, const unsigned int lane) { if (lane > 0) input[idx] = input[idx - 1] + input[idx]; if (lane > 1) input[idx] = input[idx - 2] + input[idx]; if (lane > 3) input[idx] = input[idx - 4] + input[idx]; if (lane > 7) input[idx] = input[idx - 8...
inline void ComparatorPrivate(unsigned int* keyA, unsigned int* valA, unsigned int* keyB, unsigned int* valB, unsigned int dir) { if ((*keyA > *keyB) == dir) { unsigned int t; t = *keyA; *keyA = *keyB; *keyB = t; t = *valA; *valA = *valB; *valB = t; } } inline void ComparatorLocal(local...
uint4 GetAddressMapping(int index) { const unsigned int local_id = get_local_id(0); const unsigned int group_id = get_global_id(0) / get_local_size(0); const unsigned int group_size = get_local_size(0); uint2 global_index; global_index.x = index + local_id; global_index.y = global_index.x + group_size; ...
kernel void div(global char* out, char a, char b) { out[0] = a / b; }
kernel void kernel_div_withDD1(float p1, global float* result_div, int N) { float t1 = 1.0; float t2 = p1; int i = 0; for (i = 0; i < N; i++) { t1 /= 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 kernel_sinpi_withoutDD1(global float* result_sinpi, int N) { float t1 = 1.3; float t2 = 2.0; float t3 = 4.3; float t4 = 4.3; float t5 = 4.3; float t6 = 4.3; float t7 = 4.3; float t8 = 4.3; float t9 = 4.3; float t10 = 4.3; float i = 1.0; float n = 10 * N; for (i = 1.0; i < n; i = i...
kernel void inplace_div(global float* val1, global const float* val2) { if (get_global_id(0) == 0) *val1 /= *val2; }
kernel void WhiteBalance_Apply(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, const float scaleR, const float scaleG, const float scaleB) { const size_t gid = get_global_id(0); if (gid >= filmWidth * filmHeight) return; if (!isinf(channel_IMAGEPIPELINE[gid *...
inline float sigmoid(float z) { return 1.0f / (1.0f + exp(-z)); } inline float sigmoid_gradient(float y) { return y * (1.0f - y); } inline float relu(float z) { return z > 0 ? z : 0; } inline float relu_gradient(float y) { return y > 0 ? 1 : 0; } inline float tanh_gradient(float y) { return 1.0f - y * y; } ...
kernel void mad_hi_uint8uint8uint8(global uint8* src_0, global uint8* src_1, global uint8* src_2, global uint8* dst) { int gid = get_global_id(0); dst[gid] = mad_hi(src_0[gid], src_1[gid], src_2[gid]); }
float form_volume(void); float form_volume(void) { return 1.0f; } float Iq(float q, float q0, float sigma); float Iq(float q, float q0, float sigma) { float scaled_dq = (q - q0) / sigma; return exp(-0.5f * scaled_dq * scaled_dq); } float Iqxy(float qx, float qy, float q0, float sigma); float Iqxy(float qx, floa...
kernel void reduce4(global unsigned int* input, global unsigned int* output, local unsigned int* sdata) { unsigned int tid = get_local_id(0); unsigned int bid = get_group_id(0); unsigned int gid = get_global_id(0); unsigned int blockSize = get_local_size(0); unsigned int index = bid * (256 * 2) + tid; sdat...
kernel void kernel_pown_withDD1(global float* result_pown, int N) { float t1 = 2.2; int t2 = 1; int i = 0; for (i = 0; i < N; i++) { t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, t2); t1 = pown(t1, ...
kernel void divide_charchar(global char* src_0, global char* src_1, global float* dst) { int gid = get_global_id(0); dst[gid] = (float)(src_0[gid] / src_1[gid]); }
kernel void mem_read(global volatile float* buffer, int num_it, global float* dummyBuffer) { const int k = get_global_id(0); float tmp = 0; while (num_it-- != 0) tmp += buffer[k]; *dummyBuffer = tmp; }
extern kernel void CopyBuffer(global unsigned int* src, global unsigned int* dst) { int id = (int)get_global_id(0); dst[id] = src[id]; }
kernel void moving_average(global int* values, global float* average, int length, int width) { int i; int add_value; add_value = 0; for (i = 0; i < width; i++) { add_value += values[i]; } average[width - 1] = (float)add_value; for (i = width; i < length; i++) { add_value = add_value - values[i -...
kernel void fillInvalidValues(global float* grid, const float value, int const num_elements) { int global_id = get_global_id(0); if (global_id >= num_elements) return; if (isnan(grid[global_id])) grid[global_id] = value; if (isinf(grid[global_id])) grid[global_id] = value; }
kernel void ParallelSelection_byte_improved(global uchar4* in, global uchar* out) { unsigned i = get_global_id(0); unsigned n = get_global_size(0); global unsigned char* in_char = (global unsigned char*)in; unsigned ith = in_char[i]; unsigned pos = 0, j = 0; do { uchar4 tmp = in[j >> 2]; unsigned jt...
kernel void squareArray(global const float* restrict const in, global float* restrict const out) { const int offset = get_global_id(0); out[offset] = in[offset] * in[offset]; }
unsigned int stepLCG(unsigned int* z, unsigned int A, unsigned int C) { return (*z) = (A * (*z) + C); } unsigned int stepLFG(unsigned int* z, global unsigned int* znmk, unsigned int A, unsigned int C) { return (*znmk) = (*z) = (A * (*z) + C) + (*znmk); } unsigned int stepCTG(unsigned int* z, unsigned int S1, unsi...
kernel void kernel_mad_withoutDD8(global float* result_mad, int N) { float s = 1; float8 t1 = s + (float8)(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7); float8 t2 = s + (float8)(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7); float8 t3 = s + (float8)(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7); float8 t4 = s + (float8)(0, 0.1, 0.2...
inline unsigned long fibonacci(int n) { unsigned long n1 = 0; unsigned long n2 = 1; unsigned long next = 0; next = n1 + n2; for (int j = 0; j < n - 3; j++) { n1 = n2; n2 = next; next = n1 + n2; } return next; } inline float trigonometrySP(int t) { float result = 0; float p1 = 0; float...
void F(private unsigned int* state, int src_idx, int dst_idx); void FL(private unsigned int* state); void InvFL(private unsigned int* state); kernel void shuffle_state2(global unsigned int* state, local unsigned int* cache) { size_t id = get_local_id(0); cache += (id & 0xFFFFFFE0) << 2; state += (get_global_id(0)...
kernel void test(global float* one, global float* two) { two[get_global_id(0)] = one[get_global_id(0)] + 5; }