kernel_code
stringlengths
49
1.22M
kernel void foo(global ushort4* a, global ushort4* b) { *a = popcount(*b); }
char bar(char a, char b) { return a + b; } kernel void foo(global char* in, global char* out, int idx) { char x = in[idx]; char y = in[idx + 1]; out[idx] = bar(x, y); }
kernel void test_atomic_min(global unsigned* ptr, unsigned val) { atomic_min(ptr, val); }
kernel void local_scan2(global unsigned int* block_sums, local unsigned int* scratch, const unsigned int block_size, const unsigned int count, const unsigned int init, global unsigned int* _buf0) { const unsigned int gid = get_global_id(0); const unsigned int lid = get_local_id(0); if (gid < count) { scratch[...
kernel void kern(global int* a, global int* b, global int* c, global int* result) { result[0] = mad24(a[0], b[0], c[0]); result[1] = mul24(a[1], b[1]); result[2] = clz(a[2]); result[3] = clamp(a[3], b[3], c[3]); result[4] = mad_hi(a[4], b[4], c[4]); result[5] = mad_sat(a[5], b[5], c[5]); result[6] = max(a...
kernel void copyBufferToBufferBytesSingle(global uchar* dst, const global uchar* src) { unsigned int gid = get_global_id(0); dst[gid] = (uchar)(src[gid]); }
kernel void clBlockPrefix(global uint4* blockScan, global unsigned int* blockSum, unsigned int size) { int globalId = get_global_id(0); int threadid = get_local_id(0); int blockid = get_group_id(0); local unsigned int prefixSum[256]; prefixSum[threadid] = blockSum[threadid]; barrier(0x01); if (threadid...
kernel void kernel_4(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float mA = 0; float mB = 0; for (unsigned int i = 0; i < count; i++) { mA += inputA[i]; mB += inputB[i]; } mA /= count; mB /= count; float numerator = 0; float denominator = 0; f...
kernel void hello_kernel(global char16* msg) { *msg = (char16)('H', 'e', 'l', 'l', 'o', ' ', 'k', 'e', 'r', 'n', 'e', 'l', '!', '!', '!', '\0'); }
kernel void camera_filter(global int* input_img, global int* out_img, int width, int height) { int offset, red, green, blue; int row = get_global_id(0) / width; int col = get_global_id(0) - row * width; int4 pixels[3], color_vec; int4 k0 = (int4)(-1, -1, 0, 0); int4 k1 = (int4)(-1, 0, 1, 0); int4 k2 = (i...
kernel void sum_hard_float(global float* in, global float* out, unsigned int reduce_factor) { int x = get_global_id(0); int size0 = get_global_size(0); unsigned int begin = x; int i = 0; float sum = 0; do { sum += in[begin]; i++; begin += size0; } while (i != reduce_factor); out[x] = sum; }
kernel void compiler_assignment_operation_in_if(global int* dst) { int gidx = (int)get_global_id(0); int3 d1 = (int3)(gidx, gidx - 1, gidx - 3); int k = gidx % 5; if (k == 1) { d1.x = d1.y; } global int* addr = dst + gidx; *addr = d1.x; }
kernel void kernel_rsqrt_withoutDD1(global float* result_rsqrt, int N) { float t1 = 1.1; float t2 = 1.1; float t3 = t1; float t4 = t3; float t5 = t4; float t6 = t5; float t7 = t6; float t8 = t7; float t9 = t8; float t10 = t9; float i = 0.01; for (i = 0.01; i <= 25.6 * N; i = i + 0.01) { t1...
kernel void rounding(global float4* round_input, global float4* round_output) { round_output[0] = rint(*round_input); round_output[1] = round(*round_input); round_output[2] = ceil(*round_input); round_output[3] = floor(*round_input); round_output[4] = trunc(*round_input); }
kernel void half_recip_float4(global float4* src_0, global float4* dst) { int gid = get_global_id(0); dst[gid] = half_recip(src_0[gid]); }
kernel void GEStep2(global float* AI, float diag, int i, int n2, int lda2) { int k = get_global_id(0); if (k < n2) { AI[i * lda2 + k] /= diag; } }
kernel void Softmax_fprop(int iLen, global const float* ia, global const float* w, global const float* b, global float* a) { int o = get_global_id(0); a[o] = 0; for (int i = 0; i < iLen; i++) a[o] += w[o * iLen + i] * ia[i]; a[o] += b[o]; }
kernel void TestMagic(const int total, const int is_deeper_magic, const float alpha_s, const float fore_th, global const float* gradx, global const float* grady, global float* BSx, global float* BSy, global int* mapRes) { private const size_t i = get_global_id(0); private const size_t gpu_used = get_global_size(0...
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 sumGlobalMemory(global const float* grid, global float* result, int const num_elements) { int global_id = get_global_id(0); int global_size = get_global_size(0); int work_per_thread = (num_elements / global_size) + 1; if (global_id >= num_elements) return; int offset = 0; offset = global_i...
kernel void native_rsqrt_float16(global float16* src_0, global float16* dst) { int gid = get_global_id(0); dst[gid] = native_rsqrt(src_0[gid]); }
kernel void test_fa1_2_3_kern(global float* a0, global float* a1, 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; barrier(0x01); b0[gtid] = (0.0f + 1.1f) * (+tmp0 + tmp1); b1[gtid] = (1.0f + 1.1f) * (+t...
void CalcPrefixSum(local int* field) { for (int d = 0; d < 8; d++) { int i = (1 << (d + 1)) - 1 + get_local_id(0) * (1 << (d + 1)); if (i < 256) { field[i] += field[i - (1 << d)]; } barrier(0x01); } if (get_local_id(0) == 0) field[256 - 1] = 0; barrier(0x01); for (int d = 8 - 1; ...
kernel void compiler_vect_compare(global int4* src, global int4* dst) { int4 test = (int4)(0, 0, 0, 0); dst[get_global_id(0)] = test < src[get_global_id(0)]; }
kernel void ScanLargeArrays(global float* output, global float* input, local float* block, const unsigned int block_size, const unsigned int length, global float* sumBuffer) { int tid = get_local_id(0); int gid = get_global_id(0); int bid = get_group_id(0); int offset = 1; block[2 * tid] = input[2 * gid]; ...
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 kRsqrt(global const float* inputMatrix, global float* resultMatrix) { int id = get_global_id(0); resultMatrix[id] = native_rsqrt(inputMatrix[id]); }
kernel void fill_in_values(global float* a, global float* b, int n) { int i = get_global_id(0); if (i >= n) return; a[i] = cos((float)i); b[i] = sin((float)i); }
kernel void CopyIRKernel16bitInter(const global unsigned int* IR_In, global float2* IR_Out, unsigned int Block_log2, unsigned int IR_In_sz) { unsigned int id = get_global_id(0); unsigned int glbl_sz = get_global_size(0); unsigned int id_rem = id - ((id >> Block_log2) << Block_log2); unsigned int id_out = ((id >...
kernel void kernel_cospi_withoutDD1(global float* result_cospi, 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 n = (float)(N); for (i = 0.0; i < n; i = i + 0.1) { t1 = cospi(i); t2 = cospi(i); t3 =...
kernel void vector_mult_opencl(global unsigned* val, unsigned offset, unsigned nx) { const int i = get_global_id(0); val = (global void*)val + offset; if (i < nx) { val[i] *= 2; } }
kernel void preinc(global short* out, short in) { out[0] = ++in; }
kernel void global_bandwidth_v2_local_offset(global float2* A, global float* B) { int id = (get_group_id(0) * get_local_size(0) * 16) + get_local_id(0); float2 sum = 0; sum += A[id]; id += get_local_size(0); sum += A[id]; id += get_local_size(0); ; sum += A[id]; id += get_local_size(0); sum += A[id...
kernel void taskParallelSub(global float* A, global float* B, global float* C) { int base = 1; C[base + 0] = A[base + 0] - B[base + 0]; C[base + 4] = A[base + 4] - B[base + 4]; C[base + 8] = A[base + 8] - B[base + 8]; C[base + 12] = A[base + 12] - B[base + 12]; }
kernel void fill(global int* a) { unsigned int i = get_global_id(0); a[i] = 1; }
kernel void cpu_csr(global int* rowptr, global int* colid, global float* data, global float* vec, global float* result, int midrow, int rownum) { int r = get_global_id(0); int getnumsum = get_global_size(0); r += midrow; for (; r < rownum; r += getnumsum) { int row = r; float sum = result[row]; int...
inline void AtomicAdd(volatile global float* source, const float operand) { union { unsigned int intVal; float floatVal; } newVal; union { unsigned int intVal; float floatVal; } prevVal; prevVal.floatVal = *source; while (true) { newVal.floatVal = prevVal.floatVal + operand; newVal...
kernel void abs_diff_int8int8(global int8* src_0, global int8* src_1, global uint8* dst) { int gid = get_global_id(0); dst[gid] = (uint8)(abs_diff(src_0[gid], src_1[gid])); }
kernel void kernel__UniformAdd(global int* output, global const int* blockSums, const unsigned int outputSize) { unsigned int gid = get_global_id(0) * 2; const unsigned int tid = get_local_id(0); const unsigned int blockId = get_group_id(0); local int localBuffer[1]; if (tid < 1) localBuffer[0] = blockS...
struct GridParams { float4 grid_size; float4 grid_min; float4 grid_max; float4 bnd_min; float4 bnd_max; float4 grid_res; float4 grid_delta; int nb_cells; }; kernel void gravity(int numPart, int numPoint, global float4* pointSources, global float* massSources, global float* alpha, global float4* pos, ...
double dev_round_double(double value) { int newValue = (int)(value); if (value - newValue < .5f) return newValue; else return newValue++; } double calcLikelihoodSum(global unsigned char* I, global int* ind, int numOnes, int index) { double likelihoodSum = 0.0; int x; for (x = 0; x < numOnes; x++) ...
kernel void test_fa1_5_4_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* a4, 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...
kernel void evaluate_path_ocl(global float* prior_cost, global float* local_cost, float path_intensity_gradient, global float* curr_cost, int width, int height, int disp_range, int d, float PENALTY1, float PENALTY2) { float min_int = 0x1.fffffep127f; float e_smooth = 0x1.fffffep127f; for (int d_p = 0; d_p < disp...
kernel void vec_add(global int* out, global const int* in1, global const int* in2) { int i = get_global_id(0); out[i] = in1[i] + in2[i]; }
kernel void kernel_0(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float result; for (int i = 0; i < count; i++) { result += log(1.0f + fabs(inputA[i] - inputB[i])); } output[0] = result; }
kernel void lazy_segmented_scan(global unsigned int* restrict heads, global unsigned int* restrict data) { unsigned int idx = get_global_id(0); unsigned int maximum = get_global_size(0); if (heads[idx] != 0) { unsigned int val = data[idx]; unsigned int curr = idx + 1; while (heads[curr] == 0 && curr <...
kernel void cl_memset(global float* target, const float value, const int N) { if ((int)get_global_id(0) < N) { target[get_global_id(0)] = value; } }
kernel void Integer_addition_13_no(global int* dataArray, long iter, int interval) { global int* curArray = dataArray + get_global_id(0) * interval; int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12; int addend; a0 = curArray[0]; a1 = curArray[1]; a2 = curArray[2]; a3 = curArray[3]; a4 = curArra...
kernel void TestUnaligned(global float* input, global float* output) { int i = get_global_id(0); output[i] = (i >= get_global_size(0) - 1) ? 0.f : input[i + 1]; }
kernel void pown_floatint(global float* src_0, global int* src_1, global float* dst) { int gid = get_global_id(0); dst[gid] = pown(src_0[gid], src_1[gid]); }
kernel void mad_sat_char8char8char8(global char8* src_0, global char8* src_1, global char8* src_2, global char8* dst) { int gid = get_global_id(0); dst[gid] = mad_sat(src_0[gid], src_1[gid], src_2[gid]); }
kernel void testWorkGroupScanInclusiveUMax(unsigned int a, global unsigned int* res) { res[0] = work_group_scan_inclusive_max(a); }
struct GridParams { float4 grid_size; float4 grid_min; float4 grid_max; float4 bnd_min; float4 bnd_max; float4 grid_res; float4 grid_delta; int nb_cells; }; kernel void lifetime(int num, float increment, global float4* pos_u, global float4* color_u, global float4* color_s, global unsigned int* sort_i...
kernel void test(global float* in, global float* out, global float* inout) { const int globalid = get_global_id(0); inout[globalid] = inout[globalid] + 7; out[globalid] = in[globalid] + 5; if (globalid == 2) { out[globalid] = 26; inout[globalid] = 34; } }
kernel void test_arg_7_2_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, global float4* a4, global float4* a5, global float4* a6, global float4* b0, global float4* b1) { float4 za = (float4)(0.75f, 0.5f, 0.25f, 0.33f); unsigned int gtid = get_global_id(0); float4 tmp0 = a0[gtid] +...
kernel void compiler_clz_uchar(global uchar* src, global uchar* dst) { global uchar* A = &src[get_global_id(0)]; global uchar* B = &dst[get_global_id(0)]; *B = clz(*A); }
kernel void vec_add_byte_improved(global char4* in1, global char4* in2, global char4* out) { int index = get_global_id(0); out[index] = in1[index] + in2[index]; }
kernel void mult_elementwise_d2c(global double* x, global double2* z, unsigned int arr_size) { unsigned int i_cell = (unsigned int)get_global_id(0); if (i_cell < arr_size) { z[i_cell].s0 = x[i_cell] * z[i_cell].s0; z[i_cell].s1 = x[i_cell] * z[i_cell].s1; } }
kernel void xcorr_byte_improved(global char4* in1, global char4* in2, global char4* out) { int offset = get_global_id(0); int len = get_global_size(0); int res1 = 0, res2 = 0, res3 = 0, res4 = 0, i = 0; do { res1 += in1[i].x * in2[i + offset].x; res1 += in1[i].y * in2[i + offset].y; res1 += in1[i].z...
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; kernel void builtin_convert_uint_to_ushort_sat(global unsigned int* src, global ushort* dst) { int i = get_global_id(0); dst[i] = convert_ushort_sat(src[i]); }
kernel void kernel_hooking_cpu(global int* d_parents, global int* d_shadow, global char* d_mask, global int* d_edge_src, global char* d_over, int iter, int edge_cnt, global int* rowptr, global int* colid, int vertex_cnt, global int* rowall, int rowallsize) { int t = get_global_id(0); int getnumsum = get_global_size...
kernel void test_ulong2(global ulong* pin, global ulong* pout) { int x = get_global_id(0); ulong2 value; value = vload2(x, pin); value += (ulong2){(ulong)1, (ulong)2}; vstore2(value, x, pout); }
kernel void cpu_csr(global int* rowptr, global int* colid, global float* data, global float* vec, global float* result, int rowtotal, global int* rowall, int rowallsize, int midrow, int rownum, global int* rowinfo, int start) { int r = get_global_id(0); int getnumsum = get_global_size(0); int startRow = rowinfo[...
kernel void vector_add(global unsigned int* a, global unsigned int* b, global unsigned int* out) { unsigned int a_local[2048] __attribute((xcl_array_partition(cyclic, 128, 1))); unsigned int b_local[2048] __attribute((xcl_array_partition(cyclic, 128, 1))); unsigned int out_local[2048] __attribute((xcl_array_parti...
kernel void abs_diff_ucharuchar(global uchar* src_0, global uchar* src_1, global uchar* dst) { int gid = get_global_id(0); dst[gid] = abs_diff(src_0[gid], src_1[gid]); }
kernel void noise(global const unsigned int* M_g, global const unsigned int* P1_g, global const unsigned int* P2_g, global const ushort2* PTS_g, global const unsigned int* IDS_g, global const unsigned int* NOISE_g, global unsigned int* M_o, global unsigned int* P1_o, global unsigned int* P2_o, int X_size, int Y_size) {...
kernel void update_xr(global float* r_dot_r, global float* p_dot_mat_p, global float* p, global float* mat_p, global float* x, global float* r) { int id = get_global_id(0); float alpha = r_dot_r[0] / *p_dot_mat_p; x[id] += alpha * p[id]; r[id] -= alpha * mat_p[id]; }
kernel void extractSlice(const global float* gInput, global float* gOutput, int origin0, int origin1, int origin2, int oshape0, int oshape1, int oshape2, int ishape0, int ishape1, int ishape2) { int g0 = origin0 + (int)get_global_id(0) % oshape0; int g1 = origin1 + (int)(get_global_id(0) / oshape0) % oshape1; int...
kernel void square_cpy(global float* input, global float* output, unsigned int count) { unsigned int i = get_global_id(0); if (i < count) output[i] = input[i] * input[i]; }
kernel void test_uint(global unsigned int* C, global unsigned int* A, global unsigned int* B) { int id = get_global_id(0); C[id] = add_sat(A[id], B[id]); }
kernel void abs_diff_ulong4ulong4(global ulong4* src_0, global ulong4* src_1, global ulong4* dst) { int gid = get_global_id(0); dst[gid] = abs_diff(src_0[gid], src_1[gid]); }
kernel void compiler_long_2(global long* src1, global long* src2, global long* dst) { int i = get_global_id(0); switch (i) { case 0: dst[i] = 0xFEDCBA9876543210UL; break; case 1: dst[i] = src1[i] & src2[i]; break; case 2: dst[i] = src1[i] | src2[i]; break; case 3:...
kernel void mad_hi_longlonglong(global long* src_0, global long* src_1, global long* src_2, global long* dst) { int gid = get_global_id(0); dst[gid] = mad_hi(src_0[gid], src_1[gid], src_2[gid]); }
kernel void max_byte_improved_atomic(global char4* in, global char* out, unsigned int reduce_factor) { int x = get_global_id(0); int size0 = get_global_size(0); unsigned int begin = x; char4 tmp = in[begin]; int max_val = tmp.x; max_val = tmp.y < max_val ? max_val : tmp.y; max_val = tmp.z < max_val ? max_...
int g(global int* m, private int k) { return ((k + m[0]) + m[1]); } int z(private int a, global int* m, private int t) { return ((m[2] + a) - t); } int y(global int* m, private int l, private int n, private int a) { int x0 = ((5 - n) + g(m, 4)); return z(a, m, ((a + x0) + l)); } int x(global int* m, private int...
kernel void save_prev_bodies(const global float4* v_bodies, int upd_offset, global float4* v_prev_bodies) { int idx = get_global_id(0) + upd_offset; v_prev_bodies[idx] = v_bodies[idx]; }
kernel void clCode(global const int* in, global int* sum) { size_t i = get_global_id(0); atomic_add(sum, in[i]); }
kernel void compiler_stepf_float3(float edge, global float3* x, global float3* dst) { int i = get_global_id(0); dst[i] = step(edge, x[i]); }
float sum(global float* arr, int start, int length) { float result = 0; for (int i = start; i < start + length; i++) { result += arr[i]; } return result; } float max_arr(global float* arr, int start, int length) { float result = arr[start]; for (int i = start + 1; i < start + length; i++) { result ...
kernel void find_if(global int* index, global unsigned int* _buf0) { const unsigned int i = get_global_id(0); const unsigned int value = _buf0[i]; if (value == (1u)) { atomic_min(index, i); } }
void bar(global int* x, int y) { *x = y; } kernel void foo(global int* x, global int* y, int c) { int z = x[0]; barrier(0x02); global int* ptr = c ? x : y; bar(ptr + 1, z); }
kernel void difference_three_d(global double* output, global const double* x, global const double* y, const unsigned int size) { unsigned int tid = get_global_id(0); if (tid < size) output[tid] = x[tid] - y[tid]; }
int volume_coords(int3 coords, int3 size) { return coords.x + coords.y * size.x + coords.z * size.x * size.y; } int3 volume_position(int index, int3 size) { return (int3)(index % size.x, (index / (size.x)) % size.y, index / (size.x * size.y)); } float smoothstepmap(float val) { return val * val * (3 - 2 * val);...
kernel void initializeBuffers(global int* maskArray, global float* costArray, global float* updatingCostArray, int sourceVertex, int vertexCount) { int tid = get_global_id(0); if (sourceVertex == tid) { maskArray[tid] = 1; costArray[tid] = 0.0; updatingCostArray[tid] = 0.0; } else { maskArray[tid...
kernel void kernel_levels(global const float4* in, global float4* out, float in_offset, float out_offset, float scale) { int gid = get_global_id(0); float4 in_v = in[gid]; float4 out_v; out_v.xyz = (in_v.xyz - in_offset) * scale + out_offset; out_v.w = in_v.w; out[gid] = out_v; }
inline int get_index(int nelems, int index) { if (index == -1) { index = get_global_id(0); } else { index += get_global_size(0); } if (index >= nelems) index = -1; return index; } kernel void exponential(global float* out, global const float* x, int N) { int id = get_index(N, -1); while (id...
float Iq(float q, float length); float Iq(float q, float length) { float numerator = pow(length, 3); float denominator = pow(1 + pow(q * length, 2), 2); return numerator / denominator; } float Iqxy(float qx, float qy, float length); float Iqxy(float qx, float qy, float length) { return Iq(sqrt(qx * qx + qy * ...
kernel void subsetSumNaiveKernel(unsigned int n, const global long* gSumChanges, const global long* inputSums, global unsigned int* foundIndicesNumBuf, global unsigned int* foundIndices) { local long sumChanges[41]; unsigned int gi = get_global_id(0); unsigned int li = get_local_id(0); const unsigned int grpSi...
kernel void nbody_kern(int n, float dt, float eps, global float4* pp, global float4* vv, global float4* ppo) { const float4 zero4 = (float4)(0.0f, 0.0f, 0.0f, 0.0f); const float4 invtwo4 = (float4)(0.5f, 0.5f, 0.5f, 0.5f); const float4 dt4 = (float4)(dt, dt, dt, 0.0f); int gti = 2 * get_global_id(0); int ti...
kernel void g0(global unsigned int dest[], global const unsigned int src[]) { dest[0] = src[0]; }
kernel void mataccKernel3(global float* mA, global float* mC, const unsigned int mWidth) { unsigned int g_id = get_group_id(0); unsigned int nunits = get_num_groups(0); const unsigned int bWidth = 64; const unsigned int size_t = 4096; unsigned int bs = mWidth / bWidth; float elt = 0.0; for (unsigned int b...
kernel void kernel_floor_withoutDD1(global float* result_floor, int n) { float p1 = 5.64; float p2 = 45.64; float p3 = 5.64; float p4 = 5.64; float p5 = 5.64; float p6 = 5.64; float p7 = 5.64; float p8 = 5.64; float p9 = 5.64; float p10 = 5.64; float p11 = 5.64; float p12 = 45.64; float p13 = ...
kernel void nn_add_local(global int* in, global int* out, local int* data) { int gX = get_global_id(0); int lX = get_local_id(0); int m = get_local_size(0); data[lX] = in[gX]; if (lX == m - 1) data[m] = select(in[gX + 1], 0, gX == get_global_size(0) - 1); barrier(0x01); out[gX] = data[lX] + data[lX ...
kernel void alloc(global double* a, global double* b, double alpha, double beta) { unsigned long i = get_global_id(0); a[i] = alpha; if (beta != 0.0) { b[i] = beta; } }
kernel void test_arg_1_4_kern(global float4* a0, 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] + 0.1f + za; b0[gtid] = (0.0f + 1.1f) * (+tmp0); b1[gtid] = (1.0f + 1.1f)...
kernel void set_array_double(global double* src, double val) { int gid = get_global_id(0); src[gid] = val; }
kernel void array(global long16* output) { long16 data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; int i = get_global_id(0); long16* foo = data; output[i] = foo[i]; }
kernel void remainder_ushort16ushort16(global ushort16* src_0, global ushort16* src_1, global ushort16* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] % src_1[gid]; }
kernel void test_vector_creation8(global uchar* src, global uchar8* result) { result[0] = (uchar8)(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7]); result[1] = (uchar8)(src[0], src[1], src[2], src[3], src[4], src[5], vload2(0, src + 6)); result[2] = (uchar8)(src[0], src[1], src[2], src[3], src[4],...
kernel void square_f64(unsigned int length, global double* a, global double* out) { const unsigned int id = get_global_id(0); if (id < length) { const double aVal = a[id]; out[id] = aVal * aVal; } }