kernel_code stringlengths 49 1.22M |
|---|
kernel void test_arg_2_5_kern(global int4* a0, global int4* a1, global int4* b0, global int4* b1, global int4* b2, global int4* b3, global int4* b4) {
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 +... |
kernel void debugKernel(global float* inputbuffer, global float* outputbuffer) {
unsigned int globalID = get_global_id(0);
unsigned int value = 0;
value = inputbuffer[globalID];
outputbuffer[globalID] = value;
} |
kernel void kernelInt(int4 input, global int4* output) {
output[0] = input;
} |
kernel void foo(global int* data) {
int x = data[0];
barrier(0x02);
data[1] = x;
} |
kernel void Depthwiseconv(global float* din, const int num, const int channels, const int hin, const int win, const int hout, const int wout, const int kernel_h, const int kernel_w, const int stride_h, const int stride_w, const int pad_h, const int pad_w, global float* dout, global float* weight) {
int local_idx = ge... |
kernel void kernelInt(global int* input, global int* output, unsigned int count) {
unsigned int i = get_global_id(0);
if (i < count)
output[i] = input[i];
} |
kernel void sum(global const unsigned char* input, global long* partialSums) {
unsigned int local_id = get_local_id(0);
unsigned int group_size = get_local_size(0);
local int localSums[256];
localSums[local_id] = (long)input[get_global_id(0)];
for (unsigned int stride = group_size / 2; stride > 0; stride /=... |
kernel void test_stream_write_short(global short* src, global short* dst) {
int tid = get_global_id(0);
dst[tid] = src[tid];
} |
kernel void simple_kernel_1(global const unsigned int* src, const unsigned int arg1, global unsigned int* dst) {
unsigned int idx = get_global_id(0);
dst[idx] = src[idx] + arg1;
} |
kernel void kernel2(global int* table, global char* string_1, global char* string_2, int min1, int min2, int max1, int max2, int length1, int length2) {
const int id = get_global_id(0);
int x = min1 + 1 + id;
int y = min2 + 1 - id;
for (int i = 0; i < (2 * (max1 - min1)); i++) {
if ((x > min1) && (x <= max... |
kernel void compiler_long_asr(global long* src, global long* dst) {
int i = get_global_id(0);
if (i > 7)
dst[i] = src[i] >> i;
else
dst[i] = src[i] + 1;
} |
kernel void kernelDouble(double input, global double* output) {
output[0] = input + (1 << 4);
} |
kernel void VignettingPlugin_Apply(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, const float scale) {
const size_t gid = get_global_id(0);
if (gid >= filmWidth * filmHeight)
return;
if (!isinf(channel_IMAGEPIPELINE[gid * 3])) {
const unsigned int x = gi... |
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 scan(const global unsigned int* in, global unsigned int* out, unsigned int size, unsigned int offset) {
unsigned int idx_right = get_global_id(0);
if (idx_right < size) {
unsigned int right = in[idx_right];
unsigned int left = 0;
if (idx_right >= offset) {
unsigned int idx_left = idx_r... |
kernel void copy_best_weights(global float* all_weights, global int* best_params, global float* best_weights, const int height_ori, const int width_ori, const int search_window_size) {
const int tx = get_global_id(0);
const int weights_size = search_window_size * search_window_size * height_ori * width_ori;
if (... |
kernel void bicgKernel2(global float* A, global float* r, global float* s, int nx, int ny) {
int j = get_global_id(0);
if (j < ny) {
s[j] = 0.0;
int i;
for (i = 0; i < nx; i++) {
s[j] += A[i * ny + j] * r[i];
}
}
} |
kernel void vector_square(global float4* input, global float4* output) {
int i = get_global_id(0);
output[i] = input[i] * input[i];
float4 f4 = output[i];
printf("%0.1f,%0.1f,%0.1f,%0.1f,", f4.x, f4.y, f4.z, f4.w);
} |
kernel void add_sat_ucharuchar(global uchar* src_0, global uchar* src_1, global uchar* dst) {
int gid = get_global_id(0);
dst[gid] = add_sat(src_0[gid], src_1[gid]);
} |
kernel void longlong(global unsigned int* buf) {
buf[0] = (unsigned int)1ull;
} |
float Iq(float q, float cor_length);
float Iq(float q, float cor_length) {
float denominator = 1 + (q * cor_length) * (q * cor_length);
return 1 / denominator;
}
float Iqxy(float qx, float qy, float cor_length);
float Iqxy(float qx, float qy, float cor_length) {
return Iq(sqrt(qx * qx + qy * qy), cor_length);
}
... |
kernel void scan(global unsigned int* histograms, local unsigned int* temp, global unsigned int* globsum) {
int it = get_local_id(0);
int ig = get_global_id(0);
int decale = 1;
int n = get_local_size(0) * 2;
int gr = get_group_id(0);
temp[2 * it] = histograms[2 * ig];
temp[2 * it + 1] = histograms[2 * ig... |
kernel void native_recip_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = native_recip(src_0[gid]);
} |
kernel void decode_gpu(global const char* in, int strlength, global char* out) {
int num = get_global_id(0);
if (num < strlength)
out[num] = in[num] + 1;
} |
kernel void intergroup_hidden_race(global int* data, global int* output) {
int group = get_group_id(0);
output[group] = data[0];
if (group == 1) {
data[0] = group;
}
} |
kernel void clCode(global int* a) {
int globalId = get_global_id(0);
int numOfGroups = get_num_groups(0);
int groupId = get_group_id(0);
int localId = get_local_id(0);
a[globalId * 4 + 0] = globalId;
a[globalId * 4 + 1] = numOfGroups;
a[globalId * 4 + 2] = groupId;
a[globalId * 4 + 3] = localId;
} |
kernel void memset_int(global int* mem, int val, int size) {
int px = get_global_id(0);
if (px >= size)
return;
mem[px] = val;
} |
kernel void relational_greater_than_uint16uint16(global uint16* src_0, global uint16* src_1, global int16* dst) {
int gid = get_global_id(0);
dst[gid] = (int16)(src_0[gid] > src_1[gid]);
} |
kernel void blank(global int4* x) {
for (int i = 0; i < 25; i++) {
x[i] *= 2;
}
} |
float alpha(int j) {
if (1 <= j && j <= (64 - 1))
return 1;
else
return 0;
}
float beta(int j) {
return 0;
}
kernel void proc(global const float* t_g, global float* res_g) {
int gid = get_global_id(0);
int N = 64;
int c = 1;
int m = 1;
int t = t_g[gid];
int j = 0;
float wk;
float wn = 2... |
struct interp_container;
float rerror(float a, float b) {
return fabs(a - b);
}
float min3(float x, float y, float z) {
return min(min(x, y), z);
}
float max3(float x, float y, float z) {
return max(max(x, y), z);
}
int imin3(int x, int y, int z) {
return min(min(x, y), z);
}
int imax3(int x, int y, int z) ... |
kernel void compiler_div_int(global int* src0, global int* src1, global int* dst) {
int id = (int)get_global_id(0);
dst[id] = src0[id] / src1[id];
} |
kernel void reduceNoLocal(global float* g_idata, global float* g_odata, unsigned int n) {
float sum = 0.0f;
for (int i = 0; i < n; i++) {
sum += g_idata[i];
}
g_odata[0] = sum;
} |
kernel void MemoryTask(global long* dataArray, int iter) {
global long* tmpPtr;
dataArray[9 * get_global_size(0) + get_global_id(0)] = (long)(dataArray + get_global_id(0));
for (int i = 0; i < 9; i++) {
dataArray[i * get_global_size(0) + get_global_id(0)] = (long)(dataArray + (i + 1) * get_global_size(0) + ge... |
kernel void test_stream_write_ulong(global ulong* src, global ulong* dst) {
int tid = get_global_id(0);
dst[tid] = src[tid];
} |
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 ... |
float cross2d(float2 a, float2 b) {
return a.x * b.y - a.y * b.x;
}
float dot2d(float2 a, float2 b) {
return a.x * b.x + a.y * b.y;
}
float2 perp(float2 a) {
return (float2)(-a.y, a.x);
}
float2 rotate2d(float orientation, float2 input) {
float cs = cos(radians(orientation));
float sn = sin(radians(orienta... |
kernel void half_log_float4(global float4* src_0, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = half_log(src_0[gid]);
} |
float4 firstEigenVector(local float* matrix) {
float4 v = (float4)(1.0f, 1.0f, 1.0f, 0.0f);
for (int i = 0; i < 8; i++) {
float x = v.x * matrix[0] + v.y * matrix[1] + v.z * matrix[2];
float y = v.x * matrix[1] + v.y * matrix[3] + v.z * matrix[4];
float z = v.x * matrix[2] + v.y * matrix[4] + v.z * matr... |
kernel void setFloatTest(int N, global float* deviceFloat) {
int i = get_global_id(0);
if (i < N) {
deviceFloat[i] = 1.0 * i;
}
} |
kernel void compiler_step_float(global float* edge, global float* x, global float* dst) {
int i = get_global_id(0);
dst[i] = step(edge[i], x[i]);
} |
kernel void kernel_modtest_read(global char* ptr, unsigned long memsize, unsigned int offset, unsigned long p1, unsigned long p2, volatile global unsigned int* err_count, global unsigned long* err_addr, global unsigned long* err_expect, global unsigned long* err_current, global unsigned long* err_second_read) {
int i... |
kernel void profile_by_interpolant(global double* x, global double* w, unsigned int Np, global double* xx_loc, global double* ff_loc, global double* dxm1_loc, unsigned int Nx_loc) {
unsigned int ip = (unsigned int)get_global_id(0);
if (ip < Np) {
double xp = x[ip];
unsigned int ix;
for (ix = 0; ix < Nx... |
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 compiler_long_convert_2(global char* dst1, global short* dst2, global int* dst3, global long* src) {
int i = get_global_id(0);
dst1[i] = src[i];
dst2[i] = src[i];
dst3[i] = src[i];
} |
kernel void native_log2_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = native_log2(src_0[gid]);
} |
kernel void encrypt1(const global uint4* input, global uint4* output, const global uint4 key[11], const global unsigned int global_T0[256], const global unsigned int global_sbox[256], local unsigned int T0[256], local unsigned int sbox[256]) {
size_t global_id = get_global_id(0);
size_t local_id = get_local_id(0);
... |
kernel void Fill(global float* data, float a) {
data[get_global_id(0)] = a;
} |
kernel void test_block_2_7_kern(global float* a0, global float* a1, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4, global float* b5, global float* b6, local float* c0, local float* c1) {
int i;
unsigned int gtid = get_global_id(0);
unsigned int ltid = get_local_id(0);
... |
kernel void gte(global int* out, ulong a, ulong b) {
out[0] = a >= b;
} |
void __gpu_sync(int blocks_to_synch, volatile global unsigned int* g_mutex) {
barrier(0x01 | 0x02);
int tid_in_block = get_local_id(0);
if (tid_in_block == 0) {
atomic_add(g_mutex, 1);
while (g_mutex[0] < blocks_to_synch) {
}
}
barrier(0x01 | 0x02);
}
kernel void Frontier_copy(global unsigned in... |
kernel void to_gray4(global uchar4* aBufferIn, global uchar4* aBufferOut) {
int global_id = get_global_id(0);
uchar4 data = aBufferIn[global_id];
float4 mask = (float4)(0.299, 0.587, 0.114, 1);
float4 final = dot(convert_float4(data), mask);
aBufferOut[global_id] = (uchar4)((uchar) final.x, (uchar) final.y, (... |
kernel void post_decrement_int16(global int16* src_0, global int16* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid]--;
} |
kernel void aggregatefloat(global float* in1, global float* in2, global float* output) {
int i = get_global_id(0);
output[i] = in1[i] + in2[i];
} |
kernel void CopyIRKernel16bitInterSum(const global unsigned int* IR_In, global float2* sum_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 groupID = get_group_id(0);
unsigned int lcl_id = get_local_id(0);
unsign... |
kernel void time_step(global float4* params, global float4* oldpos, global float4* oldvel, global float4* newpos, global float4* newvel, global float4* k1vel, global float4* k2vel, global float4* k3vel, global float4* k4vel, global float4* k1force, global float4* k2force, global float4* k3force, global float4* k4force,... |
kernel void test_arg_4_4_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, 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;
float... |
kernel void interp_CIC(global const double* E, int nx, double dx, global const double* xp, global double* Ep, int N) {
int gid = get_global_id(0);
const int stride = get_global_size(0);
int left, right;
double xis;
while (gid < N) {
xis = xp[gid] / dx;
left = (int)(floor(xis));
right = (left + 1)... |
kernel void foo(global int* data) {
*data = get_global_offset(0);
} |
kernel void add(int2 source, global int2* result) {
result[0] = source;
} |
kernel void square_array(global float* a) {
unsigned int idx = get_global_id(0);
a[idx] = a[idx] * a[idx];
} |
kernel void kernel_fract_withDD1(global float* result_fract, int N) {
float t1 = 5.634;
float t2;
int i = 0;
for (i = 0; i < N; i++) {
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
t1 = fract(t1, &t2);
... |
kernel void sub_sat_long2long2(global long2* src_0, global long2* src_1, global long2* dst) {
int gid = get_global_id(0);
dst[gid] = sub_sat(src_0[gid], src_1[gid]);
} |
kernel void AutoLinearToneMap_Apply(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, const float gamma, global float* totalRGB) {
const size_t gid = get_global_id(0);
const unsigned int pixelCount = filmWidth * filmHeight;
if (gid >= pixelCount)
return;
if (... |
kernel void ELUBackward(global float* deltaXbatch, global float* deltaYbatch, global float* inputBatch, const float alpha, const int nTotActivations) {
int i = get_global_id(0);
if (i < nTotActivations) {
if (inputBatch[i] < 0.0F) {
float derivative = alpha * exp(inputBatch[i]);
deltaXbatch[i] = de... |
kernel void AtomicSum(global int* sum) {
local int tmpSum[4];
if (get_local_id(0) < 4) {
tmpSum[get_local_id(0)] = 0;
}
barrier(0x01);
atomic_add(&tmpSum[get_global_id(0) % 4], 1);
barrier(0x01);
if (get_local_id(0) == (get_local_size(0) - 1)) {
atomic_add(sum, tmpSum[0] + tmpSum[1] + tmpSum[2] + ... |
kernel void false_warning_vector_argument(int16 arg, global int8* res) {
int8 v = (int8)(1, 2, 3, 4, 5, 6, 7, 8);
int16 add = arg + v.s0011223344556677;
*res = add.lo;
} |
struct float4 {
float x;
float y;
struct float4* next;
};
struct particleline {
int length;
struct float4* Particles;
};
struct float4* partalloc(float x, float y);
kernel void POISSON_1_relaxation_kernel(global float* P, global float* RHS, global int* FLAG, int imax, int jmax, float delx, float dely, float... |
kernel void subtract_ulong2ulong2(global ulong2* src_0, global ulong2* src_1, global ulong2* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] - src_1[gid];
} |
kernel void asbs_s_cpu_cpu(global float* s1, float fac2, unsigned int options2, global const float* s2, float fac3, unsigned int options3, global const float* s3) {
float alpha = fac2;
float beta = fac3;
if (options2 & (1 << 0)) {
if (options3 & (1 << 0)) {
if (options2 & (1 << 1)) {
if (option... |
kernel void test_private_storage(global int* in, global int* out) {
size_t gid = get_global_id(0);
uchar lid = get_local_id(0);
private
int loc[12];
loc[0] = in[gid];
loc[1] = in[gid] + 4;
loc[2] = in[gid] + 5;
loc[3] = in[gid] + 6;
loc[4] = in[gid] + 7;
loc[5] = in[gid] + 8;
loc[6] = in[gid] + 9... |
kernel void pastehistograms(global int* histo, global int* globsum) {
int ig = get_global_id(0);
int gr = get_group_id(0);
int s;
s = globsum[gr];
histo[2 * ig] += s;
histo[2 * ig + 1] += s;
barrier(0x02);
} |
kernel void test_float8(global float* pin, global float* pout) {
int x = get_global_id(0);
float8 value;
value = vload8(x, pin);
value += (float8){(float)1, (float)2, (float)3, (float)4, (float)5, (float)6, (float)7, (float)8};
vstore8(value, x, pout);
} |
kernel void prepare_kernel(long d_Ne, global float* restrict d_I, global float* restrict d_sums, global float* restrict d_sums2) {
int bx = get_group_id(0);
int tx = get_local_id(0);
int ei = bx * 32 + tx;
if (ei < d_Ne) {
d_sums[ei] = d_I[ei];
d_sums2[ei] = d_I[ei] * d_I[ei];
}
} |
kernel void pre_increment_long8(global long8* src_0, global long8* dst) {
int gid = get_global_id(0);
dst[gid] = ++src_0[gid];
} |
float2 MultComplex2(float2 A, float2 B);
float cabs(float2 A);
float carg(float2 A);
float2 MultComplex2(float2 A, float2 B) {
float2 temp;
temp.s0 = A.s0 * B.s0 - A.s1 * B.s1;
temp.s1 = A.s1 * B.s0 + A.s0 * B.s1;
return temp;
}
float cabs(float2 A) {
return sqrt(A.s0 * A.s0 + A.s1 * A.s1);
}
float carg(... |
int calcutate(int index) {
int a = (index * 32) & 128;
return a;
}
kernel void test(int size, global int* in, global int* out) {
int idx = get_global_id(0);
if (idx >= size) {
return;
}
int ga[10240 + 4096 + 200] = {1};
out[idx] = ga[idx % 10240 + 4096 + 200];
} |
kernel void kernel_mad_withDD2(global float* result_mad, int N) {
float t1 = 0.96;
float t2 = 0.05;
float s = 1;
float2 s0 = s + (float2)(0, 0.1);
int i;
for (i = 0; i < N; i++) {
s0 = mad(s0, t1, t2);
s0 = mad(s0, t1, t2);
s0 = mad(s0, t1, t2);
s0 = mad(s0, t1, t2);
s0 = mad(s0, t1, t2)... |
kernel void test_arg_1_5_kern(global int* a0, 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;
b0[gtid] = (0 + 1) * (+tmp0);
b1[gtid] = (1 + 1) * (+tmp0);
b2[gtid] = (2 + 1) * (+tmp0);
b3[gtid] = (3 + 1) * (+tmp0... |
kernel void unsupported_builtins(const global float4* input, int input_stride, global float4* output, int output_stride) {
local float4 local_array[10];
prefetch(input, input_stride);
event_t event_1 = async_work_group_copy(local_array, input, sizeof(local_array) / sizeof(local_array[0]), 0);
event_t event_2... |
kernel void FWD_init_alpha(const int N, global const float* b_d, global const float* pi_d, global float* alpha_d, global float* ones_d, global float* beta_d) {
unsigned int idx = get_global_id(0);
if (idx < N) {
alpha_d[idx] = pi_d[idx] * b_d[idx];
beta_d[idx] = ones_d[idx] = 1.0f;
}
} |
kernel void vecinit(global int* restrict v1, int nels) {
const int i = get_global_id(0);
if (i >= nels)
return;
v1[i] = i;
} |
kernel void copy_byte_improved(global uchar4* in, global uchar4* out) {
unsigned int index = get_global_id(0);
out[index] = in[index];
} |
void intersectPAllLeaves(const global float* dir, const global float* o, const global float* bounds, global unsigned char* tHit, float3 v1, float3 v2, float3 v3, float3 e1, float3 e2, int chunk, int rindex) {
float3 s1, s2, d, rayd, rayo;
float divisor, invDivisor, t, b1, b2;
for (int i = 0; i < chunk; i++) {
... |
kernel void brahmaKernel(global int* buf) {
int x = 3;
int f = x;
buf[0] = f;
} |
kernel void kernel_add_withoutDD8(global float* result_add, int N) {
float8 t1 = (float8)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8);
float8 t2 = (float8)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8);
float8 t3 = (float8)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8);
float8 t4 = (float8)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0... |
kernel void kernel_logb_withDD1(global float* result_logb, int N) {
float t1 = 10.0;
int i = 0;
for (i = 0; i < N; i++) {
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + logb(t1);
t1 = 4.0 + l... |
kernel void dot_product(global const float4* a, global const float4* b, global float* c) {
int gid = get_global_id(0);
float4 prod = a[gid] * b[gid];
c[gid] = prod.x + prod.y + prod.z + prod.w;
} |
kernel void do_clustering(int num_of_clusters, int num_of_points, global float* centers_x, global float* centers_y, global float* points_x, global float* points_y, global int* point_cluster_ids) {
int global_id = get_global_id(0);
if (global_id >= num_of_points) {
return;
}
float2 xy = (float2)(points_x[gl... |
unsigned int stepLCG(unsigned int* z, unsigned int A, unsigned int C) {
return (*z) = (A * (*z) + C);
}
unsigned int stepLFG(unsigned int* z, global unsigned int* znmk, unsigned int A, unsigned int C) {
return (*znmk) = (*z) = (A * (*z) + C) + (*znmk);
}
unsigned int stepCTG(unsigned int* z, unsigned int S1, unsi... |
kernel void vecinit(global float* out, int n) {
const int i = get_global_id(0);
if (i < n)
out[i] = 1.0f;
} |
kernel void as_cpu(global float* s1, float fac2, unsigned int options2, global const float* s2) {
float alpha = fac2;
if (options2 & (1 << 0)) {
if (options2 & (1 << 1)) {
*s1 = -*s2 / alpha;
} else {
*s1 = -*s2 * alpha;
}
} else {
if (options2 & (1 << 1)) {
*s1 = +*s2 / alpha;
... |
kernel void _axpy_opencl(global float* x, global float* y, unsigned nx, float alpha) {
const int i = get_global_id(0);
if (i < nx)
y[i] = alpha * x[i] + y[i];
} |
kernel void wait_event_duplicates(global int* data, local int* scratch) {
event_t events[4];
events[0] = async_work_group_copy(scratch, data, 1, 0);
events[1] = events[0];
events[2] = async_work_group_copy(scratch + 1, data + 1, 3, 0);
events[3] = events[0];
wait_group_events(4, events);
int i = get_loc... |
unsigned int scanwarp(unsigned int val, volatile local unsigned int* sData, int maxlevel) {
int localId = get_local_id(0);
int idx = 2 * localId - (localId & (32 - 1));
sData[idx] = 0;
idx += 32;
sData[idx] = val;
if (0 <= maxlevel) {
sData[idx] += sData[idx - 1];
}
if (1 <= maxlevel) {
sData[i... |
struct state {
float V;
float h;
float n;
float z;
float s_AMPA;
float x_NMDA;
float s_NMDA;
float s_GABAA;
float I_app;
};
inline float _f_I_Na_m_inf(const float V) {
const float theta_m = -30;
const float sigma_m = 9.5f;
return pow((1 + exp(-(V - theta_m) / sigma_m)), -1);
}
inline float _f... |
kernel void testFOrdEqual(float2 a, float2 b, global int2* res) {
res[0] = a == b;
} |
constant float beta = 0.66666f;
kernel void process_layer(global const float* inputs, global const float* weights, int inputs_ofs, int weights_ofs, int outputs_ofs, int inputs_per_neuron, int neuron_count, local float* partial_sum, global float* outputs) {
for (unsigned int y = get_group_id(0); y < neuron_count; y +=... |
kernel void half_sqrt_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = half_sqrt(src_0[gid]);
} |
kernel void GetNumOfGroupsForBlocks(global int* startOffsetInParticles, global int* numOfGroupsForBlocks, int numOfActiveBlocks, int groupSize) {
int globalID = get_global_id(0);
if (globalID < numOfActiveBlocks) {
int numOfParticles = startOffsetInParticles[globalID + 1] - startOffsetInParticles[globalID];
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.