kernel_code stringlengths 49 1.22M |
|---|
void init_local_mem(local int* int_array, int int_value, local char* char_array, char char_value, local float* float_array, float float_value, local float4* vector_array, float4 vector_value);
void init_local_mem(local int* int_array, int int_value, local char* char_array, char char_value, local float* float_array, flo... |
float fast_mexp2f(const float x) {
const float i1 = (float)0x3f800000u;
const float i2 = (float)0x3f000000u;
const float k0 = i1 + x * (i2 - i1);
union {
float f;
unsigned int i;
} k;
k.i = (k0 >= (float)0x800000u) ? k0 : 0;
return k.f;
}
float ddirac(const int2 q) {
return ((q.x || q.y) ? 1.0f... |
kernel void kernel_pown_withoutDD1(global float* result_pown, 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;
int j = 1;
float n = 7 * (float)(N);
for (i = 0.0; i < n; i = i + 1.0) {
t1 = pown(i, j);
t2 = ... |
kernel void update_grid(global float* u0, global float* u1, global const int* width_ptr) {
int id = get_global_id(0);
int width = width_ptr[0];
int row = id / width;
int col = id % width;
if (row > 0 && col > 0 && row < width - 1 && col < width - 1) {
u0[row * width + col] = .25 * (u1[(row + 1) * width... |
kernel void addition(global int* a, global int* b, global int* c, global int* N) {
int id = get_global_id(0);
c[id] = a[id] + b[id];
} |
kernel __attribute((num_compute_units(4))) 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 * t... |
kernel void initializePBO(global float* PBO, private float red, private float green, private float blue) {
const float4 value = {red, green, blue, 1.0};
vstore4(value, get_global_id(0), PBO);
} |
kernel void memoryCheckInt(global int* input, global int* output, unsigned int count) {
unsigned int i;
for (i = 0; i < count; i++) {
if (input[i] != 0)
output[0]++;
}
} |
kernel void SET_VALUE(global float* X, float value, unsigned int offset) {
unsigned int element = get_global_id(0);
X[element + offset] = value;
} |
kernel void incrementPosBuff(global int* posBuff, int filterOrder, int outputLen) {
posBuff[0] = (posBuff[0] + 1) % filterOrder;
posBuff[1] = (posBuff[1] + 1) % outputLen;
} |
kernel void brahmaKernel(global int* buf) {
int f = 3;
buf[0] = f;
} |
float3 foo_pow3(float3 src0, float3 src1) {
union {
float3 f3;
float farray[4];
} s0, s1, dst;
s0.f3 = src0;
s1.f3 = src1;
int i;
for (i = 0; i < 3; i++)
dst.farray[i] = pow(s0.farray[i], s1.farray[i]);
return dst.f3;
}
kernel void compiler_constant_expr(global float* src, global float* dst) ... |
kernel void kernel_ldexp_withDD1(global float* result_ldexp, int N) {
float t1 = 0.00000003;
int t2 = 1;
int i = 0;
for (i = 0; i < N; i++) {
t1 = 0.00000003;
t1 = ldexp(t1, t2);
t1 = ldexp(t1, t2);
t1 = ldexp(t1, t2);
t1 = ldexp(t1, t2);
t1 = ldexp(t1, t2);
t1 = ldexp(t1, t2);
t... |
kernel void frameDiffFloatDouble(global float* v, global double* v2) {
unsigned int i = get_global_id(0);
if (abs((int)(v[i] - v2[i])) < 20) {
v[i] = 0;
}
} |
kernel void graying(global const uchar* restrict img_test_in, global uchar* restrict img_test_out, const unsigned int iterations) {
unsigned int count = 0;
uchar rows[3];
while (count != iterations) {
img_test_out[count] = img_test_in[count];
count++;
}
} |
kernel void test_maxmag(const global float* in0, const global float* in1, global float* out) {
size_t gid = get_global_id(0);
out[gid] = maxmag(in0[gid], in1[gid]);
} |
kernel void copy1DCompletePath(global float* input, global float* output) {
int gid = get_global_id(0);
if (gid < 0)
atom_add((global int*)output, 1);
output[gid] = input[gid];
return;
} |
kernel void global_fence(global int* scratch, global int* output) {
int i = get_global_id(0);
int g = get_group_id(0);
scratch[i] = i;
barrier(0x02);
if (get_local_id(0) == 0) {
int x = 0;
for (int l = 0; l < get_local_size(0); l++) {
x += scratch[get_local_size(0) * g + l];
}
output[g] ... |
kernel void KernelNormalizer(const global unsigned int* IR_In, global float2* IR_Out, const global float2* sum_out, unsigned int Block_log2, unsigned int IR_In_sz, unsigned int IR_Mem_sz, unsigned int IR_Mem_offset) {
unsigned int id = get_global_id(0);
unsigned int glbl_sz = get_global_size(0);
unsigned int grou... |
typedef float4 float4;
kernel void interp_keypoint(global float* DOGS, global float4* keypoints, int start_keypoints, int end_keypoints, float peak_thresh, float InitSigma, int width, int height) {
int gid0 = (int)get_global_id(0);
if ((gid0 >= start_keypoints) && (gid0 < end_keypoints)) {
float4 k = keypoints... |
extern constant unsigned int table[256];
kernel void use_extern(global unsigned int* result) {
result[0] = table[0];
} |
kernel void gpu_memset(global uint4* buf, const unsigned int value, const unsigned int gid_max) {
const unsigned int gid = get_global_id(0);
if (gid >= gid_max)
return;
buf[gid] = (uint4)(value);
} |
kernel void if1(global float a[]) {
int id = get_global_id(0);
if ((id & 0x01) == 0)
a[id] = 3.0;
} |
kernel void blur2D_scanline_async(int nx, int ny, global float* I, global float* O) {
local float L[66 * 4];
int i0 = 0;
int i1 = 66;
int i2 = 66 * 2;
int i3 = 66 * 3;
event_t event = 0;
int ig0 = get_group_id(0) * get_local_size(0);
event = async_work_group_copy(L, I + ig0, 66, event);
ig0 += nx;
e... |
kernel void compute_sp_v4(global float* ptr, float _A) {
float4 x = (float4)(_A, (_A + 1), (_A + 2), (_A + 3));
float4 y = (float4)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);
;... |
kernel void kernel_atan_withDD1(global float* result_atan, int N) {
float t1 = 1.23;
int i = 0;
for (i = 0; i < N; i++) {
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
t1 = atan(t1);
... |
kernel void kLog10(global const float* inputMatrix, global float* resultMatrix) {
int id = get_global_id(0);
resultMatrix[id] = native_log10(inputMatrix[id]);
} |
kernel void rsqrt_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = rsqrt(src_0[gid]);
} |
kernel void mul(global double* a, global const double* b, const int aoffset, const int boffset) {
int gid = get_global_id(0);
a[gid + aoffset] *= b[gid + boffset];
} |
kernel void relational_less_than_or_equal_to_ucharuchar(global uchar* src_0, global uchar* src_1, global int* dst) {
int gid = get_global_id(0);
dst[gid] = (int)(src_0[gid] <= src_1[gid]);
} |
kernel void clBlockScan(global uint4* blockScan, global unsigned int* scanSum, unsigned int size) {
int globalId = get_global_id(0);
int threadid = get_local_id(0);
int blockid = get_group_id(0);
uint4 value4 = 0;
if (globalId < size) {
value4 = blockScan[globalId];
}
local unsigned int prefixSum[25... |
kernel void array_multiply_u32(global const unsigned int* a, global const unsigned int* b, global unsigned int* c) {
unsigned int i = get_global_id(0);
c[i] = a[i] * b[i];
} |
kernel void as_gpu(global float* s1, global const float* fac2, unsigned int options2, global const float* s2) {
float alpha = fac2[0];
if ((options2 >> 2) > 1) {
for (unsigned int i = 1; i < (options2 >> 2); ++i)
alpha += fac2[i];
}
if (options2 & (1 << 0))
alpha = -alpha;
if (options2 & (1 << 1... |
kernel void dup(global uchar4* B) {
*B = (uchar4)(1, 128, 3, 4);
} |
kernel void rdwdot6_kernel(global const float* RKF, global const float* RKR, global float* WDOT, const float rateconv, global const float* molwt) {
(WDOT[(((11) - 1) * (4)) + (get_global_id(0))]) = (-((RKF[(((29) - 1) * (4)) + (get_global_id(0))]) - (RKR[(((29) - 1) * (4)) + (get_global_id(0))])) - ((RKF[(((30) - 1) ... |
kernel void matrixMult(global float* restrict C, global float* A, global float* B, int A_width, int C_width, int C_height) {
for (int i = 0; i < C_height; i++) {
float tA[1024];
for (int k = 0; k < A_width; k++)
tA[k] = A[i * A_width + k];
for (int j = 0; j < C_width; j++) {
float running_sum... |
kernel void test_arg_3_5_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) {
unsigned int gtid = get_global_id(0);
int tmp0 = a0[gtid] + 0;
int tmp1 = a1[gtid] + 1;
int tmp2 = a2[gtid] + 2;
b0[gtid] = (0 + 1) * (+tmp0 + tmp1 + ... |
kernel void copysign_float2float2(global float2* src_0, global float2* src_1, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = copysign(src_0[gid], src_1[gid]);
} |
kernel void STREAM_Add(global double* a, global double* b, global double* c, global int* len) {
int threadIdX = get_local_id(0);
int workGroupSize = get_global_size(0);
int idx = get_global_id(0);
if (idx < *len)
a[idx] = c[idx] * b[idx];
} |
kernel void test_double8(global double* pin, global double* pout) {
int x = get_global_id(0);
double8 value;
value = vload8(x, pin);
value += (double8){(double)1, (double)2, (double)3, (double)4, (double)5, (double)6, (double)7, (double)8};
vstore8(value, x, pout);
} |
kernel void hadd_ushort8ushort8(global ushort8* src_0, global ushort8* src_1, global ushort8* dst) {
int gid = get_global_id(0);
dst[gid] = hadd(src_0[gid], src_1[gid]);
} |
kernel void test(global int* buf) {
int gidx = get_global_id(0);
buf[gidx] = gidx;
} |
kernel void test_fa1_4_2_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* b0, global float* b1) {
unsigned int gtid = get_global_id(0);
float tmp0 = a0[gtid] + 0.1f;
float tmp1 = a1[gtid] + 1.1f;
float tmp2 = a2[gtid] + 2.1f;
float tmp3 = a3[gtid] + 3.1f;
b0[gtid] =... |
kernel void mxmulv_blocked(global float* y, global const float* a, global const float* v, const unsigned int global_rows, const unsigned int global_cols) {
local float tmp[2048];
const unsigned int nrows = (global_rows + get_global_size(0) - 1) / get_global_size(0);
const unsigned int iend = min(global_rows, ((... |
constant uchar message[12] = "Hello World";
constant uchar message2[] = "Hello World!and some more text so it cannot be lowered into register";
kernel void test_constant_storage2(global uchar* out) {
size_t gid = get_global_id(0);
out[gid] = message2[gid];
} |
kernel void ratt4_kernel(global const float* T, global const float* RF, global float* RB, global const float* EG, const float TCONV) {
float TEMP = T[get_global_id(0)] * TCONV;
float ALOGT = log(TEMP);
const float SMALL_INV = 1e+20f;
const float RU = 8.31451e7f;
const float PATM = 1.01325e6f;
const float ... |
kernel void brightness(global const uchar* A, uchar const B, global uchar* C) {
int i = get_global_id(0);
C[i] = (A[i] + B) >= 255 ? 255 : (A[i] + B);
} |
kernel void closerLaserScan(global float* v) {
unsigned int i = get_global_id(0);
v[i] = v[i] * v[i] * 0.1f;
} |
kernel void ker_nhwc_to_nchw_power(global float* out_data, const int n, const int c, const int h, const int w, const int out_stride_n, const int out_stride_c, const int out_stride_h, const int out_stride_w, const int in_stride_n, const int in_stride_c, const int in_stride_h, const int in_stride_w, const float scale, co... |
kernel void LDSBandwidth_single(local float* sharedMemory, global float* output) {
float val1 = (float)(0);
float val2 = val1;
unsigned int gid = get_global_id(0);
unsigned int lid = get_local_id(0);
val1 = val1 + sharedMemory[0];
val2 = val2 + sharedMemory[1];
val1 = val1 + sharedMemory[2];
val2 = val2... |
kernel void splitPC8D(global float8* pc8d, global float4* pc4d, global float4* rgba, unsigned int offset) {
unsigned int gX = get_global_id(0);
float8 point = pc8d[gX];
size_t pos = offset + gX;
pc4d[pos] = point.lo;
rgba[pos] = point.hi;
} |
kernel void OptixDenoiserPlugin_BufferSetUp(const unsigned int filmWidth, const unsigned int filmHeight, global float* src, global float* dst) {
const size_t gid = get_global_id(0);
if (gid >= filmWidth * filmHeight)
return;
const unsigned int index4 = gid * 4;
const float x = src[index4];
const float y ... |
kernel void remainder_ucharuchar(global uchar* src_0, global uchar* src_1, global uchar* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] % src_1[gid];
} |
constant float u8_gamma_to_linear_lut[] = {0.0000000000000000f, 0.0003035269835488f, 0.0006070539670977f, 0.0009105809506465f, 0.0012141079341954f, 0.0015176349177442f, 0.0018211619012930f, 0.0021246888848419f, 0.0024282158683907f, 0.0027317428519395f, 0.0030352698354884f, 0.0033465357638992f, 0.0036765073240474f, 0.00... |
kernel void extract_kernel(long d_Ne, global float* d_I) {
int bx = get_group_id(0);
int tx = get_local_id(0);
int ei = (bx * 32) + tx;
if (ei < d_Ne) {
d_I[ei] = exp(d_I[ei] / 255);
}
} |
kernel void kernel_frexp_withDD1(global float* result_frexp, int N) {
float t1 = 2.0;
int iptr;
int i = 0;
for (i = 0; i < N; i++) {
t1 = frexp(t1, &iptr);
t1 = frexp(t1, &iptr);
t1 = frexp(t1, &iptr);
t1 = frexp(t1, &iptr);
t1 = frexp(t1, &iptr);
t1 = frexp(t1, &iptr);
t1 = frexp(t1... |
kernel void kernelDouble(double8 input, global double8* output) {
output[0] = input;
} |
kernel void Film_MergeBufferInitialize(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE) {
const size_t gid = get_global_id(0);
if (gid > filmWidth * filmHeight)
return;
global float* channelBufferPixel = &channel_IMAGEPIPELINE[gid * 3];
channelBufferPixel[0... |
int get_pointed_value(global int* pointer, const constant char* dummy);
int get_pointed_value(global int* pointer, const constant char* dummy) {
return *pointer;
}
kernel void find_works_fine(global int* array) {
int i = get_global_id(0);
int pointed_value = get_pointed_value(array + i, (const constant char*)"do... |
kernel void sort2(global int* a, int stage, int passOfStage) {
unsigned int sortIncreasing = 1;
unsigned int gid = get_global_id(0);
unsigned int pairDistance = 1 << (stage - passOfStage);
unsigned int blockWidth = 2 * pairDistance;
unsigned int leftId = (gid % pairDistance) + (gid / pairDistance) * blockWi... |
kernel void test_atomic_cmpxchg(global int* p, int cmp, int val) {
atomic_cmpxchg(p, cmp, val);
global unsigned int* up = (global unsigned int*)p;
unsigned int ucmp = (unsigned int)cmp;
unsigned int uval = (unsigned int)val;
atomic_cmpxchg(up, ucmp, uval);
} |
kernel void initCells(global int2* foundCells, const unsigned int N) {
const unsigned int i = get_global_id(0);
if (i >= N)
return;
foundCells[i].x = -1;
foundCells[i].y = -1;
} |
kernel void test_arg_4_2_kern(global int* a0, global int* a1, global int* a2, global int* a3, 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;
b0[gtid] = (0 + 1) * (+tmp0 + tmp1 + tmp2 ... |
kernel void unary_plus_uchar2(global uchar2* src_0, global uchar2* dst) {
int gid = get_global_id(0);
dst[gid] = +src_0[gid];
} |
kernel void inplace_div_sub(global float4* vec1, global const float4* float2, global const float* fac, unsigned int size) {
float factor = *fac;
for (unsigned int i = get_global_id(0); i < size / 4; i += get_global_size(0))
vec1[i] -= float2[i] / factor;
} |
kernel void selfdot_ints_withoutscratch(global int* inout, global int* second, global int* out) {
int globalId = get_global_id(0);
int localId = get_local_id(0);
int workgroupSize = get_local_size(0);
int workgroupid = get_group_id(0);
const int workgroupOffset = workgroupid * workgroupSize;
int sum = 0;
... |
kernel void BK_BetaB(const int N, const int pos, global const float* beta, global const float* b, global float* betaB) {
size_t idx = get_global_id(0);
if (idx < N) {
betaB[idx] = b[pos + idx] * beta[pos + idx];
}
} |
kernel void batch_slice_fw_kernel(const global float* px, const unsigned shift, const unsigned size, global float* py) {
const unsigned i = get_global_id(0);
if (i < size)
py[i] = px[i + shift];
} |
unsigned int div_up(unsigned int a, unsigned int b) {
return (a + b - 1) / b;
}
unsigned int round_mul_up(unsigned int a, unsigned int b) {
return div_up(a, b) * b;
}
int scan_pass(int gi, int nels, global int* restrict out, global const int* restrict in, local int* restrict lmem, int corr) {
const unsigned int... |
kernel void householder(float4 v, global float4* mat) {
v *= 1.41421356237309504880168872420969808f / length(v);
mat[0] = (float4)(1.0f, 0.0f, 0.0f, 0.0f) - (v * v.x);
mat[1] = (float4)(0.0f, 1.0f, 0.0f, 0.0f) - (v * v.y);
mat[2] = (float4)(0.0f, 0.0f, 1.0f, 0.0f) - (v * v.z);
mat[3] = (float4)(0.0f, 0.0f, 0.... |
unsigned int sumReduce128(local unsigned int* arr);
unsigned int compactSIMDPrefixSum(local const unsigned int* dsData, local const unsigned int* dsValid, local unsigned int* dsCompact, local unsigned int* dsLocalIndex);
unsigned int exclusivePrescan128(local const unsigned int* in, local unsigned int* outAndTemp);
uns... |
void gaussianElimination(float* A, float* b, float* x, const int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
float s = A[j * n + i] / A[i * n + i];
for (int k = i; k < n; k++)
A[j * n + k] -= s * A[i * n + k];
b[j] -= s * b[i];
}
}
for (int i = 0; ... |
kernel void foo(global float4* A) {
float4 value;
value.w = 1111.0f;
*A = value;
} |
kernel void gegl_brightness_contrast(global const float4* in, global float4* out, float contrast, float brightness) {
int gid = get_global_id(0);
float4 in_v = in[gid];
float4 out_v;
out_v.xyz = (in_v.xyz - 0.5f) * contrast + brightness + 0.5f;
out_v.w = in_v.w;
out[gid] = out_v;
} |
typedef float2 float2;
inline float cabs(float2 a) {
return sqrt(a.x * a.x + a.y * a.y);
}
inline float2 cmult(float2 a, float2 b) {
return (float2)(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
inline float2 cexp(float2 a) {
return exp(a.x) * (float2)(cos(a.y), sin(a.y));
}
kernel void dft_real2cpx(global ... |
double getSmallPositiveFloatBits(const ulong entropy) {
ulong exponent = entropy >> 59;
ulong mantissa = entropy & ((1UL << 52) - 1);
exponent += 1023;
exponent &= ((1UL << 11) - 1);
exponent <<= 52;
return __builtin_astype((exponent | mantissa), double);
}
ulong getStaticExponent(const ulong entropy) {
... |
kernel void reduce(int count, int offset1, int offset2, global int* buffer) {
int gid = get_global_id(0);
if (gid * 2 + 0 < count) {
buffer[gid + offset2] = buffer[gid * 2 + 0 + offset1];
}
if (gid * 2 + 1 < count) {
buffer[gid + offset2] += buffer[gid * 2 + 1 + offset1];
}
} |
kernel void vector_mandelbrot(const unsigned int xsize, const double scale, const unsigned int maxiter, global int* C) {
int i = get_global_id(0);
double cre = (i / xsize) * scale - 1.0;
double cim = (i % xsize) * scale - 1.0;
double re = cre;
double im = cim;
double retemp;
int result = 0;
for (unsign... |
kernel void binarySearch_mulkeysConcurrent(global unsigned int* keys, global unsigned int* input, const unsigned int inputSize, const unsigned int numSubdivisions, global int* output) {
int lBound = (get_global_id(0) % numSubdivisions) * (inputSize / numSubdivisions);
int uBound = lBound + inputSize / numSubdivisio... |
kernel void polar_rect(global float4* rvals, global float4* angles, global float4* xcoords, global float4* ycoords) {
*ycoords = sincos(*angles, xcoords);
*xcoords *= *rvals;
*ycoords *= *rvals;
} |
void subBytes3(local uint4* state) {
uint4 x0, x1, x2, x3, x4, x5, x6, x7, t0, t1, t2, t3, t4, t5, t6, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12;
for (int i = 0; i < 32; i += 8) {
x0 = state[i + 0];
x1 = state[i + 1];
x2 = state[i + 2];
x3 = state[i + 3];
x4 = state[i + 4];
x5 = ... |
kernel void lsh_Q(unsigned int image_width, unsigned int image_height, uchar nbins, global float* image, global float* output_Q) {
size_t gid = get_global_id(0);
float intensity = image[gid];
uchar bin_number = floor(intensity * nbins);
output_Q[((bin_number) + ((((gid) % image_width)) * nbins) + ((((gid) / i... |
__attribute__((num_simd_work_items(4))) __attribute__((reqd_work_group_size(32, 1, 1))) 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) {
... |
kernel void test_arg_3_5_kern(global float* a0, global float* a1, global float* a2, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4) {
unsigned int gtid = get_global_id(0);
float tmp0 = a0[gtid] + 0.1f;
float tmp1 = a1[gtid] + 1.1f;
float tmp2 = a2[gtid] + 2.1f;
b0[gti... |
kernel void test_arg_4_3_kern(global float4* a0, global float4* a1, global float4* a2, global float4* a3, 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;
float4 tmp1 = a1[gtid] +... |
kernel void brahmaKernel(global int* buf) {
int id = get_local_id(0);
buf[id] = 0;
} |
float4 cross3(float4 a, float4 b) {
float4 c;
c.x = a.y * b.z - b.y * a.z;
c.y = a.z * b.x - b.z * a.x;
c.z = a.x * b.y - b.x * a.y;
c.w = 0.f;
return c;
}
float dot3(float4 a, float4 b) {
return a.x * b.x + a.y * b.y + a.z * b.z;
}
bool LineTriangleIntersection(float4 x0, float4 x1, float4 v1, float4 v2... |
kernel void test_arg_3_4_kern(global float4* a0, global float4* a1, global float4* a2, 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;
float4 tmp1 = a1[gtid] +... |
kernel void do_init_depths_idx(int num_elts, global int* all_depths, global int* all_idxs) {
int tid = get_global_id(0);
if (tid >= num_elts) {
return;
}
all_depths[tid] = 0;
all_idxs[tid] = 0;
} |
kernel void initialized(global unsigned char* data, global float* gaus, global int* sobx, global int* soby, global unsigned char* out) {
out[0] = 0;
} |
kernel void compiler_long_convert_to_float(global float* dst, global long* src) {
int i = get_global_id(0);
dst[i] = src[i];
} |
kernel void global_bandwidth_vec16_v2(const int heightA, const int widthA, global float16* a, global float16* b) {
const int idx = get_global_id(0);
const int step = idx << 4;
float16 value = *(a + step);
*(b + step) = value;
} |
kernel void ckVectorAdd(global unsigned int* vectorIn1, global unsigned int* vectorIn2, global unsigned int* vectorOut, unsigned int uiVectorWidth) {
unsigned int x = get_global_id(0);
if (x >= (uiVectorWidth)) {
return;
}
vectorOut[x] = vectorIn1[x] + vectorIn2[x];
} |
kernel void sparseMatVec(int nVals, global int* rows, global int* cols, global float* vals, global float* vec, global float* res) {
int id = get_global_id(0);
int startIdx = -1;
int endIdx = -1;
for (int i = id; i < nVals; ++i) {
if (rows[i] == id && startIdx == -1)
startIdx = i;
if (rows[i] == ... |
kernel void kernel_add_withoutDD1(global float* result_add, int N) {
float t1 = 0.1;
float t2 = 0.1;
float t3 = 0.1;
float t4 = 0.2;
float t5 = 0.1;
float t6 = 0.1;
float t7 = 0.1;
float t8 = 0.2;
float t9 = 0.1;
float t10 = 0.1;
float t11 = 0.1;
float t12 = 0.2;
float t13 = 0.1;
float t14 =... |
void bar(int* x) {
*x += 1;
}
int foo() {
int x = 0;
bar(&x);
return x;
}
kernel void many_alloca(global int* data, int n) {
int x = 0;
for (int i = 0; i < n; i++) {
x += foo();
}
data[get_global_id(0)] = x;
} |
kernel void async_copy_local_race(global int* data, local int* scratch) {
int i = get_local_id(0);
scratch[i] = 0;
event_t event = async_work_group_copy(scratch, data, get_local_size(0), 0);
wait_group_events(1, &event);
data[get_local_size(0) - i - 1] = scratch[i];
} |
kernel void setCharTest(int N, global char* deviceChar) {
int i = get_global_id(0);
if (i < N) {
deviceChar[i] = 'a';
}
} |
kernel void compiler_bool_cross_basic_block(global int* src, global int* dst, int scale) {
int id = (int)get_global_id(0);
bool isRedRow = false;
bool isRed;
int val = src[id];
for (unsigned int i = 0; i < scale; i++, isRedRow = !isRedRow) {
if (isRedRow) {
isRed = false;
for (unsigned int j ... |
kernel void MatVecMulUncoalesced0(const global float* M, const global float* V, unsigned int width, unsigned int height, global float* W) {
unsigned int y = get_global_id(0);
if (y < height) {
const global float* row = M + y * width;
float dotProduct = 0;
for (int x = 0; x < width; ++x)
dotProduc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.