kernel_code
stringlengths
49
1.22M
kernel void test_stress(global const int* in, global int* out) { const int globalid = get_global_id(0); int sum = 0; int n = 0; while (n < 10001) { sum = (sum + in[n % 47]) % (103070 * 7); n++; } out[globalid] = sum; }
kernel void testUMod(uint2 a, uint2 b, global uint2* res) { res[0] = a % b; }
kernel void kernel_asinh_withoutDD1(global float* result_asinh, int N) { float t1 = 1.0; float t2 = 1.0; float t3 = 1.0; float t4 = 1.0; float t5 = 1.0; float t6 = 1.0; float t7 = 1.0; float t8 = 1.0; float t9 = 1.0; float t10 = 1.0; float i = 0.0; float n = (float)(N); for (i = 0.0; i < n; ...
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 compute_integer_v8(global int* ptr, int _A) { int8 x = (int8)(_A, (_A + 1), (_A + 2), (_A + 3), (_A + 4), (_A + 5), (_A + 6), (_A + 7)); int8 y = (int8)get_local_id(0); x = (y * x) + y; y = (x * y) + x; x = (y * x) + y; y = (x * y) + x; ; x = (y * x) + y; y = (x * y) + x; x = (y * x) + ...
kernel void mad_sat_ulong8ulong8ulong8(global ulong8* src_0, global ulong8* src_1, global ulong8* src_2, global ulong8* dst) { int gid = get_global_id(0); dst[gid] = mad_sat(src_0[gid], src_1[gid], src_2[gid]); }
kernel void bsort_stage_0_manning(global uint4* g_data, local uint4* l_data, unsigned int high_stage) { int dir; unsigned int id, global_start, stride; uint4 input1, input2, temp; int4 comp; uint4 mask1 = (uint4)(1, 0, 3, 2); uint4 mask2 = (uint4)(2, 3, 0, 1); uint4 mask3 = (uint4)(3, 2, 1, 0); int4 a...
kernel void add_sat_uchar4uchar4(global uchar4* src_0, global uchar4* src_1, global uchar4* dst) { int gid = get_global_id(0); dst[gid] = add_sat(src_0[gid], src_1[gid]); }
kernel void rhadd_long16long16(global long16* src_0, global long16* src_1, global long16* dst) { int gid = get_global_id(0); dst[gid] = rhadd(src_0[gid], src_1[gid]); }
kernel void kernelUChar(global uchar* input, global uchar* output, unsigned int count) { unsigned int i = get_global_id(0); if (i < count) output[i] = input[i]; }
constant unsigned int_constant[] = {0x42, 0x17, 0x12345678, 0x12348765, 0x87654321, 0x13245678, 0x98765432, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16}; constant unsigned short short_constant[] = {0x42, 0x17, 0x5678, 0x8765, 0x4321, 0x5678, 0x9432, 0x1, 0x2, 0x3, 0x4, 0x5, 0x...
kernel void kernel_log_withDD1(global float* result_log, int N) { float t1 = 9999.999; int i = 0; for (i = 0; i < N; i++) { t1 = log((t1 + 0.1) / t1); t1 = log((t1 + 0.1) / t1); t1 = log((t1 + 0.1) / t1); t1 = log((t1 + 0.1) / t1); t1 = log((t1 + 0.1) / t1); t1 = log((t1 + 0.1) / t1); ...
kernel void test_fast_distance(const global float* x, const global float* y, global float* out) { unsigned int gid = get_global_id(0); vstore3(fast_distance(vload3(gid, x), vload3(gid, y)), gid, out); }
kernel void add_short2short2(global short2* src_0, global short2* src_1, global short2* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] + src_1[gid]; }
kernel void subtract(global float* a, global float* b, global float* c) { *c = *a - *b; }
kernel void maxThreshold(global float* ioim, float threshold) { const int index = get_global_id(0); if (isnan(ioim[index]) || ioim[index] < threshold) return; ioim[index] = __builtin_astype((2147483647), float); }
kernel void caldistance(int rowtotal, global float* prold, global float* prnew, global float* distance) { distance[0] = 0; for (int i = 0; i < rowtotal; i++) { (distance[0]) += (prnew[i] - prold[i]) * (prnew[i] - prold[i]); } }
float4 matmul(float4 m[], float4 v) { return m[0] * v.s0 + m[1] * v.s1 + m[2] * v.s2 + m[3] * v.s3; } void transpose(float4 m[], float4 t[]) { t[0].s0 = m[0].s0; t[0].s1 = m[1].s0; t[0].s2 = m[2].s0; t[0].s3 = m[3].s0; t[1].s0 = m[0].s1; t[1].s1 = m[1].s1; t[1].s2 = m[2].s1; t[1].s3 = m[3].s1; t[2]...
kernel void test_arg_3_3_kern(global int4* a0, global int4* a1, global int4* a2, 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 + za; int4 tmp2 = a2[gtid] + 2 + za; b0[gtid] = (0...
kernel void test_ushort3(global ushort* pin, global ushort* pout) { int x = get_global_id(0); ushort3 value; value = vload3(x, pin); value += (ushort3){(ushort)1, (ushort)2, (ushort)3}; vstore3(value, x, pout); }
kernel void poly_mult_naive(global float* a, global float* b, global float* output, int n) { size_t i = get_global_id(0); if (i >= 2 * n - 1) { return; } int _min = i; if (n - 1 < _min) { _min = n - 1; } output[i] = 0; for (int x = 0; x <= _min; ++x) { int y = i - x; if (y < n) { o...
kernel void equal_float16float16(global float16* src_0, global float16* src_1, global int16* dst) { int gid = get_global_id(0); dst[gid] = (int16)(src_0[gid] == src_1[gid]); }
uint2 ROTL64_1(const uint2 x, const unsigned int y) { return (uint2)((x.x << y) ^ (x.y >> (32 - y)), (x.y << y) ^ (x.x >> (32 - y))); } uint2 ROTL64_2(const uint2 x, const unsigned int y) { return (uint2)((x.y << y) ^ (x.x >> (32 - y)), (x.x << y) ^ (x.y >> (32 - y))); } ulong ROTL641(const ulong x) { return (x <...
kernel void prefix_sum_stride(global int* counts, global unsigned long* prefix_sum, const int stride) { int thread_idx = get_global_id(0); int n = get_global_size(0); unsigned long my_sum = prefix_sum[thread_idx]; unsigned long neighbors_sum = prefix_sum[thread_idx - stride]; barrier(0x02); if (thread_idx >...
kernel void prefixSumStep(int iteration, global int* in, global int* out) { size_t i = get_global_id(0); int j = (int)exp2((float)iteration); if (i >= j) out[i] = in[i] + in[i - j]; else out[i] = in[i]; }
float concat1Jaccard(global unsigned int* a, global unsigned int* b, global unsigned int* c, global unsigned int* d) { float jacc = 0.0; int A_union_C = 0; int B_union_D = 0; int A_and_not_C = 0; int D_and_not_B = 0; int C_and_not_A = 0; int B_and_not_D = 0; int A_intersect_C = 0; int B_intersect_D ...
kernel void vecAdd(global float* a, global float* b, global float* c, const unsigned int n) { int id = get_global_id(0); if (id < n) c[id] = a[id] + b[id]; }
kernel void infiniteFocus(global uchar* input, global uchar* output, global uchar* depth, unsigned int currentBucket) { int gid = get_global_id(0); if (depth[gid] == (currentBucket + 1)) { output[gid] = input[gid]; } }
kernel void nullify(global unsigned int* const buf, const unsigned int n) { const size_t gid = get_global_id(0); if (gid < n) buf[gid] = 0; }
kernel void test_kernel(char4 c, uchar4 uc, short4 s, ushort4 us, int4 i, uint4 ui, float4 f, global float4* result) { result[0] = convert_float4(c); result[1] = convert_float4(uc); result[2] = convert_float4(s); result[3] = convert_float4(us); result[4] = convert_float4(i); result[5] = convert_float4(ui); ...
kernel void compiler_workgroup_scan_exclusive_max_int(global int* src, global int* dst) { int val = src[get_global_id(0)]; int sum = work_group_scan_exclusive_max(val); dst[get_global_id(0)] = sum; }
kernel void clamp_float4float4float4(global float4* src_0, global float4* src_1, global float4* src_2, global float4* dst) { int gid = get_global_id(0); dst[gid] = clamp(src_0[gid], src_1[gid], src_2[gid]); }
kernel void transform_if_write_counts(global unsigned int* _buf0, global int* _buf1) { _buf0[get_global_id(0)] = !(_buf1[get_global_id(0)] == 4) ? 1 : 0; }
kernel void select_parents(int pop_size, global float* fit_prob, global float* rand_nums, global int* sel_ix) { int tid = get_global_id(0); if (tid < (2 * pop_size)) { for (int i = 0; i < pop_size; i++) { if (rand_nums[tid] < fit_prob[i]) { sel_ix[tid] = i; break; } } } }
kernel void test_arg_6_1_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* a4, global int4* a5, global int4* b0) { 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 + za; int4 tmp2 = a2[gtid] + 2 + za...
inline unsigned int SWAP32(unsigned int x) { return bitselect(rotate(x, 24U), rotate(x, 8U), 0x00FF00FFU); } inline void sha1_mblock(unsigned int* Win, unsigned int* out, unsigned int blocks) { unsigned int W[16], output[5]; unsigned int A, B, C, D, E, temp; for (temp = 0; temp < 5; temp++) output[temp] = ...
typedef float float4 __attribute__((ext_vector_type(4))); kernel void k_gen_4_4_cl_gemm_v3_(global float4* restrict Z, const global float4* restrict X, const global float4* restrict Y) { float4 x[4]; float4 y[4]; float4 z[4]; x[0] = X[0]; x[1] = X[1]; x[2] = X[2]; x[3] = X[3]; y[0] = Y[0]; y[1] = Y[...
kernel void bench_math_log2(global float* src, global float* dst, float pwr, unsigned int loop) { float result = src[get_global_id(0)]; for (; loop > 0; loop--) { result = log2((float)0x1.1p0 - result * 0.0001f); } dst[get_global_id(0)] = result; }
kernel void fadd(global float* A, global float* B, global float* C) { int gid = get_global_id(0); C[gid] = A[gid] + B[gid]; }
kernel void set_teaching_input(global const float* output, global float* values, global char* enabled, global const float* rewards, global const int* actions, global const char* isTerminalStates, unsigned int size, unsigned int index, float discountFactor) { int inputIndex = actions[index]; for (unsigned int i = ge...
kernel void abs_uint2(global uint2* src_0, global uint2* dst) { int gid = get_global_id(0); dst[gid] = abs(src_0[gid]); }
kernel void fullCopy(global const unsigned int* src, global unsigned int* dst) { unsigned int gid = get_global_id(0); uint4 loaded = vload4(gid, src); vstore4(loaded, gid, dst); }
kernel void copy_16_bytes(global float4* const restrict to, global const float4* const restrict from) { if (get_global_id(0) == 0) { to[0] = from[0]; } }
kernel void bluestein_post(global float2* Z, global float2* out, unsigned int size) { unsigned int glb_id = get_global_id(0); unsigned int glb_sz = get_global_size(0); unsigned int double_size = size << 1; float sn_a, cs_a; const float NUM_PI = 3.14159265358979323846; for (unsigned int i = glb_id; i < siz...
inline double logFactorial(int n) { if (n != 0) { return (0.5 * log(6.283185 * n) + n * log(1.0 * n) - n); } return (0); } inline double logChoose(int n, int x) { if ((x != 0) && (n != 0)) { return (logFactorial(n) - logFactorial(x) - logFactorial(n - x)); } return (0.0); } inline double dbinom(in...
kernel void vecAddMany(global int* A, global int* B, global int* C) { int tid = get_global_id(0); for (int i = 0; i < 1024; i++) C[tid] += A[tid] + B[tid]; }
inline void order(unsigned int* x, unsigned int a, unsigned int b, bool asc) { if (asc ^ (x[a] < x[b])) { unsigned int auxa = x[a]; unsigned int auxb = x[b]; x[a] = auxb; x[b] = auxa; } } inline void merge2(unsigned int* x, bool asc) { for (int j = 0; j < 1; j++) order(x, j, j + 1, asc); ; ...
kernel void async_copy_global_race(global int* data, local int* scratch) { int i = get_local_id(0); scratch[i] = i; barrier(0x01); data[i] = 0; event_t event = async_work_group_copy(data, scratch, get_local_size(0), 0); wait_group_events(1, &event); }
kernel void unary_plus_int2(global int2* src_0, global int2* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void nt_crypt(const global unsigned int* keys, global unsigned int* output) { unsigned int i = get_global_id(0); unsigned int nt_buffer[12]; unsigned int nt_index = 0; unsigned int md4_size = 0; unsigned int num_keys = get_global_size(0); unsigned int key_chars = keys[i]; unsigned int cache_key ...
kernel void ratx2_kernel(global const float* C, global float* RF) { (RF[(((1) - 1) * (4)) + (get_global_id(0))]) = (RF[(((1) - 1) * (4)) + (get_global_id(0))]) * (C[(((2) - 1) * (4)) + (get_global_id(0))]) * (C[(((4) - 1) * (4)) + (get_global_id(0))]); (RF[(((2) - 1) * (4)) + (get_global_id(0))]) = (RF[(((2) - 1) *...
float linear_to_gamma_2_2(float value) { if (value > 0.003130804954f) return 1.055f * native_powr(value, (1.0f / 2.4f)) - 0.055f; return 12.92f * value; } float gamma_2_2_to_linear(float value) { if (value > 0.04045f) return native_powr((value + 0.055f) / 1.055f, 2.4f); return value / 12.92f; } kernel...
kernel void kernelUInt(global unsigned int* input, global unsigned int* output, unsigned int count) { unsigned int i = get_global_id(0); if (i < count) output[i] = input[i]; }
kernel void kern(global float* a, global float* b, global float* c, global float* result) { result[0] = rsqrt(a[0]); result[1] = sin(a[1]); result[2] = sinh(a[2]); result[3] = sinpi(a[3]); result[4] = sqrt(a[4]); result[5] = tan(a[5]); result[6] = tanh(a[6]); result[7] = tanpi(a[7]); result[8] = tgamm...
kernel void mainKernel(global const int* a, const long num, global int* c) { unsigned long iGID = get_global_id(0) * 4; c[iGID] = a[iGID]; c[iGID + 1] = a[iGID + 1]; c[iGID + 2] = a[iGID + 2]; c[iGID + 3] = a[iGID + 3]; }
kernel void increment(global int* a, global int* b, int by, unsigned int length) { int i = get_global_id(0); if (i < length) b[i] = a[i] + by; }
kernel void Stpmv_naive(int uplo, int trans, int diag, int n, global float* AP, global float* x, int incx, global float* parties) { bool isUp = (uplo == 0); bool isDiag = (diag == 1); bool isNTrans = (trans == 0); if (isUp && isNTrans) { int kk = 0; for (int i = 0; i < n; i++) { int k = kk + i +...
float sfrand_0_1(unsigned int* seed); float sfrand_m1_1(unsigned int* seed); float sfrand_0_1(unsigned int* seed) { float res; *seed = mul24(*seed, 16807u); *((unsigned int*)&res) = ((*seed) >> 9) | 0x3F800000; return (res - 1.0f); } float sfrand_m1_1(unsigned int* seed) { float res; *seed = mul24(*seed, 1...
inline float sfrand_0_1(unsigned int* seed); inline float sfrand_m1_1(unsigned int* seed); inline float sfrand_0_1(unsigned int* seed) { float res; *seed = mul24(*seed, 16807u); *((unsigned int*)&res) = ((*seed) >> 9) | 0x3F800000; return (res - 1.0f); } inline float sfrand_m1_1(unsigned int* seed) { float r...
constant float beta = 0.66666f; kernel void adjust_weights_quickprop(global const float* direction, global const float* prev_direction, float n, float alpha, global float* old_delta, global float* weights) { int gid = get_global_id(0); float new_delta; if (fabs(old_delta[gid]) > 1e-8) new_delta = min(direct...
kernel void vector_add(global const float* A, global float* B, global float* C) { int i = get_global_id(0); for (i = 0; i < 4; i++) { B[i] = C[i] = 0; } for (i = 0; i < 100000; i++) { float x1 = -1.000117f; B[i] = (x1 / ((1.000000 + 1.000000) * (((fma(x1, x1, x1)) * (1.000000 - x1)) / (x1 / x1))))...
kernel void update_k(global double* A, const int upper, unsigned int N, unsigned int Npad, unsigned int k) { int i = get_global_id(0); if (i > k && i < N) { double Akk = A[k * Npad + k]; if (upper == 0) { A[i * Npad + k] = A[i * Npad + k] / Akk; A[k * Npad + i] = 0; } else if (upper == 1)...
kernel void tanh_float2(global float2* src_0, global float2* dst) { int gid = get_global_id(0); dst[gid] = tanh(src_0[gid]); }
kernel void localAddress(global float* data) { int id = get_local_id(0); data[get_local_id(0) + get_group_id(0) * get_local_size(0)] = id; }
kernel void binarySearch_mulkeys(global int* keys, global unsigned int* input, const unsigned int numKeys, global int* output) { int gid = get_global_id(0); int lBound = gid * 256; int uBound = lBound + 255; for (int i = 0; i < numKeys; i++) { if (keys[i] >= input[lBound] && keys[i] <= input[uBound]) ...
kernel void copy_half_improved(global ushort2* in, global ushort2* out) { unsigned int index = get_global_id(0); out[index] = in[index]; }
float sstep(float a, float x) { if (x >= a) { return 1; } return 0; } float pulse(float a, float b, float x) { return sstep(a, x) - sstep(b, x); } float3 window(float x, float y) { float frame = (1 - pulse(0.05, 0.95, x)) + (1 - pulse(0.05, 0.95, y)); if (frame > 0) { return (float3)(0.1, 0.1, 0.1...
kernel void clkernel_set(const int num, const float x, global float* out) { const int i = get_global_id(0); if (i >= num) return; out[i] = x; }
kernel void MatrixMultiplication(global float const* restrict A, global float const* restrict B, global float* restrict C) { for (int n = 0; n < 32 / 8; ++n) { float acc[8][32]; for (int k = 0; k < 32; ++k) { float a_buffer[8]; for (int nd = 0; nd < 8; ++nd) { a_buffer[nd] = A[n * 8 * 32 ...
kernel void sum_f16(global float a[], global float b[], global float c[]) { int id = get_global_id(0); float16 x = vload16(id, b); float16 y = vload16(id, c); vstore16(x * y + x * y + x * y, id, a); }
kernel void GEStep1A(global float* AI, int i, int n2, int lda2) { int k = get_global_id(0); if (k > i && k < n2 && AI[i * lda2 + k] != 0) { float multiplyer = -AI[i * lda2 + k] / AI[i * lda2 + i]; int n = n2 / 2; for (int j = i + 1; j < n; j++) { AI[j * lda2 + k] += multiplyer * AI[j * lda2 + i]; ...
kernel void native_sqrt_float4(global float4* src_0, global float4* dst) { int gid = get_global_id(0); dst[gid] = native_sqrt(src_0[gid]); }
kernel void array_multiply_i8(global const char* a, global const char* b, global char* c) { unsigned int i = get_global_id(0); c[i] = a[i] * b[i]; }
kernel void test_select(global uchar4* srcA, global uchar4* srcB, global uchar4* dst) { int tid = get_global_id(0); dst[tid] = (srcA[tid].s0 < srcB[tid].s0) ? srcA[tid] : srcB[tid]; }
kernel void test_arg_3_2_kern(global float4* a0, global float4* a1, global float4* a2, 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] + 0.1f + za; float4 tmp1 = a1[gtid] + 1.1f + za; float4 tmp2 = a2[gtid] +...
kernel void multiply_ushort4ushort4(global ushort4* src_0, global ushort4* src_1, global ushort4* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] * src_1[gid]; }
kernel void set_boolean_output_non_greedy(global char* last_boolean_output, global const float* last_output, unsigned int index) { if (get_global_id(0) == 0) { last_boolean_output[index] = (0.5f < last_output[index]); } }
kernel void kern(global short4* a, global short4* b, global short4* c, global short4* result) { result[0] = a[0] * b[0] + c[0] - a[0]; }
kernel void Simple1DStencil(global float const* restrict memory_in, global float* restrict memory_out) { for (int i = 1; i < 1024 - 1; ++i) { float left = memory_in[i - 1]; float center = memory_in[i]; float right = memory_in[i + 1]; const float factor = 0.3333f; float average = factor * (left + ...
kernel void copy(global float* input, global float* output) { size_t xPos = get_global_id(0); output[xPos] = input[xPos]; }
kernel void unary_plus_short4(global short4* src_0, global short4* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void kernel_19(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float A = 0; for (int i = 0; i < count; i++) { A += (inputA[i] - inputB[i]) * (inputA[i] - inputB[i]) / (inputA[i] + inputB[i]); } output[19] = 2 * A; }
kernel void cpu_inplace_mult(global float16* vec, float factor, unsigned int size) { for (unsigned int i = get_global_id(0); i < size / 16; i += get_global_size(0)) vec[i] *= factor; }
kernel void mad_sat_uintuintuint(global unsigned int* src_0, global unsigned int* src_1, global unsigned int* src_2, global unsigned int* dst) { int gid = get_global_id(0); dst[gid] = mad_sat(src_0[gid], src_1[gid], src_2[gid]); }
kernel void loop_le(global int* out, int iterations) { int i; int ai = 0; for (i = 0; i <= (iterations - 1); i++) { out[ai] = i; ai = ai + 1; } }
kernel void multiplicand(global unsigned int* multiplicands) { unsigned int a = 1099087573; multiplicands[0] = a; for (unsigned int i = 1; i < 1024; i++) { multiplicands[i] = a * multiplicands[i - 1]; } }
kernel void vecsum_contiguous(global const float* input_, global float* output_, local float* scratch_, const int length_) { int local_size = get_local_size(0); int local_index = get_local_id(0); int global_index = get_global_id(0); if (global_index < length_) { scratch_[local_index] = input_[global_index]...
kernel void argmin_kernel_1024(const global float* px, const unsigned skip, const unsigned n, global unsigned* py) { const unsigned bid = get_group_id(0); const unsigned tid = get_local_id(0); local float min_val[1024]; local unsigned argmin_val[1024]; px += bid % skip + (bid / skip) * skip * n; min_val[tid...
kernel void compiler_workgroup_reduce_add_char(global char* src, global char* dst) { char val = src[get_global_id(0)]; char sum = work_group_reduce_add(val); dst[get_global_id(0)] = sum; }
unsigned int sumReduce128(local unsigned int* arr) { int thread = get_local_id(0); if (thread < 64) arr[thread] += arr[thread + 64]; barrier(0x01); if (thread < 32) arr[thread] += arr[thread + 32]; barrier(0x01); if (thread < 16) arr[thread] += arr[thread + 16]; barrier(0x01); if (thread < 8...
kernel void postinc(global ushort* out, ushort in) { out[0] = in++; }
float3 spiky_gradient_kernel(const float3 distance, const float h) { float d = length(distance); float diff = h - d; if (diff < 0) return 0.0; if (d <= 0.00000001) return 0.0; float factor = 1.0 / d * diff * diff / (13.0 / 6.0 * (h * h * h)); return distance * factor; } float viscosity_kernel(cons...
kernel void fabs_float8(global float8* src_0, global float8* dst) { int gid = get_global_id(0); dst[gid] = fabs(src_0[gid]); }
kernel void hello_world_vector(global int* restrict inputA, global int* restrict inputB, global int* restrict output) { int i = get_global_id(0); int4 a = vload4(i, inputA); int4 b = vload4(i, inputB); vstore4(a + b, i, output); }
constant sampler_t smp_none = 0 | 0 | 0x10; kernel void ElementAdd_BUF(global float* input_a, global float* input_b, global float* output, const unsigned int n) { int idx = get_global_id(0); if (idx >= n) return; output[idx] = input_a[idx] + input_b[idx]; }
kernel void evaluateCone(global const float* parameter, global const float* samplingValues, global float* outputBuffer, int numKnotsU, int numKnotsV) { int numElements = numKnotsU * numKnotsV; int iGID = get_global_id(0); if (iGID >= numElements) { return; } int gridWidth = (int)sqrt((float)numElements...
struct TsdfParams { float resolution[3]; float volume[3]; float mu; }; bool _isnan3(float3 v) { return isnan(v.x) || isnan(v.y) || isnan(v.z); } bool _isnan4(float4 v) { return isnan(v.x) || isnan(v.y) || isnan(v.z) || isnan(v.w); } bool _isnan2(float2 v) { return isnan(v.x) || isnan(v.y); } void pack_ts...
kernel void ParallelSelection_hard_float(global float* in, global float* out) { int i = get_global_id(0); int n = get_global_size(0); float ith = in[i]; int pos = 0, j = 0; do { float jth = in[j]; bool smaller = (jth < ith); bool equal_and_smaller = (jth == ith && j < i); pos += smaller || eq...
kernel void gpuCoreTest(global const float* a, global const float* b, global float* c, int iNumElements) { int id = get_global_id(0); int blocksize = 65536 / iNumElements; for (int iy = 0; iy < 100; iy++) { for (int i0 = id * blocksize; i0 < (id + 1) * blocksize; i0++) { c[i0] = a[i0] + b[i0]; } ...
kernel void test_arg_4_2_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, 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] + 0.1f + za; float4 tmp1 = a1[gtid] + 1.1f + za; float...