kernel_code stringlengths 49 1.22M |
|---|
constant char g_aucConvertToBit[(1 << (7)) + 1] = {-1, -1, -1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1... |
kernel void vectorAdd(global const int* inputA, global const int* inputB, global int* output) {
output[get_global_id(0)] = inputA[get_global_id(0)] + inputB[get_global_id(0)];
} |
unsigned char threshold(unsigned char in) {
if (in > 100)
return 255;
return 0;
}
kernel void render(global char* input, global char* output, int width, int height) {
unsigned int i = get_global_id(0);
unsigned int i_mul_4 = i * 4;
output[i_mul_4] = threshold(input[i_mul_4]);
output[i_mul_4 + 1] = th... |
kernel void foo(global int* out, int a) {
*out = a + get_global_id(0);
} |
kernel void test_absdiff_char2(global char2* srcA, global char2* srcB, global uchar2* dst) {
int tid = get_global_id(0);
char2 sA, sB;
sA = srcA[tid];
sB = srcB[tid];
uchar2 dstVal = abs_diff(sA, sB);
dst[tid] = dstVal;
} |
kernel void foo(global float4* in, global float4* out) {
*out = min(in[0], in[1]);
} |
kernel void MaxPoolForward(const int nthreads, global const float* bottom_data_data, int bottom_data_offset, const int num, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int kernel_h, const int kernel_w, const int stride_h, const int stride_w, const int pa... |
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... |
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 additiveBlend(float v1, float v2, float blendFactor) {
float res = (v1 * (1.0f - blendFactor)) + (v2 * blendFactor);
if (res > 255.0f) {
res = 255.0f;
}
return res;
}
kernel void additive(global float* appFrame, global float* frame1, global float* frame2, global float* frame3, global float* frame4, g... |
kernel void linear(global int* output, const unsigned int count) {
size_t i = get_global_id(0);
output[i] = i;
} |
kernel void test_kernel(global unsigned char* src, global unsigned char* dst, int multiplier) {
dst[get_global_id(0)] = src[get_global_id(0)] * multiplier;
} |
kernel void clCode(global const int* in, global int* sum) {
size_t i = get_global_id(0);
*sum += in[i];
} |
kernel void to_gray4(global uchar4* aBufferIn, global uchar4* aBufferOut) {
int global_id = get_global_id(0);
uchar gray = aBufferIn[global_id].x * 0.299 + aBufferIn[global_id].y * 0.587 + aBufferIn[global_id].z * 0.114;
aBufferOut[global_id] = (uchar4)(gray, gray, gray, aBufferIn[global_id].w);
} |
kernel void scaleBiasVertices(global float* vertices, float4 scaleBias) {
unsigned int gid = get_global_id(0);
float3 vertex = vload3(gid, vertices);
vertex = fma(vertex, scaleBias.w, scaleBias.xyz);
vstore3(vertex, gid, vertices);
} |
kernel void test_uchar4(global uchar* pin, global uchar* pout) {
int x = get_global_id(0);
uchar4 value;
value = vload4(x, pin);
value += (uchar4){(uchar)1, (uchar)2, (uchar)3, (uchar)4};
vstore4(value, x, pout);
} |
kernel void mod(global uchar* out, uchar a, uchar b) {
out[0] = a % b;
} |
kernel void clz_char8(global char8* src_0, global char8* dst) {
int gid = get_global_id(0);
dst[gid] = clz(src_0[gid]);
} |
kernel void coulomb2(global double* o, global int* s, global int* q, int n, int c2, global int* w, int xsize, int ysize, double prefactor) {
int qi = q[get_group_id(0)];
int si = w[get_group_id(0)];
int zi = (si) / (xsize * ysize);
int yi = (si) / (xsize) - (zi * ysize);
int xi = (si) % (xsize);
local int... |
kernel void kernel_12(global float* inputA, global float* inputB, global float* output, const unsigned int count) {
float A = 0;
for (int i = 0; i < count; i++) {
A += sqrt(inputA[i] * inputB[i]);
}
output[12] = sqrt(2 - 2 * A);
} |
kernel void clkernel_ge(const int num, global const float* in, const float x, global float* out) {
const int i = get_global_id(0);
if (i >= num)
return;
out[i] = (in[i] >= x) ? 1.0f : 0.0f;
} |
kernel void kernel_red_recurse(global int* dst, global int* src, int numElems) {
int index = 64 * get_global_id(0);
if (index >= numElems)
return;
int i = index;
if (i < 64)
return;
int a = 0;
while (i >= 64) {
a += src[i];
i -= 64;
}
dst[index] = a;
} |
kernel void add_vectors(global const float2* src1, global const float2* src2, global float2* dest) {
int gid = get_global_id(0);
dest[gid] = (float2)((src1[gid].x + src2[gid].x), (src1[gid].y + src2[gid].y));
} |
kernel void serial_accumulate(int init, unsigned int count, global int* _buf0) {
int result = init;
for (unsigned int i = 0; i < count; i++)
result = ((result) + ((0 + i)));
_buf0[0] = result;
} |
kernel void incTask(global int* vector, int size) {
for (int i = 0; i < size; i++)
vector[i] = vector[i] + 1;
} |
kernel void test_stream_read_char(global char* dst) {
dst[0] = (char)'w';
} |
inline float pow3add4(float x) {
return pow(x, 3.0f) + 4.0f;
}
kernel void copy(global float* _buf0, global float* _buf1, const unsigned int count) {
unsigned int index = get_local_id(0) + (32 * get_group_id(0));
for (unsigned int i = 0; i < 4; i++) {
if (index < count) {
_buf0[index] = pow3add4(_buf1[... |
kernel void test_block_1_4_kern(global int* a0, global int* b0, global int* b1, global int* b2, global int* b3, local int* c0) {
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;
barrier(0x01);
int tmp0 = 0;
for (i ... |
kernel void atomTest2(global int* out) {
int gid = get_global_id(0);
int lid = get_local_id(0);
local int test[6];
if (lid < 6)
test[lid] = 0;
int a = 1;
int t1 = atomic_min(&out[0], gid);
int t2 = atomic_min(&test[0], lid);
out[1] = test[0];
int t3 = atomic_max(&out[2], gid);
int t4 = atomic_... |
struct ResLine {
long v0;
long v1;
long v2;
long v3;
long v4;
long v5;
};
kernel void copy_test(global int* dest, global int* src, unsigned length) {
int i = get_global_id(0);
if (i < length) {
dest[i] = src[i];
}
} |
kernel void ker_power_fwd_f4(global float* out_data, const int count, const float scale, const float shift, const float power, global const float* in_data) {
int global_idx = get_global_id(0);
global float4* vsrc;
global float4* vdst;
float4 in_data_private;
vsrc = (global float4*)(&in_data[global_idx * 4]);... |
typedef float2 float2;
float fact(float n) {
float f = 1.0f;
if (n <= 0.0f)
return 1.0f;
while (n > 1.0f)
f *= n--;
return f;
}
int L(int a, int b, int x) {
if (b == 0)
return fact(a);
else if (b == 1)
return fact(a + 1) * (a + 1 - x);
if (a == 0) {
if (b == 2)
return 2 - (4... |
kernel void reduce4(global float* restrict out, global const float4* restrict in, int n_quarts) {
int i = get_global_id(0);
if (i >= n_quarts)
return;
float4 v = in[i];
out[i] = (v.x + v.y) + (v.z + v.w);
} |
kernel void clz_short2(global short2* src_0, global short2* dst) {
int gid = get_global_id(0);
dst[gid] = clz(src_0[gid]);
} |
kernel void kernel_remainder_withDD1(global float* result_remainder, int N) {
float t1 = 4.3;
float t2 = 1.1;
int i = 0;
for (i = 0; i < N; i++) {
t1 += remainder(t1, t2);
t1 += remainder(t1, t2);
t1 += remainder(t1, t2);
t1 += remainder(t1, t2);
t1 += remainder(t1, t2);
t1 += remainder(... |
kernel void MaxPoolingBackward(global float* deltaInput, global float* deltaOutput, global bool* switches, global int* poolingTable, const int inputVolume, const int inputArea, const int outputVolume, const int outputArea, const int miniBatchSize) {
const int iOutput = get_global_id(0);
if (iOutput < outputVolume ... |
__attribute__((reqd_work_group_size(512, 1, 1))) __attribute__((reqd_work_group_size(512, 1, 1))) kernel void Slice_normal(const int nthreads, global const float* in_data, const int num_slices, const int slice_size, const int in_slice_axis_size, const int out_slice_axis_size, const int offset_slice_axis, global float* ... |
kernel void TestDynCheckSpeed(global int* output, global int* input, global float* dct8x8, local float* inter, const unsigned int width, const unsigned int blockWidth, const unsigned int inverse) {
unsigned int globalIdx = get_global_id(0);
output[globalIdx * 2] = ((globalIdx << 3) + 1) & 15;
} |
kernel void array_sub_u64(global const ulong* a, global const ulong* b, global ulong* c) {
unsigned int i = get_global_id(0);
c[i] = a[i] - b[i];
} |
kernel void writeLocalMemory(global float* output, int size, int stride) {
int gid = get_global_id(0);
int j = 0;
int tid = get_local_id(0), localSize = get_local_size(0), litems = 2048 / localSize;
int s = tid;
int baseIndex = (s >> 4) << 4;
local float lbuf[2048];
for (j = 0; j < 3000; ++j) {
lbuf[... |
kernel void bitset_nand(global unsigned int* bs1, global unsigned int* bs2, const unsigned int subset_count) {
unsigned int i = get_global_id(0);
if (i < subset_count) {
bs1[i] = ~(bs1[i] & bs2[i]) & bs1[i];
}
} |
kernel void clean_mcd15a3_qa(global const float* lai, global const int* laiqa, global float* lai_clean, global const int* N) {
int i = get_global_id(0);
if (i < N) {
if (laiqa[i] & 0x01) {
lai_clean[i] = -28768;
} else {
lai_clean[i] = lai[i];
}
}
} |
kernel void _idctcol(global int* blk) {
private
int8 x;
private
int8 y;
private
int x8;
x.s0 = (blk[8 * 0] << 8) + 8192;
x.s1 = (blk[8 * 4] << 8);
x.s2 = blk[8 * 6];
x.s3 = blk[8 * 2];
x.s4 = blk[8 * 1];
x.s5 = blk[8 * 7];
x.s6 = blk[8 * 5];
x.s7 = blk[8 * 3];
x8 = 565 * (x.s4 + x.s5) + 4;
... |
kernel void sub(global unsigned int* out, unsigned int a, unsigned int b) {
out[0] = a - b;
} |
kernel void add_sat_longlong(global long* src_0, global long* src_1, global long* dst) {
int gid = get_global_id(0);
dst[gid] = add_sat(src_0[gid], src_1[gid]);
} |
typedef int2 int2;
inline float sigmoid(float f) {
return 1.0 / (1.0 + exp(-f));
}
inline float sigmoid_derivative(float f) {
return sigmoid(f) * (1.0 - sigmoid(f));
}
;
;
inline float relu(float f) {
return max(0.f, f);
}
inline float relu_derivative(float f) {
return f < 0 ? 0 : 1;
}
kernel void ReLU(uns... |
kernel void foo(global uchar* a, global uchar* b, global uchar* c) {
*a = max(*b, *c);
} |
kernel void sub_sat_ulong16ulong16(global ulong16* src_0, global ulong16* src_1, global ulong16* dst) {
int gid = get_global_id(0);
dst[gid] = sub_sat(src_0[gid], src_1[gid]);
} |
inline float activation(float in) {
float output = in;
return output;
}
inline float4 activation_type4(float4 in
) {
float4 output = in;
return output;
}
kernel void sigmoid(global const float* x_data, const int count, global float* out_data) {
const int index = get_global_id(0);
if (index < count) {
... |
kernel void matrixAdd(global const float* a, global const float* b, global float* c, int n) {
int gid = get_global_id(0);
c[gid] = a[gid] + b[gid] + n;
} |
kernel void assignLocal(global int* A, global int* B, global int* C) {
int tid = get_global_id(0);
C[tid] = 1;
} |
kernel void test_arg_6_2_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, global float4* a4, global float4* a5, 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;
float... |
kernel void CreatePaddingLookupTable(global int* paddingLookupTable, const int unpaddedWidth, const int unpaddedDepth, const int padding) {
const int iUnpadded = get_global_id(0);
const int unpaddedArea = unpaddedWidth * unpaddedWidth;
const int unpaddedVolume = unpaddedDepth * unpaddedArea;
const int nZerosTo... |
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 reduce_add_3(global const int* A, global int* B, local int* scratch) {
int id = get_global_id(0);
int lid = get_local_id(0);
int N = get_local_size(0);
scratch[lid] = A[id];
barrier(0x01);
for (int i = 1; i < N; i *= 2) {
if (!(lid % (i * 2)) && ((lid + i) < N))
scratch[lid] += scra... |
kernel void kernel_rint_withDD1(global float* result_rint, int N) {
float t1 = 1.0023;
int i = 0;
for (i = 0; i < N; i++) {
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 + rint(t1);
t1 = 1.6 +... |
kernel void dummy(global int* restrict s) {
s[get_global_id(0)] = get_global_id(0);
} |
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 compiler_ctz_int(global int* src, global int* dst) {
global int* A = &src[get_global_id(0)];
global int* B = &dst[get_global_id(0)];
*B = ctz(*A);
} |
kernel void kernel_erf_withDD1(global float* result_erf, int N) {
float t1 = 1.1;
int i = 0;
for (i = 0; i < N; i++) {
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1);
t1 = erf(t1... |
kernel void vglClCumSumNorm(global int* cumsum, int size, int norm_total) {
int index = get_global_id(0);
int global_size = get_global_size(0) * 2;
int offset = 1;
for (int d = global_size >> 1; d > 0; d >>= 1) {
if (index < d) {
int ai = offset * (2 * index + 1) - 1;
int bi = offset * (2 * ind... |
kernel void test_copy_buffer_row(global int* src, global int* dst, global int* data) {
int row = data[0];
int size = data[1];
int id = (int)get_global_id(0);
for (; id < size; id += row)
dst[id] = src[id];
} |
float form_volume(void);
float Iq(float q, float radius2, float arms);
float Iqxy(float qx, float qy, float radius2, float arms);
float _mass_fractal_kernel(float q, float radius2, float arms) {
float u_2 = radius2 * pow(q, 2);
float v = u_2 * arms / (3.0f * arms - 2.0f);
float term1 = v - 1.0f + exp(-v);
floa... |
kernel void mergeData(global unsigned char* input, unsigned int dataSize, unsigned int partsCount, global unsigned char* output, unsigned int outputSize) {
int wiId = get_global_id(0);
int offset;
int partSize = dataSize / partsCount;
int tmp;
int i, j;
if (wiId == 0) {
for (i = 0; i < partsCount; i++... |
kernel void rand(global float* matrix, float lowerLimit, float upperLimit, int seed) {
int iGID = get_global_id(0);
seed = (seed * iGID) % 10000;
int times = (66941 * seed + 92655) % 10;
for (int i = 0; i < times; i++) {
seed = (66941 * seed + 92655) % 10000;
}
matrix[iGID] = (upperLimit - lowerLimit) /... |
kernel void test_int(global int* C, global int* A, global int* B) {
int id = get_global_id(0);
C[id] = sub_sat(A[id], B[id]);
} |
kernel void isnan_float16(global float16* src_0, global int16* dst) {
int gid = get_global_id(0);
dst[gid] = (int16)(isnan(src_0[gid]));
} |
constant unsigned int ppp[2][3] = {{1, 2, 3}, {5}};
kernel void foo(global unsigned int* A, unsigned int i) {
*A = ppp[i][i];
} |
kernel void hello_world(global char16* out) {
const char16 text = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\0', '\0', '\0', '\0'};
size_t id = get_global_id(0);
out[id] = text;
} |
kernel void vec_add(global const float* a, global const float* b, int N, global float* c) {
int nIndex = get_global_id(0);
if (nIndex >= N)
return;
c[nIndex] = a[nIndex] + b[nIndex];
} |
kernel void amdMADFFTBlock(global const float* inSignal, global const float* inIR, global float* out, int blockOffset, int blockLength, int maxBlockNum) {
int glbl_id = get_global_id(0);
int inIndex = (glbl_id + blockOffset * blockLength) % (maxBlockNum * blockLength);
out[glbl_id] = inIR[glbl_id] * inSignal[in... |
float4 project_point(const global float* point, const global float4* transaxes, const unsigned int dims) {
float4 projpoint = {0, 0, 0, 0};
for (unsigned int i = 0; i < dims; i++) {
projpoint += point[i] * transaxes[i];
}
return projpoint;
}
kernel void project_all_points(
global const float* ndpoints... |
kernel void xcorr_half_improved(global short2* in1, global short2* in2, global short2* out) {
int offset = get_global_id(0);
int len = get_global_size(0);
int res1 = 0, res2 = 0, i = 0;
do {
res1 += in1[i].x * in2[i + offset].x;
res1 += in1[i].y * in2[i + offset].y;
res2 += in1[i].x * in2[i + offset... |
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);
}
int crossWalk(float x, float y) {
float sx = x * 32 + 1;
float sy = y * 32 + 1;
int ix = (int)sx;
int iy = (int)sy;
float fx = sx - ix;
float fy = ... |
kernel void subtract_uchar2uchar2(global uchar2* src_0, global uchar2* src_1, global uchar2* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] - src_1[gid];
} |
kernel void gegl_threshold(global const float2* in, global const float* aux, global float2* out, float value) {
int gid = get_global_id(0);
float2 in_v = in[gid];
float aux_v = (aux) ? aux[gid] : value;
float2 out_v;
out_v.x = (in_v.x >= aux_v) ? 1.0f : 0.0f;
out_v.y = in_v.y;
out[gid] = out_v;
} |
int f(private int x, private int y) {
int x0 = x;
return (x0 + y);
}
kernel void brahmaKernel(global int* buf) {
buf[0] = f(7, 8);
} |
kernel void plus_1d(global float* input, global float* output, const unsigned int count) {
unsigned int global_index = get_global_id(0);
if (global_index < count) {
float s = output[global_index];
float a = input[global_index];
for (long i = 0; i < 1024 * 1024 * 16; i++) {
s = s + a;
}
out... |
kernel void kernel_add_withDD2(global float* result_add, int N) {
float t1 = 1.0f;
float2 t2 = t1 + (float2)(0, 0.1);
int i = 0;
for (i = 0; i < N; i++) {
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.f;
t2 += 10.... |
kernel void test(global float* inout) {
const int globalid = get_global_id(0);
inout[globalid] = inout[globalid] + 7;
} |
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; ... |
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 predec(global char* out, char in) {
out[0] = --in;
} |
kernel void test_arg_5_3_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, global float4* a4, global float4* b0, global float4* b1, global float4* b2) {
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 vload_bench_10000ushort4(global ushort* src, global unsigned int* dst, unsigned int offset) {
int id = (int)get_global_id(0);
uint4 srcV = 0;
for (int i = 0; i < 10000; i++) {
srcV += convert_uint4(vload4(id + (i & 0xFFFF), src + offset));
}
vstore4(srcV, id, dst);
} |
kernel void sample_test2(global int* src, global float* dst) {
int tid = get_global_id(0);
dst[tid] = (float)src[tid];
} |
kernel void vec_sub(global const float* a, global const float* b, global float* c, int N) {
int nIndex = get_global_id(0);
if (nIndex >= N)
return;
c[nIndex] = a[nIndex] - b[nIndex];
} |
kernel void simple_add(global int* A, global int* C, int W, int H) {
const int k = get_global_id(0);
if (k >= 0 && k < W * H) {
const int i = k / H;
const int j = k % H;
int sum = 0;
const int left = (i + W - 1) % W;
const int right = (i + 1) % W;
const int down = (j + 1) % H;
const i... |
kernel void compiler_bitcast_short4_to_long(global short4* src, global ulong* dst) {
int tid = get_global_id(0);
short4 v = src[tid];
ulong dl = __builtin_astype((v), ulong);
dst[tid] = dl;
} |
short4 custom_as_short4(int2 val) {
return ((union {
int2 src;
short4 dst;
}){.src = val})
.dst;
}
uchar8 custom_as_uchar8(int2 val) {
return ((union {
int2 src;
uchar8 dst;
}){.src = val})
.dst;
}
kernel void test_as_type(int2 source, glob... |
kernel void WipeBufferFloatKernel(global float* buffer, const int nBufferElements) {
const unsigned int i = get_global_id(0);
if (i < nBufferElements) {
buffer[i] = 0.0f;
}
} |
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]... |
constant float coeff51[] = {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f... |
float calc_wave(float4 pjm1, float4 p, float4 pjp1, float4 pn1, int choice, float k, float ymin, float ymax, float dt, float dx) {
float invdx = 1.f / dx;
float4 newp = (float4)(0.f, 0.f, 0.f, 0.f);
if (choice == 1) {
newp = 2.f * p - pn1 + k * k * dt * dt * invdx * invdx * (pjp1 - 2.f * p + pjm1);
} else ... |
kernel void atomic_out_of_bounds(global int* counters) {
int i = get_global_id(0);
atomic_inc(counters + i);
} |
kernel void vload_bench_1int16(global int* src, global unsigned int* dst, unsigned int offset) {
int id = (int)get_global_id(0);
uint16 srcV = 0;
for (int i = 0; i < 1; i++) {
srcV += convert_uint16(vload16(id + (i & 0xFFFF), src + offset));
}
vstore16(srcV, id, dst);
} |
kernel void kernel_sinh_withoutDD1(global float* result_sinh, int N) {
float t1 = 0.123;
float t2 = 1.0;
float t3 = t2;
float t4 = t3;
float t5 = t4;
float t6 = t5;
float t7 = t6;
float t8 = t7;
float t9 = t8;
float t10 = t9;
float p1 = 0.01;
float p2 = 0.02;
float p3 = 0.03;
float p4 = 0.04... |
constant unsigned int sbox[8][4][16] = {
{{0xe, 0x4, 0xd, 0x1, 0x2, 0xf, 0xb, 0x8, 0x3, 0xa, 0x6, 0xc, 0x5, 0x9, 0x0, 0x7}, {0x0, 0xf, 0x7, 0x4, 0xe, 0x2, 0xd, 0x1, 0xa, 0x6, 0xc, 0xb, 0x9, 0x5, 0x3, 0x8}, {0x4, 0x1, 0xe, 0x8, 0xd, 0x6, 0x2, 0xb, 0xf, 0xc, 0x9, 0x7, 0x3, 0xa, 0x5, 0x0}, {0xf, 0xc, 0x8, 0x2, 0x4, 0... |
kernel void vector_add(global const int* A, global const int* B, global int* C) {
int i = get_global_id(0);
C[i] = A[i] + B[i];
} |
kernel void fsk(global int* global_sim, global const float* graph_a, global const float* graph_b, global float* BtoA_similarities, global float* BtoA_temp, global float* BtoA_temp_global, const int fv_length, const int graph_b_size, const float delta, const int num_threads, const int work_group_size, const int work_gro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.