kernel_code
stringlengths
49
1.22M
kernel void test_block_4_2_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* b0, global float* b1, local float* c0, local float* c1, local float* c2, local float* c3) { int i; unsigned int gtid = get_global_id(0); unsigned int ltid = get_local_id(0); size_t lsz = get_loc...
kernel void second(global uchar4* bufin, global uchar4* bufout) { int i = get_global_id(0); uchar4 c = bufin[i]; uchar4 d; uchar v; v = max(c.x, max(c.y, c.z)); d.x = v; d.y = v; d.z = v; d.w = c.w; bufout[i] = d; }
kernel void test_arg_4_5_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* b0, global int* b1, global int* b2, global int* b3, global int* b4) { 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] +...
kernel void test(global float* gp, local float* lp) { global float* ghp; local float* lhp; }
kernel void compute_sp_v8(global float* ptr, float _A) { float8 x = (float8)(_A, (_A + 1), (_A + 2), (_A + 3), (_A + 4), (_A + 5), (_A + 6), (_A + 7)); float8 y = (float8)get_local_id(0); x = mad(y, x, y); y = mad(x, y, x); x = mad(y, x, y); y = mad(x, y, x); ; x = mad(y, x, y); y = mad(x, y, x); x...
kernel void compiler_overflow_uchar4_add(global uchar4* src0, global uchar4* src1, global uchar4* dst) { global uchar4* A = &src0[get_global_id(0)]; global uchar4* B = &src1[get_global_id(0)]; global uchar4* C = &dst[get_global_id(0)]; *C = *A + *B; uchar4 carry = -convert_uchar4(*C < *B); (*C).y += carry.x...
kernel void ParallelBitonic_B2(global unsigned int* restrict config, global unsigned int* restrict keys, global unsigned int* restrict values) { unsigned int inc = config[0]; unsigned int dir = config[1]; int t = get_global_id(0); int low = t & (inc - 1); int i = (t << 1) - low; bool reverse = ((dir & i) ==...
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 test_atomic_xchg_float(global float* ptr, float val) { atomic_xchg(ptr, val); }
kernel void compiler_abs_diff_char16(global char16* x, global char16* y, global uchar16* diff) { int i = get_global_id(0); diff[i] = abs_diff(x[i], y[i]); }
kernel void pre_increment_ushort2(global ushort2* src_0, global ushort2* dst) { int gid = get_global_id(0); dst[gid] = ++src_0[gid]; }
kernel void test_arg_2_3_kern(global int4* a0, global int4* a1, 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; b0[gtid] = (0 + 1) * (+tmp0 + tmp1); b1[gtid] = (1 + 1) * (+t...
kernel void kernel_multi_withoutDD1(global float* result_multi, int N) { float t1 = 0.0; float t2 = 0.0; 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 t11 = 0.0; float t12 = 0.0; float t13 = t1; float t14 = t3; ...
kernel void ker_elt_production(global float* out_data, const int with_relu, global const float* in_data_a, global const float* in_data_b, int count) { int idx = get_global_id(0); if (idx < count) { float tmp = in_data_a[idx] * in_data_b[idx]; out_data[idx] = tmp; } }
kernel void test_arg_1_4_kern(global int4* a0, global int4* b0, global int4* b1, global int4* b2, global int4* b3) { int4 za = (int4)(0, 1, 2, 3); unsigned int gtid = get_global_id(0); int4 tmp0 = a0[gtid] + 0 + za; b0[gtid] = (0 + 1) * (+tmp0); b1[gtid] = (1 + 1) * (+tmp0); b2[gtid] = (2 + 1) * (+tmp0); ...
kernel void sub_sat_ushort8ushort8(global ushort8* src_0, global ushort8* src_1, global ushort8* dst) { int gid = get_global_id(0); dst[gid] = sub_sat(src_0[gid], src_1[gid]); }
kernel void test_lgamma(const global float* in, global float* out) { size_t gid = get_global_id(0); out[gid] = lgamma(in[gid]); }
kernel void radix_sort8(global ushort8* global_data) { typedef union { ushort8 vec; ushort array[8]; } vec_array; unsigned int one_count, zero_count; unsigned int cmp_value = 1; vec_array mask, ones, data; data.vec = global_data[0]; for (int i = 0; i < 3; i++) { zero_count = 0; one_coun...
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 kernel1(global float* output, local float* temp, char c, uchar uc, short s, ushort us, int i, unsigned int ui, long l, ulong ul, float f) { if (i > 5) temp[0] = (float)c + (float)uc + (float)s + (float)us; else temp[0] = (float)ui + (float)l + (float)ul; output[0] = temp[0] + f; }
kernel void abs_int8(global int8* src_0, global uint8* dst) { int gid = get_global_id(0); dst[gid] = (uint8)(abs(src_0[gid])); }
kernel void reduceStatistic(global int* in, int length) { int gloId = get_global_id(0); for (int i = gloId + 256; i < length; i += 256) { in[gloId] += in[i]; } }
kernel void predec(global uchar* out, uchar in) { out[0] = --in; }
kernel void kernel_atan_withoutDD1(global float* result_atan, int N) { float t1 = 1.23; float t2 = t1; float t3 = t1; float t4 = t3; float t5 = t3; float t6 = t3; float t7 = t3; float t8 = t3; float t9 = t3; float t10 = t3; float j = 1.0; for (j = 0.0; j <= 7 * N; j = j + 1.0) { t1 = atan(j)...
kernel void compiler_abs_diff_ulong8(global ulong8* x, global ulong8* y, global ulong8* diff) { int i = get_global_id(0); diff[i] = abs_diff(x[i], y[i]); }
union BufferType { float f; unsigned int u; }; kernel void getBoundsGather(global float4* minBoundGroup, global float4* maxBoundGroup, global float4* bounds, const int numWorkItems) { float4 minBound = (float4)0x1.fffffep127f; float4 maxBound = (float4)-0x1.fffffep127f; for (int wi = 0; wi < numWorkItems; wi...
kernel void clCode(global const int* a, global int* minData, global int* maxData, global int* diffData) { size_t i = get_global_id(0); atomic_min(minData, a[i]); atomic_max(maxData, a[i]); barrier(0x02); *diffData = *maxData - *minData; }
kernel void mul4x4(global float* input, global float* output, const float16 aa, const unsigned int count) { size_t ix; global float* b; global float* c; float* a = (float*)&aa; ix = get_global_id(0); if (ix < count) { int i, j, k; b = input + ix * 16; c = output + ix * 16; for (i = 0; i <...
kernel void closerLaserScanDouble(global double* v) { unsigned int i = get_global_id(0); v[i] = v[i] * v[i] * 0.1f; }
kernel void ffill(global float4* a) { unsigned int i = get_global_id(0); a[i].x = 0.0f; a[i].y = 1.0f; a[i].z = 2.0f; a[i].w = 3.0f; }
kernel void kernel_fdim_withDD1(global float* result_fdim, int N) { float p1 = 4345.1; float p2 = 1.1; int i = 0; for (i = 0; i < N; i++) { p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fdim(p1, p2); p1 = fd...
kernel void reset_bbox_buffer(global int* box_buffer) { int idx = get_global_id(0) * 4; box_buffer[idx++] = 0; box_buffer[idx++] = 0; box_buffer[idx++] = 2147483647; box_buffer[idx] = 2147483647; }
kernel void test_atan2pi(const global float* in0, const global float* in1, global float* out) { size_t gid = get_global_id(0); out[gid] = atan2pi(in0[gid], in1[gid]); }
kernel void compiler_double_to_half(global double* src, global float* dst) { int i = get_global_id(0); dst[i] = src[i]; }
kernel void unary_plus_float8(global float8* src_0, global float8* dst) { int gid = get_global_id(0); dst[gid] = +src_0[gid]; }
kernel void test_block_5_2_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* b0, global int* b1, local int* c0, local int* c1, local int* c2, local int* c3, local int* c4) { int i; unsigned int gtid = get_global_id(0); unsigned int ltid = get_local_id(0); size_t ls...
kernel void kernel5_move(global char* ptr, unsigned long memsize) { int i, j; int idx = get_global_id(0); unsigned long n = memsize / (1024 * 1024); int total_num_threads = get_global_size(0); unsigned int half_count = (1024 * 1024) / sizeof(unsigned int) / 2; for (i = idx; i < n; i += total_num_threads) {...
float calNumEigenValuesLessThan(global float* diagonal, global float* offDiagonal, const unsigned int width, const float x) { unsigned int count = 0; float prev_diff = (diagonal[0] - x); count += (prev_diff < 0) ? 1 : 0; for (unsigned int i = 1; i < width; i += 1) { float diff = (diagonal[i] - x) - ((offDi...
kernel void ifill(global int* a, int b) { unsigned int i = get_global_id(0); a[i] = b; }
kernel void rdwdot10_kernel(global const float* RKF, global const float* RKR, global float* WDOT, const float rateconv, global const float* molwt) { float ROP12 = ((RKF[(((12) - 1) * (4)) + (get_global_id(0))]) - (RKR[(((12) - 1) * (4)) + (get_global_id(0))])) + ((RKF[(((13) - 1) * (4)) + (get_global_id(0))]) - (RKR[...
kernel void globalAtomicKernelExt(global int* counter) { atom_inc(counter); }
kernel void reduce6(global float* g_idata, global float* g_odata, unsigned int n, local volatile float* sdata) { unsigned int tid = get_local_id(0); unsigned int i = get_group_id(0) * (get_local_size(0) * 2) + get_local_id(0); unsigned int gridSize = 128 * 2 * get_num_groups(0); sdata[tid] = 0; while (i < n)...
kernel void inefficient(global const int* input, global int* output, const int inputSize, local int* reductionSums) { const int globalID = get_global_id(0); const int localID = get_local_id(0); const int localSize = get_local_size(0); const int workgroupID = globalID / localSize; reductionSums[localID] = inp...
kernel void kernel_gravity(float Mg, global float* m, global float* d, global float* f_mag) { int i = get_global_id(0); float G = 0.00000000006673; f_mag[i] = (Mg * m[i] * G) / (d[i] * d[i]); }
kernel void test(global float* in, global float* out) { const int globalid = get_global_id(0); out[globalid] = in[globalid] + 7; }
struct stable_info { double k1; double theta0; double alfa; double alfainvalfa1; double mu_0; double sigma; double xi; double xxi_th; double c2_part; double c1; double THETA_TH; double beta; double xi_coef; short is_xxi_negative; unsigned int integrand; double final_pdf_factor; double ...
kernel void kernelDouble(global double* input, global double* output, unsigned int count) { unsigned int i = get_global_id(0); if (i < count) output[i] = input[i]; }
kernel void minus(global char* out, char in) { out[0] = -in; }
kernel void kern(global float* a, global float* b, global float* c, global float* result) { result[0] = erf(a[0]); result[1] = exp(a[1]); result[2] = exp2(a[2]); result[3] = exp10(a[3]); result[4] = expm1(a[4]); result[5] = fabs(a[5]); result[6] = fdim(a[6], b[6]); result[7] = floor(a[7]); result[8] =...
constant float TWOPI = 3.14159265358979323846264338327950288f * 2.0f; constant float phStepR = (440.0f * 3.14159265358979323846264338327950288f) / 44100.0f; kernel void cl_synth(int bufOffset, global float* buf) { const int gid = get_global_id(0); buf[gid] = (gid % 2) * sin((float)(bufOffset + gid - 1) * phStepR);...
kernel void WriteScannedOutput(global int* output, global int* block_sums, const unsigned int count) { const unsigned int gid = get_global_id(0); const unsigned int block_id = get_group_id(0); if (gid < count) { output[gid] += block_sums[block_id]; } }
kernel void sum(global const int* input, global int* output, const int inputSize, local int* reductionSums) { const int globalID = get_global_id(0); const int localID = get_local_id(0); const int localSize = get_local_size(0); const int workgroupID = globalID / localSize; reductionSums[localID] = input[globa...
kernel void VectorHypot(global float4* fg4A, global float4* fg4B, global float4* fg4Hypot, unsigned int uiOffset, int iInnerLoopCount, unsigned int uiNumElements) { size_t szGlobalOffset = get_global_id(0) + uiOffset; if (szGlobalOffset >= uiNumElements) { return; } float4 f4A = fg4A[szGlobalOffset]; fl...
kernel void processNineCellWindow(global float* scanLine1, global float* scanLine2, global float* scanLine3, global float* resultLine, global float* rasterParams) { const int i = get_global_id(0); float x11 = scanLine1[i]; float x21 = scanLine1[i + 1]; float x31 = scanLine1[i + 2]; float x12 = scanLine2[i]; ...
kernel void foo(global int* in, global int* out, int a) { if (a == 0) { barrier(0x02); *out = *(in + 1); } else { *out = *(in + 2); } }
kernel void square(global int* input, global int* output) { int i = get_global_id(0); output[i] = input[i] * input[i]; }
kernel void foo(global float* a, global float* b, global float* c) { if (get_global_id(0) == 0) { *c = *a + *b; } }
kernel void add_42(const global int* a, global int* b) { for (unsigned int i = 0; i < 300; ++i) b[i] = a[i] + 42; }
inline float activation(float in) { float output = in; return output; } inline float4 activation_type4(float4 in ) { float4 output = in; return output; } kernel void pool_max(const int numel, global float* input_data, const int channels, const int height, const int width, const int pooled_height, const int p...
kernel void drag_force(global float4* params, global float4* vel, global float4* force, float dconst) { int i = get_global_id(0); bool fixed = 0 < params[i].x; if (fixed) { return; } force[i] += -dconst * vel[i]; }
inline float atomic_add(volatile global float* address, const float value) { float old = value; while ((old = atomic_xchg(address, atomic_xchg(address, 0.0f) + old)) != 0.0f) ; return old; } kernel void softmax_backward(global float* dinp, global float* doutp, global float* outp, global float* inp, int input...
kernel void kernel_tgamma_withoutDD1(global float* result_tgamma, int N) { float t1; float t2; float t3; float t4; float t5; float t6; float t7; float t8; float t9; float t10; float i = 1.0; float n = 0.07 * (float)(N); for (i = 1.0; i < n; i = i + 0.01) { t1 = tgamma(i); t2 = tgamma(...
kernel void init(global uchar* diff, global uchar* residual, const unsigned int n_noisy) { const int noisy_idx = get_global_id(0); if (noisy_idx < n_noisy) { diff[noisy_idx] = 0; } if (get_local_id(0) == 0) residual[get_group_id(0)] = 0; }
kernel void global_bandwidth_v4_global_offset(global float4* A, global float* B) { int id = get_global_id(0); float4 sum = 0; sum += A[id]; id += get_global_size(0); sum += A[id]; id += get_global_size(0); ; sum += A[id]; id += get_global_size(0); sum += A[id]; id += get_global_size(0); ; ; ...
int x(private int y0) { return (6 - y0); } int f(private int y) { return x(y); } kernel void brahmaKernel(global int* buf) { buf[0] = f(7); }
kernel void input_eq_output(global int* in, global int* out) { int globalID = get_global_id(0); out[globalID] = in[globalID]; }
kernel void test_abs(const global int* in, global int* out) { unsigned int gid = get_global_id(0); out[gid] = (int)abs((short)in[gid]); }
kernel void minus(global int* out, int in) { out[0] = -in; }
kernel void kernel_atanh_withoutDD1(global float* result_atanh, int N) { float t1 = 1.2; float t2 = 1.2; float t3 = 1.2; float t4 = 1.2; float t5 = 1.2; float t6 = 1.2; float t7 = 1.2; float t8 = 1.2; float t9 = 1.2; float t10 = 1.2; float i = -1.0; for (i = -1.0; i <= 1.0; i = i + 0.001) { ...
kernel void two_stage_reduce(global float* in, local float* scratch, global float* out, const int size) { int gid = get_global_id(0); float accum = 0.0; while (gid < size) { float element = in[gid]; accum += element; gid += get_global_size(0); } int lid = get_local_id(0); scratch[lid] = accum;...
kernel void gridkernel(global double* gr, global double* gi, global double* cr, global double* ci, double dr, double di, int len) { int idx = get_global_id(0); if (idx < len) { gi[idx] = gi[idx] + dr * ci[idx] + di * cr[idx]; gr[idx] = gr[idx] + dr * cr[idx] - di * ci[idx]; } }
kernel void kernel_add_withoutDD2(global float* result_add, int N) { float2 t1 = (float2)(0.1, 0.2); float2 t2 = (float2)(0.1, 0.2); float2 t3 = (float2)(0.1, 0.2); float2 t4 = (float2)(0.1, 0.2); float2 t5 = (float2)(0.1, 0.2); float2 t6 = (float2)(0.1, 0.2); float2 t7 = (float2)(0.1, 0.2); float2 t8 =...
inline void swap(unsigned int* a, unsigned int* b) { unsigned int tmp; tmp = *b; *b = *a; *a = tmp; } inline void sort(unsigned int* a, unsigned int* b, char dir) { if ((*a > *b) == dir) swap(a, b); } inline void swapLocal(local unsigned int* a, local unsigned int* b) { unsigned int tmp; tmp = *b; ...
kernel void compute_integer_v16(global int* ptr, int _A) { int16 x = (int16)(_A, (_A + 1), (_A + 2), (_A + 3), (_A + 4), (_A + 5), (_A + 6), (_A + 7), (_A + 8), (_A + 9), (_A + 10), (_A + 11), (_A + 12), (_A + 13), (_A + 14), (_A + 15)); int16 y = (int16)get_local_id(0); x = (y * x) + y; y = (x * y) + x; x =...
float mod(float x, float p) { return x - p * floor(x / p); } float angle_from(float x, float y, float angle_offset) { float angle = atan2(y, x); angle = mod(angle - angle_offset, 2 * 3.14159265358979323846f); angle -= (2 * 3.14159265358979323846f) * (angle > 3.14159265358979323846f); return angle; } float ...
kernel void Concat_normal_f4(const int nthreads, global const float* in_data, const int num_concats, const int concat_size, const int top_concat_axis, const int bottom_concat_axis, const int offset_concat_axis, global float* out_data) { int index = get_global_id(0); global float4* vsrc; global float4* vdst; if...
kernel void test_block_7_1_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* a5, global int* a6, global int* b0, local int* c0, local int* c1, local int* c2, local int* c3, local int* c4, local int* c5, local int* c6) { int i; unsigned int gtid = get_global_id(0); un...
kernel void compiler_abs_uchar16(global uchar16* src, global uchar16* dst) { int i = get_global_id(0); dst[i] = abs(src[i]); }
kernel void test_arg_5_3_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* a4, 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 = ...
kernel void foo(global int* out, char a) { *out = a; }
kernel void compiler_clz_ulong(global ulong* src, global ulong* dst) { global ulong* A = &src[get_global_id(0)]; global ulong* B = &dst[get_global_id(0)]; *B = clz(*A); }
kernel void add_intint(global int* src_0, global int* src_1, global int* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] + src_1[gid]; }
kernel void computeHistogram(global const unsigned int* data, global unsigned int* buckets, unsigned int shiftBy, local unsigned int* sharedArray) { size_t localId = get_local_id(0); size_t globalId = get_global_id(0); size_t groupId = get_group_id(0); size_t groupSize = get_local_size(0); sharedArray[localI...
kernel void bench_math_pow(global float* src, global float* dst, float pwr, unsigned int loop) { float result = src[get_global_id(0)]; for (; loop > 0; loop--) { result = pow(result, pwr); } dst[get_global_id(0)] = result; }
kernel void test_vector_creation4(global char* src, global char4* result) { result[0] = (char4)(src[0], src[1], src[2], src[3]); result[1] = (char4)(src[0], src[1], vload2(0, src + 2)); result[2] = (char4)(src[0], vload2(0, src + 1), src[3]); result[3] = (char4)(src[0], vload3(0, src + 1)); result[4] = (char4...
kernel void saxpy(global float* x, global float* y, const float a) { const unsigned int i = get_global_id(0); y[i] = a * x[i] + y[i]; }
kernel void VectorAdd(global const float* a, global const float* b, global float* c, int iNumElements, global unsigned int* indexDst) { int iGID = get_global_id(0); c[iGID] = 12.0f; if (iGID % 3 == 0) { indexDst[iGID] = iGID / 3; indexDst[iGID + 1] = iGID / 3; indexDst[iGID + 2] = iGID / 3; } }
; ; ; ; ; ; kernel void builtin_convert_ulong_to_char_sat(global ulong* src, global char* dst) { int i = get_global_id(0); dst[i] = convert_char_sat(src[i]); }
kernel void array_multiply_i64(global const long* a, global const long* b, global long* c) { unsigned int i = get_global_id(0); c[i] = a[i] * b[i]; }
kernel void minus(global float* out, float in) { out[0] = -in; }
kernel void gt(global int* out, long a, long b) { out[0] = a > b; }
kernel void filter_r(global const uchar* A, global uchar* B) { int id = get_global_id(0); int image_size = get_global_size(0) / 3; int colour_channel = id / image_size; B[id] = A[id]; }
kernel void setInt32Test(int N, global int* deviceInt) { int i = get_global_id(0); if (i < N) { deviceInt[i] = i; } }
__attribute__((max_global_work_dim(0))) kernel void dynproc_kernel(global int* restrict wall, global int* restrict src, global int* restrict dst, int cols, int rem_rows, int starting_row, int comp_exit) { int shift_reg[256 + 1 + 16]; for (int i = 0; i < 256 + 1 + 16; i++) { shift_reg[i] = 0.0f; } int x = ...
kernel void oclLucas(global char* data) { data[0] = 'H'; data[1] = 'e'; data[2] = 'l'; data[3] = 'l'; data[4] = 'o'; data[5] = '!'; }
kernel void FillBufferRightLeftover(global uchar* pDst, unsigned int dstOffsetInBytes, const global uchar* pPattern, const unsigned int patternSizeInEls) { unsigned int gid = get_global_id(0); pDst[gid + dstOffsetInBytes] = pPattern[gid & (patternSizeInEls - 1)]; }
kernel void block_ret_struct(global int* res) { struct A { int a; }; struct A (^kernelBlock)(struct A) = ^struct A(struct A a) { a.a = 6; return a; }; size_t tid = get_global_id(0); res[tid] = -1; struct A aa; aa.a = 5; res[tid] = kernelBlock(aa).a - 6; }
int Calculate2DIndex(int x, int y, int DATA_W) { return x + y * DATA_W; } int Calculate3DIndex(int x, int y, int z, int DATA_W, int DATA_H) { return x + y * DATA_W + z * DATA_W * DATA_H; } int Calculate4DIndex(int x, int y, int z, int t, int DATA_W, int DATA_H, int DATA_D) { return x + y * DATA_W + z * DATA_W *...
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 single_add_scalar(global float* out, global const float* x, float w, int N) { int id = get_index(N, -...
float default_kernel(const float dx, const float dy, const float dz, const float h) { float cudiff = h * h - (dx * dx + dy * dy + dz * dz); if (cudiff < 0) return 0.0; return 35.0f / 32.0f / (h * h * h * h * h * h * h) * cudiff * cudiff * cudiff; } float spiky_kernel(const float dx, const float dy, const flo...