kernel_code
stringlengths
49
1.22M
kernel void test_arg_1_8_kern(global int* a0, global int* b0, global int* b1, global int* b2, global int* b3, global int* b4, global int* b5, global int* b6, global int* b7) { unsigned int gtid = get_global_id(0); int tmp0 = a0[gtid] + 0; b0[gtid] = (0 + 1) * (+tmp0); b1[gtid] = (1 + 1) * (+tmp0); b2[gtid] = ...
kernel void test_arg_6_3_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, global int4* b2) { 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 + z...
kernel void somaOLD(global int* E, local int* EP) { int lo_id = get_local_id(0); int gr_id = get_group_id(0); int s = get_local_size(0); for (; s > 0; s /= 2) { barrier(0x01); if (lo_id < s) { int value1 = E[lo_id], value2 = E[lo_id + s]; EP[lo_id] = value1 + value2; } } if (lo_id...
kernel void sswap_kernel(int n, global float* x, unsigned long x_offset, int incx, global float* y, unsigned long y_offset, int incy) { x += x_offset; y += y_offset; float tmp; int ind = get_local_id(0) + get_local_size(0) * get_group_id(0); if (ind < n) { x += ind * incx; y += ind * incy; tmp = ...
kernel void test_arg_3_1_kern(global int* a0, global int* a1, global int* a2, 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; b0[gtid] = (0 + 1) * (+tmp0 + tmp1 + tmp2); }
kernel void countNegativeElements(global const float* grid, global float* result, int const 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...
kernel void max_byte(global char* in, global char* out, unsigned int reduce_factor) { int x = get_global_id(0); int size0 = get_global_size(0); unsigned int begin = x; int i = 1; int tmp, max_val = in[begin]; do { begin += size0; tmp = in[begin]; max_val = tmp < max_val ? max_val : tmp; i++;...
kernel void compiler_long_cmp_g(global long* src1, global long* src2, global long* dst) { int i = get_global_id(0); dst[i] = (src1[i] > src2[i]) ? 3 : 4; }
kernel void dft(global const double2* in, global double2* out, int length, int sign) { int i = get_global_id(0); if (i >= length) return; double2 tot = 0; double param = (-2 * sign * i) * 3.14159265358979323846f / (double)length; for (int k = 0; k < length; k++) { double2 value = in[k]; double...
kernel void bitselect_ushort16ushort16ushort16(global ushort16* src_0, global ushort16* src_1, global ushort16* src_2, global ushort16* dst) { int gid = get_global_id(0); dst[gid] = bitselect(src_0[gid], src_1[gid], src_2[gid]); }
kernel void brahmaKernel(global int* buf) { buf[0] = 0; }
kernel void gegl_mono_mixer(global const float4* src_buf, global float2* dst_buf, float red, float green, float blue) { int gid = get_global_id(0); float4 in_v = src_buf[gid]; dst_buf[gid].x = in_v.x * red + in_v.y * green + in_v.z * blue; dst_buf[gid].y = in_v.w; }
kernel void es_phase_2(global unsigned int* restrict data, global unsigned int* restrict increments, unsigned int len) { local unsigned int tmp[2048]; unsigned int thread = get_local_id(0); unsigned int offset = 1; const unsigned int n = 2048; tmp[2 * thread] = (2 * thread < len) ? increments[2 * thread] : 0...
kernel void hadd_int16int16(global int16* src_0, global int16* src_1, global int16* dst) { int gid = get_global_id(0); dst[gid] = hadd(src_0[gid], src_1[gid]); }
kernel void test_fa1_3_4_kern(global float* a0, global float* a1, global float* a2, 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; float tmp1 = a1[gtid] + 1.1f; float tmp2 = a2[gtid] + 2.1f; b0[gtid] = (0.0f + 1.1f)...
kernel void timm_and_barth(int image_width, int image_height, int local_radius, global float* x_derivatives, global float* y_derivatives, global float* inverse_image, global float* output_image) { size_t gid = get_global_id(0); size_t numpixels = image_width * image_height; int center_x = ((gid) % image_height);...
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...
int colormap(const int maxIterations, int i) { if (i == maxIterations) return 0; else { i = i % 512; if (i > 255) return 511 - i; else return i; } } kernel void mandelGPU(global int* pixels, const int width, const int height, const float scale, const float offsetX, const float offsetY...
kernel void test_cl_finish(global int* src, global int* dst, int n, int num_threads) { int tid, pos; tid = get_global_id(0); for (pos = tid; pos < n; pos += num_threads) { dst[pos] = src[pos]; } }
kernel void add(global int* buffer1, global int* buffer2, global int* outputBuffer, int numElements) { int gid = get_global_id(0); if (gid < numElements) { outputBuffer[gid] = buffer1[gid] + buffer2[gid]; } }
kernel void multiplyInplace(const int N, const float multiplier, global float* data) { const int globalId = get_global_id(0); if (globalId >= N) { return; } data[globalId] *= multiplier; }
kernel void BK_update_beta(const int N, global const float* beta_d, global const float* B_d, global float* betaB_d) { unsigned int idx = get_global_id(0); if (idx < N) { betaB_d[idx] = B_d[idx] * beta_d[idx]; } }
kernel void gpu_csr_ve_slm_pm_fs(global int* rowptr, global int* colid, global float* data, global float* vec, global float* result, int row_num, int midrow, global int* rowinfo, int start) { int row = get_global_id(0); int getnumsum = get_global_size(0); int startRow = rowinfo[start]; int endRow = rowinfo[sta...
kernel void test_arg_2_7_kern(global int4* a0, global int4* a1, global int4* b0, global int4* b1, global int4* b2, global int4* b3, global int4* b4, global int4* b5, global int4* b6) { 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 + z...
kernel void vectorTotalByReduce(global double* input, global double* output, local double* sdata, int firstLocalZeroIndex) { unsigned int tid = get_local_id(0); unsigned int bid = get_group_id(0); unsigned int gid = get_global_id(0); unsigned int bnum = get_num_groups(0); unsigned int globalInputIndex = gid ...
kernel void mix_float2float2float2(global float2* src_0, global float2* src_1, global float2* src_2, global float2* dst) { int gid = get_global_id(0); dst[gid] = mix(src_0[gid], src_1[gid], src_2[gid]); }
kernel void Increment(global float4* inc, float num) { inc[get_global_id(0)].xyzw += num; }
kernel void mc_kernel_cubeindex(float isoval, int volnx, int volny, int volnz, global float4* mcgrid, global int* pointindex, global int* cubeindex) { size_t gid = get_global_id(0); if ((int)gid < volnx * volny * volnz) { int idx0 = pointindex[8 * gid + 0]; int idx1 = pointindex[8 * gid + 1]; int idx2 ...
kernel void test_arg_5_2_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* b0, global int* b1) { 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 = a4[gtid] + 4; ...
kernel void async_copy_unwaited(global int* data, local int* scratch) { event_t event = async_work_group_copy(scratch, data, get_local_size(0), 0); int i = get_local_id(0); data[get_local_size(0) - i - 1] = i; }
kernel void foo(global float* data, int N) { int tid = get_global_id(0); if (tid < N) { data[tid] += 3.0f; } }
float4 doSomeMore(float4 x) { char little = clamp(120, 0, 100); float deg = degrees(2.0f); int m = max(4, 5); m = min(4, 5); float blend = mix(1.7f, 2.5f, 0.5f); float rad = radians(deg); int s = sign(-5.0f); float4 v1; float4 v2; float4 c = cross(v1, v2); float d = dot(v1, v2); float dis = dist...
kernel void add_long16long16(global long16* src_0, global long16* src_1, global long16* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] + src_1[gid]; }
int compare(global const uchar* text, local const uchar* pattern, unsigned int length) { for (unsigned int l = 0; l < length; ++l) { if ((('A' <= (text[l]) && (text[l]) <= 'Z') ? ((text[l] - 'A') + 'a') : (text[l])) != pattern[l]) return 0; } return 1; } kernel void StringSearchLoadBalance(global uchar*...
kernel void test_arg_3_1_kern(global float4* a0, global float4* a1, global float4* a2, 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] + 1.1f + za; float4 tmp2 = a2[gtid] + 2.1f + za; b0[gt...
kernel void mult(global const float16* vec, global const float* fac, global float16* result, unsigned int size) { float factor = *fac; for (unsigned int i = get_global_id(0); i < size / 16; i += get_global_size(0)) result[i] = vec[i] * factor; }
kernel void ScanBlocksVec(global int8* buffer, global int* sums, local int* shared) { unsigned int globalId = get_global_id(0); unsigned int localId = get_local_id(0); unsigned int n = get_local_size(0) * 2; unsigned int offset = 1; int8 val1 = buffer[2 * globalId + 0]; int8 val2 = buffer[2 * globalId + 1...
kernel void localmem(global unsigned int* buffer, local unsigned int* localBuffer) { buffer[0] = 0xdeadbeef; }
enum { C_SVC = 0, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR }; enum { LINEAR = 0, POLY, RBF, SIGMOID, PRECOMPUTED }; enum { LOWER_BOUND = 0, UPPER_BOUND, FREE }; double my_dot(global const double* px, global const double* py, const int xW) { double sum = 0; int i = 0; while (i < xW - 1) { int remain = xW - i; ...
kernel void selectionSortLocal(global float* keys, global float* vals, const int count, local float* scratch) { int i = get_local_id(0); int numOfGroups = get_num_groups(0); int groupID = get_group_id(0); int wg = get_local_size(0); int n; int offset = groupID * wg; int same = 0; vals += offset; key...
kernel void test_fa1_3_3_kern(global float* a0, global float* a1, global float* a2, 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] + 2.1f; b0[gtid] = (0.0f + 1.1f) * (+tmp0 + tmp1 +...
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 avg_filter(global const int* A, global int* B) { int id = get_global_id(0); B[id] = (A[id - 1] + A[id] + A[id + 1]) / 3; }
kernel void sub(global float* out, float a, float b) { out[0] = a - b; }
kernel void nbody_sim(global float4* pos, global float4* vel, int numBodies, float deltaTime, float epsSqr, global float4* newPosition, global float4* newVelocity) { unsigned int gid = get_global_id(0); float4 myPos = pos[gid]; float4 acc = (float4)0.0f; int i = 0; for (; (i + 8) < numBodies;) { for (int...
kernel void vector_add(global const float* x, global const float* y, global float* restrict z) { int index = get_global_id(0); z[index] = x[index] + y[index]; }
kernel void dummy(global int* array) { double i = 42; double2 i2; }
kernel void svg_src_over(global const float4* in, global const float4* aux, global float4* out) { int gid = get_global_id(0); float4 in_v = in[gid]; float4 aux_v = aux[gid]; float4 out_v; out_v.xyz = aux_v.xyz + in_v.xyz * (1.0f - aux_v.w); out_v.w = aux_v.w + in_v.w - aux_v.w * in_v.w; out[gid] = out_v; ...
kernel void mutate(int pop_len, int num_cities, global int* x_coord, global int* y_coord, float prob_mutation, global const float* rnd_prob_mutation, global const int* rnd_mutate_loc) { int tid = get_global_id(0); if (tid < pop_len) { if (rnd_prob_mutation[tid] < prob_mutation) { int loc0 = rnd_mutate_lo...
kernel void ker_power_fwd(global float* out_data, const int count, const float scale, const float shift, const float power, global const float* in_data) { int global_idx = get_global_id(0); out_data[global_idx] = pow(in_data[global_idx] * scale + shift, power); }
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 dot_product(global const float4* a, global const float4* b, global float* c, global float4* d) { int gid = get_global_id(0); float4 prod = a[gid] * b[gid]; barrier(0x01); c[gid] = prod.x + prod.y + prod.z + prod.w; }
kernel void reduce_add_2(global const int* A, global int* B) { int id = get_global_id(0); int N = get_global_size(0); B[id] = A[id]; barrier(0x02); for (int i = 1; i < N; i *= 2) { if (!(id % (i * 2)) && ((id + i) < N)) B[id] += B[id + i]; barrier(0x02); } }
constant int data[4][17] = { { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, 0, 0, 0, ...
kernel void log2_f64(unsigned int length, global double* a, global double* out) { const unsigned int id = get_global_id(0); if (id < length) { out[id] = log2(a[id]); } }
kernel void decode_bbox_corner_size_no_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_classe...
kernel void so(global int* out) { int i = 0; out[i++] = sizeof(char); out[i++] = sizeof(uchar); out[i++] = sizeof(short); out[i++] = sizeof(ushort); out[i++] = sizeof(int); out[i++] = sizeof(unsigned int); out[i++] = sizeof(long); out[i++] = sizeof(ulong); out[i++] = sizeof(float); out[i++] = si...
kernel void gpu_csr_ve_slm_pm_fs(global int* rowptr, global int* colid, global float* data, global float* vec, global float* result, int row_num, global unsigned long* bitmap, global float* prold, global float* prnew, int midrow, global int* rowinfo, int start) { int r = get_global_id(0); int getnumsum = get_global...
kernel void test_logb(const global float* in, global float* out) { size_t gid = get_global_id(0); out[gid] = logb(in[gid]); }
struct kernel_args32 { unsigned int rgb; unsigned int mm; float ofs_lx; float ofs_rx; float ofs_ty; float ofs_by; float step_x; float step_y; float er; unsigned int max_iter; int pal; float c_x, c_y; int ofs_x, ofs_y; float c1[3], c2[3], c3[3], c4[3]; int mod1; int post_process; }; unsig...
kernel void setDoubleTest(int N, global double* deviceDouble) { int i = get_global_id(0); if (i < N) { deviceDouble[i] = 1.0 * i; } }
kernel void native_sqrt_float2(global float2* src_0, global float2* dst) { int gid = get_global_id(0); dst[gid] = native_sqrt(src_0[gid]); }
kernel void relational_less_than_longlong(global long* src_0, global long* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = (int)(src_0[gid] < src_1[gid]); }
kernel void perBlockScanByKey(global unsigned int* keys, global int* vals, int init, const unsigned int vecSize, local unsigned int* ldsKeys, local int* ldsVals, global unsigned int* keyBuffer, global int* valBuffer) { size_t gloId = get_global_id(0); size_t groId = get_group_id(0); size_t locId = get_local_id(0)...
kernel void test_arg_4_1_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, 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] + 1.1f + za; float4 tmp2 = a2[gtid] +...
kernel void binarySearch(global uint4* outputArray, const global uint2* sortedArray, const unsigned int findMe) { unsigned int tid = get_global_id(0); uint2 element = sortedArray[tid]; if ((element.x > findMe) || (element.y < findMe)) { return; } else { outputArray[0].x = tid; outputArray[0].w = 1...
kernel void Integer2_multiplication_10_10(global int2* dataArray, long iter, int interval) { global int2* curArray = dataArray + get_global_id(0) * interval; int2 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9; int2 addend; a0 = curArray[0]; a1 = curArray[1]; a2 = curArray[2]; a3 = curArray[3]; a4 = curArray[4]...
kernel void rotate_long2long2(global long2* src_0, global long2* src_1, global long2* dst) { int gid = get_global_id(0); dst[gid] = rotate(src_0[gid], src_1[gid]); }
kernel void compiler_workgroup_reduce_min_long(global long* src, global long* dst) { long val = src[get_global_id(0)]; long sum = work_group_reduce_min(val); dst[get_global_id(0)] = sum; }
inline float atomic_add_float(global float* const address, const float value) { unsigned int oldval, newval, readback; *(float*)&oldval = *address; *(float*)&newval = (*(float*)&oldval + value); while ((readback = atomic_cmpxchg((global unsigned int*)address, oldval, newval)) != oldval) { oldval = readback...
kernel void add(global short* out, short a, short b) { out[0] = a + b; }
kernel void rdwdot3_kernel(global const float* RKF, global const float* RKR, global float* WDOT, const float rateconv, global const float* molwt) { float ROP114 = ((RKF[(((114) - 1) * (4)) + (get_global_id(0))]) - (RKR[(((114) - 1) * (4)) + (get_global_id(0))])) - ((RKF[(((122) - 1) * (4)) + (get_global_id(0))]) - (R...
kernel void fft_mult_vec(global const float2* input1, global const float2* input2, global float2* output, unsigned int size) { for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) { float2 in1 = input1[i]; float2 in2 = input2[i]; output[i] = (float2)(in1.x * in2.x - in1.y * in2.y, i...
kernel void cl_alien_map(global const float4* in, global float4* out, float3 freq, float3 phaseshift, int3 keep) { int gid = get_global_id(0); float4 in_v = in[gid]; float3 unit = (float3)(1.0f, 1.0f, 1.0f); float3 tmp = 0.5f * (unit + sin((2.0f * in_v.xyz - unit) * freq.xyz + phaseshift.xyz)); float4 out_v; ...
kernel void rhadd_ushort2ushort2(global ushort2* src_0, global ushort2* src_1, global ushort2* dst) { int gid = get_global_id(0); dst[gid] = rhadd(src_0[gid], src_1[gid]); }
unsigned int __udivsi3(unsigned int a, unsigned int b) { unsigned q = 0, r = 0; r <<= 1; r += (a >> 31) & 1; q += r < b ? 0 : 1 << 31; r -= r < b ? 0 : b; r <<= 1; r += (a >> 30) & 1; q += r < b ? 0 : 1 << 30; r -= r < b ? 0 : b; r <<= 1; r += (a >> 29) & 1; q += r < b ? 0 : 1 << 29; r -= r ...
kernel void kernel_frexp_withoutDD1(global float* result_frexp, int N) { float t1 = 1.23; float t2 = 1.23; float t3 = 1.23; float t4 = 1.23; float t5 = 1.23; float t6 = 1.23; float t7 = 1.23; float t8 = 1.23; float t9 = 1.23; float t10 = 1.23; float i = 1.0; int iptr = 0; float n = 10 * (floa...
kernel void read_out_of_bounds(global int* a, global int* b, global int* c) { int i = get_global_id(0); if (i < 4) { c[i] = a[i] + b[i]; } else { c[i] = a[0] * (a[i] + b[i]); } }
kernel void mainKernel(global const float* a, const float b, const long num, global float* c) { int iGID = get_global_id(0); if (iGID < num) c[iGID] = a[iGID] + b; }
float2 mul_1(float2 a, float2 b) { float2 x; x.even = (a.even * b.even - a.odd * b.odd); x.odd = (a.even * b.odd + a.odd * b.even); return x; } float4 mul_2(float4 a, float4 b) { float4 x; x.even = (a.even * b.even - a.odd * b.odd); x.odd = (a.even * b.odd + a.odd * b.even); return x; } float4 dft2(f...
inline ulong ROTL641(const ulong x) { return (x << 1 | x >> 63); } inline ulong ROTL64_1(const ulong x, const unsigned int y) { return (x << y | x >> (64 - y)); } kernel void search(global const ulong* restrict in, global ulong* restrict output, global const ulong4* restrict sp, const unsigned int size, const ulong...
struct Domain { float2 offset; uint2 size; float dx; float pad; }; inline int2 getGridPos(float2 p, struct Domain domain) { float x = (p.x - domain.offset.x) / domain.dx; float y = (p.y - domain.offset.y) / domain.dx; return (int2)((int)x, (int)y); } inline unsigned int getGridHash(int2 pos, uint2 gridS...
kernel void xcorr_float_hard_float(global float* in1, global float* in2, global float* out) { int offset = get_global_id(0); int len = get_global_size(0); int i = 0; float res = 0; do { res += in1[i] * in2[i + offset]; i++; } while (i != len); out[offset] = res; }
kernel void ReLUBackward(global float* deltaXbatch, global float* deltaYbatch, global float* inputBatch, const int nTotActivations) { int i = get_global_id(0); if (i < nTotActivations) { if (inputBatch[i] < 0) deltaXbatch[i] = 0.0; else deltaXbatch[i] = deltaYbatch[i]; } }
kernel void kernel__ExclusivePrefixScan(global int* dataSet, local int* localBuffer, global int* blockSums, const unsigned int blockSumsSize) { const unsigned int gid = get_global_id(0); const unsigned int tid = get_local_id(0); const unsigned int bid = get_group_id(0); const unsigned int lwz = get_local_size(0...
kernel void ifill(global int4* a) { unsigned int i = get_global_id(0); a[i].x = 0; a[i].y = 1; a[i].z = 2; a[i].w = 3; }
kernel void NL_TANH_FWD(global float* X, global float* Y) { unsigned int element = get_global_id(0); Y[element] = tanh(X[element]); }
constant float GAMMA = 42.57748f; constant float TWOPI = 6.283185307179586476925286766559005768394338798750211641949889185f; void rotmn(const float* n, float* m, float* r) { float phi, hp, cp, sp, ar, ai, br, bi, arar, aiai, arai2, brbr, bibi, brbi2, arbi2, aibr2, arbr2, aibi2, brmbi, brpbi, armai, arpai, tmp[3]; ...
kernel void reduction_vector(global float4* data, local float4* partial_sums, global float* output) { int lid = get_local_id(0); int group_size = get_local_size(0); partial_sums[lid] = data[get_global_id(0)]; barrier(0x01); for (int i = group_size / 2; i > 0; i >>= 1) { if (lid < i) partial_sums[li...
kernel void batchNCC(global const uchar* patches, global const uchar* positiveSamples, global const uchar* negativeSamples, global float* posNcc, global float* negNcc, int posNum, int negNum, int patchNum) { int id = get_global_id(0); bool posFlg; if (id < 500 * patchNum) posFlg = true; if (id >= 500 * pat...
kernel void testkernel(global int* data) { data[get_global_id(0)] = 0x1; }
kernel void BasicFMAD(global float* accumulator, global float* varB, global float* varC) { unsigned int id = get_global_id(0); accumulator[id] = accumulator[id] + (varB[id] * varC[id]); }
kernel void bigDot(global float2* a, global float2* b, global float* out) { int id = get_global_id(0); out[id] = dot(a[id], b[id]); float sum = 0.0f; if (id == 0) { for (int i = 0; i < get_global_size(0); ++i) sum += out[i]; out[id] = sum; } }
kernel void barrier_divergence(global int* data) { int i = get_global_id(0); if (i != 0) { barrier(0x02); } data[i] = i; }
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 Mandelbrot(global unsigned char* output, const int w, const int h, const float cx, const float cy, const float unit) { int globalID = get_global_id(0); int ox = globalID % w; int oy = globalID / w; int ix = ox; int iy = h - 1 - oy; if (ix >= w || iy >= h) { return; } float fx = (float)(...
kernel void kExp2(global const float* inputMatrix, global float* resultMatrix) { int id = get_global_id(0); resultMatrix[id] = native_exp2(inputMatrix[id]); }
int compare(global const uchar* infected_str, local const uchar* symbol, unsigned int length) { for (unsigned int count_length = 0; count_length < length; ++count_length) { if (infected_str[count_length] != symbol[count_length]) return 0; } return 1; } kernel void actire_search(global uchar* node_symbo...
kernel void upsweep(global unsigned int* restrict data, global unsigned int* restrict part, global unsigned int* restrict flag, global unsigned int* restrict last_data, global unsigned int* restrict last_part, global unsigned int* restrict last_flag, local unsigned int* d, local unsigned int* p, unsigned int len) { c...
kernel void test_pown(const global float* in0, const global float* in1, global float* out) { size_t gid = get_global_id(0); out[gid] = pown(in0[gid], in1[gid]); }