kernel_code stringlengths 49 1.22M |
|---|
kernel void bitselect_char8char8char8(global char8* src_0, global char8* src_1, global char8* src_2, global char8* dst) {
int gid = get_global_id(0);
dst[gid] = bitselect(src_0[gid], src_1[gid], src_2[gid]);
} |
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 vadd(global uint4* op1, global uint4* op2, global uint4* ret, unsigned int dev, unsigned int numItems) {
unsigned int count = (numItems / 4) / get_global_size(0);
unsigned int idx = (dev == 0) ? (get_global_id(0) * count) : get_global_id(0);
unsigned int stride = (dev == 0) ? 1 : get_global_size(0);
... |
kernel void test_smoothstep(const global float* x, const global float* y, const global float* z, global float* out) {
unsigned int gid = get_global_id(0);
out[gid] = smoothstep(x[gid], y[gid], z[gid]);
} |
kernel void testFDiv(float2 a, float2 b, global float2* res) {
res[0] = a / b;
} |
kernel void advance_ptcls_angular_damping(global float* xGlob, global float* yGlob, global float* zGlob, global float* vxGlob, global float* vyGlob, global float* vzGlob, const global float* charge, const global float* mass, float eToTheMinusKappaDT, float omega, float minRadius, int nPtcls) {
private
int n = get_gl... |
kernel void clearCounter(global uint4* counters, global uint4* res) {
unsigned int gId = get_global_id(0);
counters[gId] = (uint4)0;
if (gId == 0) {
res[0] = (uint4)0;
}
} |
kernel void simpleIncrement(global float* C) {
C[get_global_id(0)] += 1.0f;
} |
kernel void Integer_addition_18_full(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, a13, a14, a15, a16, a17;
int addend;
a0 = curArray[0];
a1 = curArray[1];
a2 = curArray[2];
a3 = ... |
kernel void bar(global int* out, local int* l1, int a, int b, local int* l2) {
*out = *l1 - a - b - *l2;
} |
kernel void mad_sat_ulong16ulong16ulong16(global ulong16* src_0, global ulong16* src_1, global ulong16* src_2, global ulong16* dst) {
int gid = get_global_id(0);
dst[gid] = mad_sat(src_0[gid], src_1[gid], src_2[gid]);
} |
inline void upsweep_pow2(local int* x, local int* p, int m) {
int lid = get_local_id(0);
int bi = (lid * 2) + 1;
int depth = 1 + (int)log2((float)m);
for (int d = 0; d < depth; d++) {
barrier(0x01);
int mask = (0x1 << d) - 1;
if ((lid & mask) == mask) {
int offset = (0x1 << d);
int ai =... |
kernel void test_block_3_6_kern(global int* a0, global int* a1, global int* a2, global int* b0, global int* b1, global int* b2, global int* b3, global int* b4, global int* b5, local int* c0, local int* c1, local int* c2) {
int i;
unsigned int gtid = get_global_id(0);
unsigned int ltid = get_local_id(0);
size_t ... |
kernel void bar(global int* out, int a, int b) {
*out = a + b;
} |
kernel void point_polygon_expand_back(int group_length, global int* group, int group_temp_length, global int* group_temp, int points_length, global int* points_index, global int* points) {
int idx = get_global_id(0);
if (idx >= group_length)
return;
group[idx] = group_temp[idx];
} |
kernel void BK_norm_beta(const int N, const int current, local float* sm, global float* beta) {
size_t tid = get_local_id(0);
size_t gid = get_global_id(0);
size_t bls = get_local_size(0);
size_t gls = get_global_size(0);
float tidsum = 0.f;
int i;
for (i = gid; i < N; i += gls) {
tidsum += beta[curr... |
kernel void decode_bbox_corner_no_variance_kernel(const global float* loc_data, const global float* prior_data, const int num_priors, const int share_location, const int num_loc_classes, const int background_label_id, global float* bbox_data) {
int index = get_global_id(0);
const int c = index % num_loc_classes;
... |
kernel void find_if(global int* index, global int* _buf0) {
const unsigned int i = get_global_id(0);
const int value = _buf0[1167 + (i)];
if (value >= 3) {
atomic_min(index, i);
}
} |
kernel void doubleGrayScaleCharInt(global char* v, global int* v2) {
unsigned int i = get_global_id(0);
if (i % 3 == 0) {
v[i] = v[i];
v[i + 1] = v[i];
v[i + 2] = v[i];
v2[i] = v2[i];
v2[i + 1] = v2[i];
v2[i + 2] = v2[i];
}
} |
kernel void gpu_memcpy_gather(global float* dest, global float* source) {
int x = get_global_id(0);
int size = get_global_size(0);
dest[x] = source[x];
dest[x + size] = source[x + size];
dest[x + size * 2] = source[x + size * 2];
dest[x + size * 3] = source[x + size * 3];
dest[x + size * 4] = source[x + s... |
kernel void foo(global float4* A, float4 x) {
*A = asinpi(x);
} |
kernel void reduce2(global float* restrict out, global const float2* restrict in, int n_pairs) {
int i = get_global_id(0);
if (i >= n_pairs)
return;
float2 v = in[i];
out[i] = v.x + v.y;
} |
kernel void permute(global const unsigned int* unsortedData, global const unsigned int* scanedBuckets, unsigned int shiftCount, local ushort* sharedBuckets, global unsigned int* sortedData) {
size_t groupId = get_group_id(0);
size_t localId = get_local_id(0);
size_t globalId = get_global_id(0);
size_t groupSize... |
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 kernel_6(global float* inputA, global float* inputB, global float* output, const unsigned int count) {
float D = 0;
for (int i = 0; i < count; i++) {
if (inputA[i] != inputB[i]) {
D += 1;
}
}
output[6] = D;
} |
kernel void compiler_integer_remainder(global int* src, global int* dst, int x) {
dst[get_global_id(0)] = src[get_global_id(0)] % x;
} |
kernel void atomic_same_workitem(global int* data) {
int i = get_global_id(0);
if ((i % 2) == 0) {
data[i] = 0;
atomic_inc(data + i);
} else {
atomic_inc(data + i);
data[i] = data[i] + 1;
}
} |
kernel void Scale(global double* values, int n, const double scaleFactor) {
for (int i = get_global_id(0); i < n; i += get_global_size(0)) {
values[i] *= scaleFactor;
}
} |
kernel void binarySearch(global uint4* outputArray, const global unsigned int* sortedArray, const unsigned int findMe, const unsigned int globalLowerBound, const unsigned int globalUpperBound, const unsigned int subdivSize) {
unsigned int tid = get_global_id(0);
unsigned int lowerBound = globalLowerBound + subdivS... |
kernel void TestMain(global float* inputA, global float* inputB) {
int gid = get_local_id(0);
inputA[gid] = gid;
inputB[gid] = gid * gid;
} |
int bar(global int* x) {
return x[1];
}
kernel void foo(global int* in, global int* out) {
*out = bar(in);
} |
kernel void broadcast(global int* value, global int* output) {
int i = get_global_id(0);
output[i] = value[0];
} |
kernel void backpropNaive(const int N, global const unsigned char* mask, global const float* gradOutput, global float* output) {
const int globalId = get_global_id(0);
if (globalId >= N) {
return;
}
output[globalId] = mask[globalId] == 1 ? gradOutput[globalId] : 0.0f;
} |
kernel void encode(global char* in, global char* out) {
int num = get_global_id(0);
out[num] = in[num] - 1;
} |
kernel void uninitialized_address(global ulong* output) {
int a[] = {1, 2, 3};
volatile int i, j;
a[i] = 4;
output[0] = a[j];
} |
kernel void compiler_local_memory_barrier_2(global int* dst, local int* src) {
src[get_local_id(0)] = get_local_id(0);
src[get_local_size(0) + get_local_id(0)] = get_local_id(0);
barrier(0x01);
dst[get_local_size(0) * (2 * get_group_id(0)) + get_local_id(0)] = src[get_local_size(0) - (get_local_id(0) + 1)];
d... |
kernel void compObjWave_MultiPass_native(global float* pc, unsigned int pc_size, global float2* of, int offset, int num_cols, float hologram_z, float k, float pitch, float corner_x, float corner_y) {
size_t gid = get_global_id(0);
int row = (gid + offset) / num_cols;
int col = (gid + offset) - (row * num_cols);
... |
kernel void foo(global double* out, int in) {
*out = in / 2.304;
} |
kernel void clkernel_rowmax(const unsigned int nrow, const unsigned int ncol, global const float* in, global float* out) {
const unsigned int row_id = get_global_id(0);
if (row_id >= nrow)
return;
float row_max_val = -0x1.fffffep127f;
for (unsigned int i = 0; i < ncol; i++) {
row_max_val = fmax(row_max... |
kernel void post_increment_short16(global short16* src_0, global short16* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid]++;
} |
kernel void get_error_vector(global float* errorVector, global const char* last_boolean_output, global const float* output, unsigned int size) {
for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) {
errorVector[i] = last_boolean_output[i] - output[i];
}
} |
kernel void sumSqInt32Test(int N, int M, global int* deviceInt, local int* localInt, global int* blockResults) {
int i = get_global_id(0);
int j = get_local_id(0);
localInt[j] = deviceInt[i] * deviceInt[i];
barrier(0x01);
if (j == 0) {
int temp = 0;
for (int k = 0; k < M; k++) {
temp += localI... |
kernel void chi(global float* data, global float* data_err, global float* model, global float* output, private unsigned int start, private unsigned int n) {
size_t i = get_global_id(0);
size_t index = start + i;
float temp = 0;
if (i < n)
temp = (data[index] - model[index]) / data_err[index];
output[in... |
kernel void sinpi_float16(global float16* src_0, global float16* dst) {
int gid = get_global_id(0);
dst[gid] = sinpi(src_0[gid]);
} |
inline float sigmoid(float z) {
return 1.0f / (1.0f + exp(-z));
}
inline float sigmoid_gradient(float y) {
return y * (1.0f - y);
}
inline float relu(float z) {
return z > 0 ? z : 0;
}
inline float relu_gradient(float y) {
return y > 0 ? 1 : 0;
}
inline float tanh_gradient(float y) {
return 1.0f - y * y;
}
... |
kernel void test_arg_3_6_kern(global int4* a0, global int4* a1, global int4* a2, global int4* b0, global int4* b1, global int4* b2, global int4* b3, global int4* b4, global int4* b5) {
int4 za = (int4)(0, 1, 2, 3);
unsigned int gtid = get_global_id(0);
int4 tmp0 = a0[gtid] + 0 + za;
int4 tmp1 = a1[gtid] + 1 + z... |
kernel void compute_sp_v2(global float* ptr, float _A) {
float2 x = (float2)(_A, (_A + 1));
float2 y = (float2)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 = mad(y, x, y);
y = mad(x, y, x);
;
x = mad(y, x, y);... |
kernel void test_vector_param(float2 float2, float4 float4, float16 vec16, global float16* out) {
float4.x += float2.x;
float4.y += float2.y;
vec16.x *= float4.x;
vec16.y *= float4.y;
vec16.z *= float4.z;
vec16.w *= float4.w;
*out = vec16;
} |
kernel void or (global int* out, float a, float b) {
out[0] = a || b;
} |
kernel void kern(global float* mat4, global float* float4, global float* outvec4) {
outvec4[0] = float4[3] * mat4[12];
outvec4[1] = float4[3] * mat4[13];
outvec4[2] = float4[3] * mat4[14];
outvec4[3] = float4[3] * mat4[15];
outvec4[0] += float4[2] * mat4[8];
outvec4[1] += float4[2] * mat4[9];
outvec4[2] ... |
kernel void unit_lu_forward(global const unsigned int* row_indices, global const unsigned int* column_indices, global const float* elements, global float* vector, unsigned int size) {
local unsigned int col_index_buffer[128];
local float element_buffer[128];
local float vector_buffer[128];
unsigned int nnz = r... |
constant char mem0[3] = {0};
constant char2 mem2[3] = {(char2)(0)};
constant char3 mem3[3] = {(char3)(0)};
constant char4 mem4[3] = {(char4)(0)};
constant char8 mem8[3] = {(char8)(0)};
constant char16 mem16[3] = {(char16)(0)};
kernel void kernel_memory_alignment_constant(global unsigned int* results) {
results[0] = ... |
kernel void lud_diagonal(global float* m, int matrix_dim, int offset) {
int i, j;
int array_offset = offset * matrix_dim + offset;
for (i = 0; i < 64; i++) {
if (get_local_id(0) > i) {
for (j = 0; j < i; j++)
m[array_offset + get_local_id(0) * matrix_dim + i] -= m[array_offset + get_local_id(0)... |
kernel void slice_fw_kernel(const global float* px, const unsigned shift, const unsigned span, const unsigned skip, const unsigned size, global float* py) {
const unsigned i = get_global_id(0);
if (i < size)
py[i] = px[(i / span) * skip + (i % span) + shift];
} |
kernel void test_degrees(const global float* in, global float* out) {
unsigned int gid = get_global_id(0);
out[gid] = degrees(in[gid]);
} |
kernel void twiddles(global double2* twiddle, int size) {
int idX = get_global_id(0);
twiddle[idX] = (double2)(cos(6.283185307179586476925286766559 * idX / size), -sin(6.283185307179586476925286766559 * idX / size));
} |
kernel void kernel_hypot_withDD1(global float* result_hypot, int N) {
float t1 = 0.0;
float t2 = 1.0;
int i = 0;
for (i = 0; i < N; i++) {
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t2 = hypot(t1, t2);
t... |
kernel void attack(global int* array) {
const int i = get_global_id(0);
array[i] = i;
} |
float boundRange(float x, float lowerLimit, float upperLimit) {
return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x));
}
float Logistic_fn(float x) {
if (x < 88.722839f) {
if (x > -88.722839f)
return (float)1.0 / ((float)1.0 + exp(-x));
else
return 0;
}
return 1;
}
floa... |
kernel void per_element_tiled_add(const int N, const int tilingSize, global float* target, global const float* source) {
const int globalId = get_global_id(0);
if (globalId >= N) {
return;
}
target[globalId] += source[globalId % tilingSize];
} |
constant float chn_6RB_filter_coef[47] = {8.193313185354206e-04, 3.535548569572820e-04, -1.453429245341695e-03, 1.042805860697287e-03, 1.264224526451337e-03, -3.219586065044259e-03, 1.423981657254563e-03, 3.859884310477692e-03, -6.552708013395765e-03, 8.590509694961493e-04, 9.363722386299336e-03, -1.120357391780316e-02... |
kernel void kernel_cbrt_withDD1(global float* result_cbrt, int N) {
float p1 = 345.634;
int i = 0;
for (i = 0; i < N; i++) {
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);
p1 = cbrt(p1);... |
kernel void test_sign_extend(short2 source, global int2* out) {
int2 x = convert_int2(source);
out[0] = x;
out[1] = x + x;
out[2] = x - x;
out[3] = x * x;
out[4] = x / (int2)100;
out[5] = x % (int2)100;
} |
kernel void op(global const int* src, global int* trgt, int work_per_workitem, int src_size) {
int si = work_per_workitem * get_global_id(0);
int ei = min(si + work_per_workitem, src_size);
for (int i = si; i < ei; ++i) {
int r = src[i];
trgt[i] = (r) / ((r) + 1010) + (r) / 1319 + (r) * ((r)-13);
}
} |
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 nddistance(global const float* point1, local const float* float2, const unsigned int dims) {
float distance = 0;
float tmp;
for (int d = 0; d < dims; d++) {
tmp = point1[d] - float2[d];
distance += tmp * tmp;
}
return distance;
}
kernel void float_difference(global float* lhs, global float* r... |
unsigned int w_hash(unsigned int seed) {
seed = (seed ^ 61) ^ (seed >> 16);
seed *= 9;
seed = seed ^ (seed >> 4);
seed *= 0x27d4eb2d;
seed = seed ^ (seed >> 15);
return seed;
}
unsigned int w_rnd_direct(global unsigned int* intSeeds, int id) {
unsigned int rndint = w_hash(intSeeds[id]);
intSeeds[id] = ... |
int max3(int a, int b, int c) {
int k = a > b ? a : b;
return k > c ? k : c;
}
kernel void rhomboid(global const int* S, global int* F, int cols, int penalty, int diagonal) {
int bx = get_group_id(0);
int tx = get_local_id(0);
int height = (cols - 1) / 32;
int margin = 1;
int r0 = diagonal < 2 * height ?... |
kernel void ParallelSelection(global const unsigned int* restrict key_in, global const unsigned int* restrict val_in, global unsigned int* restrict key_out, global unsigned int* restrict val_out) {
int i = get_global_id(0);
int n = get_global_size(0);
unsigned int iKey = key_in[i];
unsigned int iVal = val_in[i]... |
kernel void clkernel_relu(const int num, global const float* in, global float* out) {
const int i = get_global_id(0);
if (i >= num)
return;
out[i] = (in[i] >= 0.0f) ? in[i] : 0.0f;
} |
inline unsigned int lowerBoundBinary(global float* data, unsigned int left, unsigned int right, float searchVal) {
unsigned int firstIndex = left;
unsigned int lastIndex = right;
while (firstIndex < lastIndex) {
unsigned int midIndex = (firstIndex + lastIndex) / 2;
float midValue = data[midIndex];
i... |
kernel void bitonicSort_sharedmem(global unsigned int* data, const unsigned int stage, const unsigned int subStage, const unsigned int direction, local unsigned int* sharedMem) {
unsigned int threadId = get_global_id(0);
unsigned int sortIncreasing = direction;
unsigned int distanceBetweenPairs = 1 << (stage - s... |
kernel void vecAdd(global double* a, global double* b, global double* c, const unsigned int n) {
int id = get_global_id(0);
if (id < n)
c[id] = a[id] + b[id];
} |
kernel void bufferedFilter(global float* lastInput, global float* input, int filterOrder, global float* table, global float* output, int N) {
int idx = get_global_id(0);
int flt = idx / N;
int ind = idx % N;
float val = 0;
for (int i = 0; i < filterOrder; i++) {
int index = ind - i;
float b = table[fl... |
kernel void builtin_atan2(global float* y, global float* x, global float* dst) {
int i = get_global_id(0);
dst[i] = atan2(y[i], x[i]);
} |
kernel void el_wise_mul_div(global float* matrix1, global const float* matrix2, global const float* matrix3, unsigned int size) {
for (unsigned int i = get_global_id(0); i < size; i += get_global_size(0)) {
float val = matrix1[i] * matrix2[i];
float divisor = matrix3[i];
matrix1[i] = (divisor > 0.00001) ?... |
kernel void test_block_2_1_kern(global float* a0, global float* a1, global float* b0, local float* c0, local float* c1) {
int i;
unsigned int gtid = get_global_id(0);
unsigned int ltid = get_local_id(0);
size_t lsz = get_local_size(0);
c0[ltid] = a0[gtid] + 0.1f;
c1[ltid] = a1[gtid] + 1.1f;
barrier(0x01);... |
kernel void not_equal_float2float2(global float2* src_0, global float2* src_1, global int2* dst) {
int gid = get_global_id(0);
dst[gid] = (int2)(src_0[gid] != src_1[gid]);
} |
kernel void fdim_float4float4(global float4* src_0, global float4* src_1, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = fdim(src_0[gid], src_1[gid]);
} |
kernel void sort_test(global long* in, int n) {
int id = get_global_id(0);
if (id >= n)
return;
for (int j = id + 1; j < n; j++) {
if (in[id] > in[j]) {
int temp = in[id];
in[id] = in[j];
in[j] = temp;
}
}
} |
kernel void bitonic_sort_step(global unsigned int* dev_values, int j, int k) {
unsigned int i, ixj;
i = get_global_id(0);
ixj = i ^ j;
if ((ixj) > i) {
if ((i & k) == 0) {
if (dev_values[i] > dev_values[ixj]) {
unsigned int temp = dev_values[i];
dev_values[i] = dev_values[ixj];
... |
kernel void QueryMinimumGranularity(int nLoop, global int* pOut) {
local volatile int flag;
int index = get_global_id(0);
int totalItems = get_global_size(0);
do {
int halfIndex = totalItems / 2;
if (index == 0)
flag = 1;
work_group_barrier(0x01);
if (index < halfIndex) {
for (... |
kernel void compiler_function_argument2(char8 c, uchar8 uc, short8 s, ushort8 us, int8 i, uint8 ui, float8 f, global float8* result) {
result[0] = convert_float8(c);
result[1] = convert_float8(uc);
result[2] = convert_float8(s);
result[3] = convert_float8(us);
result[4] = convert_float8(i);
result[5] = conv... |
kernel void gegl_value_invert(global const float4* in, global float4* out) {
int gid = get_global_id(0);
float4 in_v = in[gid];
float4 out_v;
float value = fmax(in_v.x, fmax(in_v.y, in_v.z));
float minv = fmin(in_v.x, fmin(in_v.y, in_v.z));
float delta = value - minv;
if (value == 0.0f || delta == 0.0f)... |
kernel void mul_hi_long8long8(global long8* src_0, global long8* src_1, global long8* dst) {
int gid = get_global_id(0);
dst[gid] = mul_hi(src_0[gid], src_1[gid]);
} |
kernel void pre_increment_long4(global long4* src_0, global long4* dst) {
int gid = get_global_id(0);
dst[gid] = ++src_0[gid];
} |
kernel void image_filter(global uchar* a, global uchar* output, int n) {
size_t i = get_global_id(0);
if (i * 3 + 2 >= n) {
return;
}
int pixel = i * 3;
uchar sum = (a[pixel] + a[pixel + 1] + a[pixel + 2]) / 3;
output[pixel] = sum;
output[pixel + 1] = sum;
output[pixel + 2] = sum;
} |
kernel void divide(global const float* val1, global const float* val2, global float* result) {
if (get_global_id(0) == 0)
*result = *val1 / *val2;
} |
kernel void clBlockSort(global unsigned int* keyIn, global unsigned int* keyOut, global unsigned int* valIn, global unsigned int* valOut, unsigned int startbit, global unsigned int* blockScan, global unsigned int* blockOffset, unsigned int size, local unsigned int* key, local unsigned int* prefixSum) {
int globalId =... |
kernel void atomTest4(global int* out) {
int lid = get_local_id(0);
out[0] = out[0] + lid;
} |
kernel void AddOne(global float* input, global float* output) {
unsigned int index = get_global_id(0);
output[index] = input[index] + 1.0f;
} |
kernel void addCols(global int* srcArray) {
int gid = get_global_id(0);
int d = 100;
if (gid <= d + 1) {
srcArray[gid * (d + 2) + d + 1] = srcArray[gid * (d + 2) + 1];
srcArray[gid * (d + 2)] = srcArray[gid * (d + 2) + d];
}
} |
kernel void remainder_int8int8(global int8* src_0, global int8* src_1, global int8* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] % src_1[gid];
} |
kernel void addRows(global int* srcArray) {
int gid = get_global_id(0) + 1;
int d = 100;
if (gid <= d) {
srcArray[gid + (d + 2) * (d + 1)] = srcArray[gid + (d + 2)];
srcArray[gid] = srcArray[gid + (d + 2) * d];
}
} |
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));
}
kernel void write_clear(global float* volume) {
volume[get_global_... |
kernel void prescanReduce(global unsigned int const* restrict a, global unsigned int* restrict sum, unsigned int m, unsigned int n) {
size_t localID = get_local_id(0);
size_t groupID = get_group_id(0);
local unsigned int lsum[256];
m >>= 2;
global uint4* a4 = (global uint4*)a;
size_t startIndex = m * gro... |
float sigmoid(const float pNum) {
return (1.0f / (1.0f + native_exp(-pNum)));
}
kernel void applyDelta(const int preP, const int curP, const float eta, global const float* curDelta, global const float* preOutput, const unsigned int preOffset, global float* curWeight) {
const size_t i = get_global_id(0);
if (i < ... |
kernel void test_block_3_1_kern(global int* a0, global int* a1, global int* a2, global int* b0, local int* c0, local int* c1, local int* c2) {
int i;
unsigned int gtid = get_global_id(0);
unsigned int ltid = get_local_id(0);
size_t lsz = get_local_size(0);
c0[ltid] = a0[gtid] + 0;
c1[ltid] = a1[gtid] + 1;
... |
kernel void multi(global double* voctor1, global double* voctor2, global double* result) {
size_t i = get_global_id(0);
result[i] = voctor1[i] * voctor2[i];
} |
kernel void kernel_modtest_write(global char* ptr, unsigned long memsize, unsigned int offset, unsigned long p1, unsigned long p2) {
int i;
global unsigned long* buf = (global unsigned long*)ptr;
int idx = get_global_id(0);
unsigned long n = memsize / sizeof(unsigned long);
int total_num_threads = get_global_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.