kernel_code stringlengths 49 1.22M |
|---|
int compare(global const uchar* text, local const uchar* pattern, unsigned int length) {
for (unsigned int l = 0; l < length; ++l) {
if ((('A' <= (text[l]) && (text[l]) <= 'Z') ? ((text[l] - 'A') + 'a') : (text[l])) != pattern[l])
return 0;
}
return 1;
}
kernel void StringSearchNaive(global uchar* text,... |
kernel void scan_1c(global int* input, global int* output, local int* b, local int* c) {
unsigned int gid = get_global_id(0);
int i;
if (gid == 0) {
output[0] = input[0];
output[256] = input[256];
output[512] = output[512];
for (i = 1; i < 256; i++) {
output[i] = output[i - 1] + input[i];
... |
kernel void test_clamp(global uchar2* out, global uchar2* in) {
*out = clamp(*in, (uchar2)7, (uchar2)42);
} |
kernel void compiler_ctz_uint(global unsigned int* src, global unsigned int* dst) {
global unsigned int* A = &src[get_global_id(0)];
global unsigned int* B = &dst[get_global_id(0)];
*B = ctz(*A);
} |
kernel void TanhForward(global float* activations, global float* preActivations, const float beta, const int nActivations) {
int iActivation = get_global_id(0);
if (iActivation < nActivations) {
float tmp = exp(2 * beta * preActivations[iActivation]);
activations[iActivation] = native_divide(tmp - 1, tmp +... |
kernel void compiler_rotate(global int* src, global int* dst, global int* y) {
int i = get_global_id(0);
dst[i] = rotate(src[i], y[i]);
} |
kernel void dot_product_child(global const int* a, global int* b, global int* c) {
int gid = get_global_id(0);
int res;
int max = get_global_size(0);
if (gid < 128)
res = b[gid] + b[gid + 128];
else if (gid > max - 128)
res = b[gid] + b[gid - 128];
else
res = b[gid - 128] + b[gid] + b[gid + 128]... |
constant int opencl_version = 2;
constant int have_cl_khr_fp64 = 0;
constant int have_cl_khr_fp16 = 0;
kernel void testkernel(global int* data) {
char ca = 2;
char cb = 1;
uchar uca = 2;
uchar ucb = 1;
char4 c4a = (char4)(2, 4, 8, 16);
char4 c4b = (char4)(1, 2, 8, 4);
uchar4 uc4a = (uchar4)(2, 4, 8, 16);
... |
kernel void arithmetic(global float* in1, global float* in2, global float* out) {
int i = get_global_id(0);
out[i] = in1[i] * in2[i];
} |
kernel void gpu_csr_ve_slm_pm_fs(global int* rowptr, global int* colid, global int* randlist, global int* vplist, int float3, global char* over, int rownum, int mid) {
int tid = get_global_id(0);
int getnumsum = get_global_size(0);
for (; tid < mid; tid += getnumsum) {
if (vplist[tid] != 0xffffff00)
co... |
kernel void fill(const unsigned int seed, global unsigned int* multiplicands, global unsigned int* result, const unsigned int offset) {
const unsigned int i = get_global_id(0);
result[offset + i] = seed * multiplicands[i];
} |
kernel void test_tmu_loads(const global int16* in0, const global int16* in1, const global int16* in2, global int16* out) {
unsigned lid = get_local_id(0);
out[lid] = in0[lid] + in1[lid] + in2[lid];
int16 a = in0[16];
int16 b = in0[17];
int16 c = in0[18];
int16 d = in0[19];
int16 e = in1[16];
int16 f = ... |
kernel void affect(global float* positionVectors, global float* velocityVectors, global float* mass, float deltaTime, int vectorCount) {
int id = get_global_id(0);
int vectorNumber = id * 3;
for (int j = 0; j < vectorCount; j++) {
int otherVectorNumber = j * 3;
if (vectorNumber != otherVectorNumber) {
... |
kernel void compute_sum(global int* a, int n, global int* tmp_sum, global int* sum) {
int tid = get_local_id(0);
int lsize = get_local_size(0);
int i;
tmp_sum[tid] = 0;
for (i = tid; i < n; i += lsize)
tmp_sum[tid] += a[i];
for (i = hadd(lsize, 1); lsize > 1; i = hadd(i, 1)) {
barrier(0x02);
i... |
kernel void BasicADD(global float* accumulator, global float* varB, global float* varC) {
unsigned int id = get_global_id(0);
accumulator[id] = varB[id] + varC[id];
} |
inline ulong rotr64(const ulong w, const unsigned c) {
return (w >> c) | (w << (64 - c));
}
constant const uchar blake2b_sigma[12][16] = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3}, {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4}, {7, 9, 3, 1... |
kernel void render(global unsigned char* input, global unsigned char* output, int width, int height) {
unsigned int pos = get_global_id(0);
unsigned int x, y;
unsigned int i_mul_4 = pos * 4;
x = pos / width;
y = pos % width;
unsigned char i_00[(7 * 7)];
unsigned int summ, aver, disp, len, curr_disp, c... |
kernel void IA_25_DA_5(global int* intArray, global float* floatArray, global double* doubleArray, long iteration, int interval) {
int offset = get_global_id(0) * interval;
global int* curIntArray = intArray + offset;
global double* curDoubleArray = doubleArray + offset;
int i0, i1, i2, i3, i4;
double d0, d1... |
kernel void ScanLargeArrays_kernel(global int* restrict output, global int* restrict input, const unsigned int block_size, global int* restrict sumBuffer) {
int tid = get_local_id(0);
int gid = get_global_id(0);
int bid = get_group_id(0);
local int block[512];
block[2 * tid] = input[2 * gid];
block[2 * ti... |
kernel void real_product(global float* a, global float* b, global float* out) {
if (get_global_id(0) == 0)
(*out) = (*a) * (*b);
} |
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 foo(global float3* A, float3 x) {
*A = atanpi(x);
} |
kernel void kernelLong(long16 input, global long16* output) {
output[0] = input;
} |
kernel void initialdata(global double2* u, global double2* v, const int Nx, const int Ny, const double Lx, const double Ly) {
const int ind = get_global_id(0);
int i, j;
j = floor((double)(ind) / (double)Nx);
i = ind - j * Nx;
double x = (-1.0 + (2.0 * (double)i / (double)Nx)) * 3.14159265358979323846f * Lx;
... |
kernel void foo(double a1, global float* h, global float* b0, global double* b1, global double8* d) {
*h = -*h;
*b0 = -*b0;
*b1 = -a1;
*d = -*d;
} |
kernel void addAt(global double* a, const int offset, const double v) {
a[offset] += v;
} |
kernel void sortCorners_bitonicSort(global float2* corners, const int count, const int stage, const int passOfStage) {
const int threadId = get_global_id(0);
if (threadId >= count / 2) {
return;
}
const int sortOrder = (((threadId / (1 << stage)) % 2)) == 1 ? 1 : 0;
const int pairDistance = 1 << (stage ... |
kernel void copy_kern(int n, global float4* b, global float4* a) {
int gti = get_global_id(0);
b[gti] = a[gti];
} |
kernel void fir_half_improved(global short2* in, global short2* coeff, global short2* out, int filter_len) {
unsigned int index = get_global_id(0);
int i = 0, acc1 = 0, acc2 = 0;
do {
acc1 += in[index + i].x * coeff[i].x;
acc1 += in[index + i].y * coeff[i].y;
acc2 += in[index + i].y * coeff[i].x;
... |
kernel void skip2cols(global float2* in, global float2* out, unsigned int len_in) {
const size_t n = get_global_size(0);
const size_t m = get_global_id(0);
const size_t sub_len = len_in / n;
const size_t base_idx = m * sub_len;
size_t i;
for (i = 0; i < sub_len; i++) {
out[i * n + m] = in[base_idx + i]... |
kernel void test_arg_1_2_kern(global int4* a0, global int4* b0, global int4* b1) {
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);
} |
kernel void test_arg_1_6_kern(global int4* a0, 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;
b0[gtid] = (0 + 1) * (+tmp0);
b1[gtid] = (1 + 1) * (+tmp0);
... |
kernel void tan_float(global float* src_0, global float* dst) {
int gid = get_global_id(0);
dst[gid] = tan(src_0[gid]);
} |
kernel void test_arg_3_6_kern(global float4* a0, global float4* a1, global float4* a2, global float4* b0, global float4* b1, global float4* b2, global float4* b3, global float4* b4, global float4* b5) {
float4 za = (float4)(0.75f, 0.5f, 0.25f, 0.33f);
unsigned int gtid = get_global_id(0);
float4 tmp0 = a0[gtid] +... |
kernel void compiler_long_rem(global long* srcA, global long* srcB, global long* dst) {
int tid = get_global_id(0);
dst[tid] = srcA[tid] % srcB[tid];
} |
kernel void subtract_kernel2D(global float* input, uint4 inputDimension, global float* subImg) {
const unsigned int idx = get_global_id(0);
const unsigned int w = idx % (inputDimension.x * inputDimension.y);
const float out_val = input[idx] - subImg[w];
input[idx] = out_val;
} |
kernel void kernelShort(global short* input, global short* output, unsigned int count) {
unsigned int i = get_global_id(0);
if (i < count)
output[i] = input[i];
} |
kernel void vecsum(float k, global float* aBuffer, global float* bBuffer, global float* cBuffer, int size) {
size_t globalId = get_global_id(0);
if (globalId < size)
cBuffer[globalId] = k * aBuffer[globalId] + bBuffer[globalId];
} |
struct bench_args_t {
double m1[64 * 64];
double m2[64 * 64];
double prod[64 * 64];
};
kernel void __attribute__((task)) workload(global double* restrict m1, global double* restrict m2, global double* restrict prod) {
int i, k, j, jj, kk;
int i_row, k_row;
double temp_x, mul;
loopjj:
for (jj = 0; jj < 6... |
kernel void rhadd_ulong8ulong8(global ulong8* src_0, global ulong8* src_1, global ulong8* dst) {
int gid = get_global_id(0);
dst[gid] = rhadd(src_0[gid], src_1[gid]);
} |
kernel void bitset_or(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] |= bs2[i];
}
} |
kernel void update_kk(global double* A, unsigned int N, unsigned int k) {
A[k * N + k] = sqrt(A[k * N + k]);
} |
kernel void multiply_by_scalar(global float const* const src, private float const coeff, global float* const res) {
unsigned int const idx = get_global_id(0);
res[idx] = src[idx] * coeff;
} |
kernel void mul_hi_long16long16(global long16* src_0, global long16* src_1, global long16* dst) {
int gid = get_global_id(0);
dst[gid] = mul_hi(src_0[gid], src_1[gid]);
} |
kernel void serial_count_if_int_equal(unsigned int size, global unsigned int* result, global int* _buf0) {
unsigned int count = 0;
for (unsigned int i = 0; i < size; i++) {
const int value = _buf0[i];
if (value == 2) {
count++;
}
}
*result = count;
} |
typedef unsigned int uint32_t;
kernel void serpent_encrypt(global unsigned char* _key, global unsigned char* _plaintext, global unsigned char* ciphertext) {
ciphertext[0] = _plaintext[0];
ciphertext[1] = _plaintext[1];
ciphertext[2] = _plaintext[2];
ciphertext[3] = _plaintext[3];
ciphertext[4] = _plaintext[4]... |
kernel void add_mul_const_with_thresh_kernel(global float* input, const float add_value, const float mul_value) {
const float short_lim = log((float)65535);
const unsigned int idx = get_global_id(0);
const float out_val = (input[idx] + add_value) * mul_value;
if (out_val < 0.0f) {
input[idx] = 0.0f;
} els... |
kernel void test(global float4* vert) {
unsigned int n = get_global_id(0);
if (n == 0)
vert[n] = (float4)(-0.5f, 0.5f, 0.0f, 1.0f);
else if (n == 1)
vert[n] = (float4)(-0.5f, 0.0f, 0.0f, 1.0f);
else if (n == 2)
vert[n] = (float4)(0.0f, 0.0f, 0.0f, 1.0f);
} |
kernel void test_switch_2(global int* out, global const int* in, global const int* cond) {
unsigned int gid = get_global_id(0);
int val = in[gid];
switch (cond[gid]) {
case 0:
out[gid] = -val + 42;
break;
case 17:
out[gid] = val;
break;
}
} |
kernel void brahmaKernel(global int* buf) {
int x = 2;
buf[0] = x;
int y = 2;
buf[1] = y;
} |
kernel void partitionData(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;
unsigned char digest[16];
unsigned char fromTmp[sizeof(long)], toTmp[sizeof(long)];
long from, to;
long su... |
kernel void scan1(global int* restrict out, global const int* restrict in, local int* restrict lmem, unsigned int nels) {
const unsigned int gws = get_global_size(0);
const unsigned int lws = get_local_size(0);
const unsigned int li = get_local_id(0);
unsigned int gi = get_global_id(0);
int corr = 0;
unsig... |
kernel void piDecimalCalc(global const int* index, global float* decimals) {
const int id = get_global_id(0);
} |
kernel void testSLessThan(int2 a, int2 b, global int2* res) {
res[0] = a < b;
} |
kernel void vector_bytes(global uchar16* test) {
uint4 vec = {0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F};
uchar* p = &vec;
*test = (uchar16)(*p, *(p + 1), *(p + 2), *(p + 3), *(p + 4), *(p + 5), *(p + 6), *(p + 7), *(p + 8), *(p + 9), *(p + 10), *(p + 11), *(p + 12), *(p + 13), *(p + 14), *(p + 15));
} |
kernel void test_arg_6_2_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* a4, global int* a5, global int* b0, global int* b1) {
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] + 3;
int tmp4 =... |
kernel void Double4_multiplication_10_10(global double4* dataArray, long iter, int interval) {
global double4* curArray = dataArray + get_global_id(0) * interval;
double4 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9;
double4 addend;
a0 = curArray[0];
a1 = curArray[1];
a2 = curArray[2];
a3 = curArray[3];
a4 = ... |
kernel void fillbuffer(const int n, const char alpha, global char* x, const int offx) {
for (int index = get_global_id(0); index < n; index += get_global_size(0)) {
x[index + offx] = alpha;
}
} |
kernel void simple_add(global int* A, global int* C, int W, int H) {
const int k = get_global_id(0);
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 int up = (j + H - 1) % H;
if (A[right * H... |
kernel void point_polygon_expand(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 || group[idx])
return;
for (int pt = points_index[idx]; pt < points_index[... |
kernel void compiler_smoothstep(global float* src1, global float* src2, global float* src3, global float* dst) {
int i = get_global_id(0);
dst[i] = smoothstep(src1[i], src2[i], src3[i]);
} |
kernel void kernel_5(global float* inputA, global float* inputB, global float* output, const unsigned int count) {
float D = 0;
for (int i = 0; i < count; i++) {
float x = fabs(inputA[i] - inputB[i]);
D += (fabs(inputA[i] - inputB[i])) / (fabs(inputA[i]) + fabs(inputB[i]));
}
output[5] = D;
} |
kernel void compiler_ctz_ushort(global ushort* src, global ushort* dst) {
global ushort* A = &src[get_global_id(0)];
global ushort* B = &dst[get_global_id(0)];
*B = ctz(*A);
} |
void processPixel(global float* _convMatrix3x3, global char* _imageIn, global char* _imageOut, int _width, int _height, int _x, int _y) {
float accum = 0.0f;
int count = 0;
for (int dx = -3; dx < 6; dx += 3) {
for (int dy = -1; dy < 2; dy++) {
int rgb = 0xff & _imageIn[(((_y + dy) * _width) + (_x + dx))... |
kernel void add(global const float* a, global const float* b, const unsigned int n, global float* c) {
int gid = get_global_id(0);
if (gid < n) {
c[gid] = a[gid] + b[gid];
}
} |
kernel void subtract_ushort4ushort4(global ushort4* src_0, global ushort4* src_1, global ushort4* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] - src_1[gid];
} |
kernel void topk_radix_sort2(global float* restrict out_data, int n, int inner_dim, int top_k, int out_max_val, global const float* restrict key_data, global const int* restrict value_data) {
const int tid = get_global_id(0);
if (tid < inner_dim) {
if (out_max_val) {
out_data[tid] = value_data[inner_dim ... |
kernel void nbody_kern(int n, float dt, float eps, global float4* pp, global float4* vv, global float4* ppo) {
const float4 zero4 = (float4)(0.0f, 0.0f, 0.0f, 0.0f);
const float4 invtwo4 = (float4)(0.5f, 0.5f, 0.5f, 0.5f);
const float4 dt4 = (float4)(dt, dt, dt, 0.0f);
int gti = 2 * get_global_id(0);
int ti... |
kernel void test_small_immediates(global int* out0, global float* out1) {
out0[0] = 3;
out0[1] = 7;
out0[2] = out1[0] + 31.0f;
out0[3] = out0[3] - 26;
out1[0] = out1[0] + 7.0f;
} |
typedef float float3 __attribute__((ext_vector_type(3)));
typedef float float4 __attribute__((ext_vector_type(4)));
kernel void foo(global float3* a, global float3* b) {
*b = *a;
} |
kernel void select_short_short(global short* dest, global short* src1, global short* src2, global short* cmp) {
size_t tid = get_global_id(0);
if (tid < get_global_size(0))
dest[tid] = select(src1[tid], src2[tid], cmp[tid]);
} |
kernel void lud_perimeter(global float* m, int matrix_dim, int offset) {
int i, j, array_offset;
int array_offset_peri;
int idx;
if (get_local_id(0) < 64) {
idx = get_local_id(0);
array_offset = offset * matrix_dim + offset;
for (i = 1; i < 64; i++) {
for (j = 0; j < i; j++)
m[array... |
float4 getPointFromArray(global float* inputvalues, int i) {
unsigned long idx = i;
float4 voxel = (float4){inputvalues[idx * 3], inputvalues[(idx * 3) + 1], inputvalues[(idx * 3) + 2], 0};
return voxel;
}
float4 getPointFromSearchArray(global const float* inputvalues, int i) {
unsigned long idx = i;
float4 ... |
kernel void SimpleCopy(global float* src, global float* dst) {
int id = get_global_id(0);
dst[id] = src[id];
} |
kernel void fft_scale(global float2* g_data, unsigned int points_per_group, unsigned int scale) {
unsigned int points_per_item, addr, i;
points_per_item = points_per_group / get_local_size(0);
addr = get_group_id(0) * points_per_group + get_local_id(0) * points_per_item;
for (i = addr; i < addr + points_per_i... |
kernel void taskParallelIntegrateVelocity(global float3* positions, global float3* velocities, const float dt) {
int id = get_global_id(0);
positions[id].x = positions[id].x + dt * velocities[id].x;
positions[id].y = positions[id].y + dt * velocities[id].y;
positions[id].z = positions[id].z + dt * velocities[i... |
kernel void fill(int width, global int2* marks, global float4* image, float4 float3, int4 bounds) {
if (get_global_id(0) >= bounds.s2)
return;
int id = (int)get_global_id(0) + bounds.s1 * width;
marks += id;
image += id;
int icover = 0;
while (true) {
int2 m = *marks;
*marks = (int2)(0, 0);
... |
constant int x[] = {1, 2, 3, 4};
kernel void foo(global int* data) {
*data = x[get_global_id(0)];
} |
kernel void kernel_13(global float* inputA, global float* inputB, global float* output, const unsigned int count) {
float A = 0;
for (int i = 0; i < count; i++) {
A += (inputA[i] - inputB[i]) * log(inputA[i] / inputB[i]);
}
output[13] = A;
} |
kernel void ker_elt_production_f4(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);
float4 tmp1, tmp2, tmp3;
global float4* vdst;
if (idx < count) {
tmp1 = *((global const float4*)(&in_data_a[idx * 4]));
t... |
kernel void reset_x(global double* x, const int n, const double val) {
int i = get_global_id(0);
if (i < n) {
x[i] = val;
}
return;
} |
kernel void useLocal(int N, global float* inout, local float* _buffer) {
if ((int)get_global_id(0) < N) {
inout[get_global_id(0)] += 1.0f;
}
} |
unsigned int read_sumTex(image2d_t img, sampler_t sam, int2 coord, int rows, int cols, int elemPerRow) {
return read_imageui(img, sam, coord).x;
}
uchar read_imgTex(image2d_t img, sampler_t sam, float2 coord, int rows, int cols, int elemPerRow) {
return (uchar)read_imageui(img, sam, coord).x;
}
constant sampler_t s... |
kernel void kernel_red_extrapolate(global int* dst, global const int* srcBorder, global const int* srcData, int numElems, const int shift) {
int index = get_local_size(0) * get_local_id(0);
if (index < numElems - 1) {
int sum = srcBorder[index];
for (int i = 0; i < get_local_size(0) && index + i < numElem... |
float rand(int x) {
x = (x << 13) ^ x;
return (1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
}
kernel void random(global float* positions, int const dimx, int const dimy, unsigned int const seed) {
int id = get_global_id(0);
positions[2 * id + 0] = rand(seed * id);
positio... |
kernel void fit_prob(int pop_len, global float* fit_prob, float fit_sum) {
int tid = get_global_id(0);
if (tid < pop_len) {
fit_prob[tid] /= fit_sum;
}
} |
kernel void __attribute__((reqd_work_group_size(128, 1, 1))) loopy_kernel(global float* restrict out, global float const* restrict a, int const n) {
if ((-1 + -128 * ((int)get_group_id(0)) + -1 * ((int)get_local_id(0)) + n) >= 0)
out[((int)get_local_id(0)) + ((int)get_group_id(0)) * 128] = 2.0f * a[((int)get_loca... |
kernel void sumSqDoubleTest(int N, int M, global double* deviceDouble, local double* localDouble, global double* blockResults) {
int i = get_global_id(0);
int j = get_local_id(0);
localDouble[j] = deviceDouble[i] * deviceDouble[i];
barrier(0x01);
if (j == 0) {
double temp = 0;
for (int k = 0; k < M;... |
kernel void kernel_lgamma_withoutDD1(global float* result_lgamma, int N) {
float t1;
float t2;
float t3;
float t4;
float t5;
float t6;
float t7;
float t8;
float t9;
float t10;
float i = 0.0;
for (i = 0.0; i < 1.0; i = i + 0.1) {
t1 = lgamma(i);
t2 = lgamma(i + 0.01);
t3 = lgamma(i ... |
float Iq(float q, float length);
float Iq(float q, float length) {
float numerator = pow(length, 3);
float denominator = pow(1 + pow(q * length, 2), 2);
return numerator / denominator;
}
float Iqxy(float qx, float qy, float length);
float Iqxy(float qx, float qy, float length) {
return Iq(sqrt(qx * qx + qy * ... |
kernel void native_log10_float4(global float4* src_0, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = native_log10(src_0[gid]);
} |
kernel void bsort_merge_manning(global uint4* g_data, local uint4* l_data, unsigned int stage, int dir) {
uint4 input1, input2;
int4 comp, add;
unsigned int global_start, global_offset;
add = (int4)(4, 5, 6, 7);
global_start = (get_group_id(0) + (get_group_id(0) / stage) * stage) * get_local_size(0) + get_l... |
kernel void temperature(global const float* input_, global float* output_, local float* scratch_, const int length_) {
int local_index = get_local_id(0);
int global_index = get_global_id(0);
int local_size = get_local_size(0);
int global_size = get_global_size(0);
float accumulator = 0;
for (int offset = g... |
typedef int int4 __attribute((ext_vector_type(4)));
typedef long long4 __attribute((ext_vector_type(4)));
typedef float float4 __attribute((ext_vector_type(4)));
typedef double double4 __attribute((ext_vector_type(4)));
kernel void doubleops(global long4* out, global double4* dout) {
out[0] = (double4)(1, 1, 1, 1) &&... |
kernel void mul_hi_ushort2ushort2(global ushort2* src_0, global ushort2* src_1, global ushort2* dst) {
int gid = get_global_id(0);
dst[gid] = mul_hi(src_0[gid], src_1[gid]);
} |
void max_pool_forward_impl_float(const int nthreads, global const float* bottom_data, 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 pad_h, const int pad_w, g... |
kernel void native_log_float16(global float16* src_0, global float16* dst) {
int gid = get_global_id(0);
dst[gid] = native_log(src_0[gid]);
} |
kernel void SMS(global float* X, global float* Y, unsigned int width, unsigned int height, unsigned int maps, unsigned int samples) {
unsigned int target_element = get_global_id(0);
unsigned int target_skid = target_element / (width * height);
unsigned int target_sample = target_skid / maps;
unsigned int targe... |
kernel void trig(global const float4* a, global float4* b, float c) {
int gid = get_global_id(0);
switch (gid % 5) {
case 0:
b[gid] = cos(a[gid]);
break;
case 1:
b[gid] = fabs(a[gid]) + c;
break;
case 2:
b[gid] = sin(a[gid]);
break;
case 3:
b[gid] = sqrt(a[... |
kernel void clearAccumulator(global float3* accumulator) {
accumulator[get_global_id(0)] = (float3)(0.0f, 0.0f, 0.0f);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.