kernel_code stringlengths 49 1.22M |
|---|
kernel void foo(global int* data) {
data[1] = data[0];
} |
constant float kPowersOfTwo[] = {1.0f, 2.0f, 4.0f, 8.0f, 16.0f, 32.0f, 64.0f, 128.0f, 256.0f, 512.0f, 1024.0f, 2048.0f, 4096.0f, 8192.0f, 16384.0f, 32768.0f, 65536.0f, 131072.0f, 262144.0f, 524288.0f, 1048576.0f, 2097152.0f, 4194304.0f, 8388608.0f, 16777216.0f, 33554432.0f};
constant int kPowersOfTwoSize = 26;
float L... |
kernel void unary_minus_ulong2(global ulong2* src_0, global ulong2* dst) {
int gid = get_global_id(0);
dst[gid] = -src_0[gid];
} |
kernel void remainder_float4float4(global float4* src_0, global float4* src_1, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = remainder(src_0[gid], src_1[gid]);
} |
kernel void sph_kernel_hashparticles(float viewWidth, float viewHeight, float viewDepth, int nx, int ny, int nz, float cellSize, global float4* pos, global uint2* partIdx, global float4* vel) {
size_t gid = get_global_id(0);
float3 tempPos;
float rangeRatioX = (nx * cellSize - 0.0f) / viewWidth;
float rangeRa... |
kernel void updateDir(global float* newRDotR, global float* oldRDotR, global float* r, global float* p) {
int id = get_global_id(0);
p[id] = r[id] + (*newRDotR) / (*oldRDotR) * p[id];
} |
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 test_fast_length(const global float* in, global float* out) {
unsigned int gid = get_global_id(0);
vstore3(fast_length(vload3(gid, in)), gid, out);
} |
kernel void element_product_three_f(global float* output, global const float* x, global const float* y, const unsigned int size) {
unsigned int tid = get_global_id(0);
if (tid < size)
output[tid] = x[tid] * y[tid];
} |
kernel void SimpleKernel4(const global float4* input, global float4* output) {
size_t index = get_global_id(0);
output[index] = rsqrt(fabs(input[index]));
} |
kernel void MatVecMultUsingDotFn(global float4* matrix, global float4* vector, global float* result) {
size_t i = get_group_id(0) * get_local_size(0) + get_local_id(0);
result[i] = dot(matrix[i], vector[0]);
} |
kernel void logb_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = logb(src_0[gid]);
} |
kernel void test_stream_read_uint(global unsigned int* dst) {
dst[0] = ((1U << 16) + 1U);
} |
kernel void create_rids(global unsigned int* restrict input, global unsigned int* restrict rids, private unsigned int maximum) {
unsigned int idx = get_global_id(0);
if (idx < maximum)
rids[idx] = idx;
} |
kernel void maxCl(global const int* a, global int* maxData) {
size_t i = get_global_id(0);
*maxData = min((int)maxData, a[i]);
} |
kernel void sampleKernel(global int* evt, global const int* script, global int* iscript, global int* iop, global int* step, global char* vm, global int* nrg) {
int idx = get_global_id(0);
int lstep = step[0];
if (evt[idx] == 0) {
evt[idx] = script[idx * lstep * 2 + iscript[idx] * 2];
iop[idx] = script[id... |
kernel void kernel_fdim_withoutDD1(global float* result_fdim, int n) {
float p1 = -12.9;
float p2 = -19.1;
float p3 = -19.1;
float p4 = -19.1;
float p5 = -19.1;
float p6 = -19.1;
float p7 = -19.1;
float p8 = -19.1;
float p9 = -19.1;
float p10 = -19.1;
float k1 = 0.01;
float k2 = 0.02;
float k3... |
kernel void test_block_1_5_kern(global float* a0, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4, local float* 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.1f;
barrier... |
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 test_arg_3_6_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, global float* b5) {
unsigned int gtid = get_global_id(0);
float tmp0 = a0[gtid] + 0.1f;
float tmp1 = a1[gtid] + 1.1f;
float tmp2 = a2[gtid... |
kernel void rdwdot2_kernel(global const float* RKF, global const float* RKR, global float* WDOT, const float rateconv, global const float* molwt) {
(WDOT[(((21) - 1) * (4)) + (get_global_id(0))]) = (((RKF[(((145) - 1) * (4)) + (get_global_id(0))]) - (RKR[(((145) - 1) * (4)) + (get_global_id(0))])) + ((RKF[(((185) - 1... |
kernel void kernel_nextafter_withDD1(global float* result_nextafter, int N) {
float t1 = 1.4;
float t2 = -3.0;
int i = 0;
for (i = 0; i < N; i++) {
t1 = nextafter(t1, t2);
t1 = nextafter(t1, t2);
t1 = nextafter(t1, t2);
t1 = nextafter(t1, t2);
t1 = nextafter(t1, t2);
t1 = nextafter(t1, t... |
kernel void Saxpy_noincx(float alpha, global float* x, global float* y, unsigned int incy) {
unsigned int gid = get_global_id(0);
float this_x = x[gid];
float this_y = y[gid * incy];
this_y += alpha * this_x;
y[gid * incy] = this_y;
} |
kernel void divide_ulongulong(global ulong* src_0, global ulong* src_1, global float* dst) {
int gid = get_global_id(0);
dst[gid] = (float)(src_0[gid] / src_1[gid]);
} |
kernel void rdwdot8_kernel(global const float* RKF, global const float* RKR, global float* WDOT, const float rateconv, global const float* molwt) {
float ROP12 = ((RKF[(((12) - 1) * (4)) + (get_global_id(0))]) - (RKR[(((12) - 1) * (4)) + (get_global_id(0))])) + ((RKF[(((13) - 1) * (4)) + (get_global_id(0))]) - (RKR[(... |
kernel void decrypt(global int* plaintext, global int* key, global int* ciphertext) {
unsigned int i = get_global_id(0);
if (plaintext[i] > 31) {
ciphertext[i] = plaintext[i] - key[i] + 32;
if (ciphertext[i] < 32) {
ciphertext[i] += 95;
}
} else {
ciphertext[i] = plaintext[i];
}
} |
kernel void gauss_sphere(volatile global float4* normal, global int* north_hemisphere, global int* south_hemisphere, const float alpha_g, const float beta_g) {
private
const float beta = beta_g;
private
const float alpha = alpha_g;
private
const int rows = 2 * (1 + (int)ceil(beta / alpha)) + 1;
private
int... |
kernel void undulator_taper(const float alpha, const float Kx, const float Ky, const float phase, const int jend, global float* gamma, global float* wu, global float* w, global float* ww1, global float* ddtheta, global float* ddpsi, global float* tg, global float* ag, global float2* Is_gl, global float2* Ip_gl) {
con... |
kernel void scale_d(global double* output, const double multiplier, const unsigned int size) {
unsigned int tid = get_global_id(0);
if (tid < size)
output[tid] = output[tid] * multiplier;
} |
kernel void nd_vi(global const float* red, global const float* nir, global float* ndvi, global const int* N) {
int i = get_global_id(0);
if (i < N)
ndvi[i] = (nir[i] - red[i]) / (nir[i] + red[i]);
} |
kernel void add_sat_short2short2(global short2* src_0, global short2* src_1, global short2* dst) {
int gid = get_global_id(0);
dst[gid] = add_sat(src_0[gid], src_1[gid]);
} |
kernel void compiler_function_argument0(global int* dst, short value) {
int id = (int)get_global_id(0);
dst[id] = value;
} |
kernel void kernel_cosh_withoutDD1(global float* result_cosh, int N) {
float t1 = 0.123;
float t2 = 0.12;
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.001;
float p2 = 0.002;
float p3 = 0.003;
float p4 = ... |
kernel void sub(global int* a, global int* b, global int* c) {
unsigned int i = get_global_id(0);
c[i] = a[i] - b[i];
} |
kernel void normalize_vec4(global float4* vectors) {
int i = get_global_id(0);
vectors[i] = normalize(vectors[i]);
} |
kernel void lockTransactionData(global long* iterations, global int* result) {
const int id = get_global_id(0);
long i = id - 1;
while (*result != 1) {
if (~i | (id & (1 << 44)))
*result = 1;
i++;
}
} |
kernel void NoCoal(global float* input, global float* output) {
int gid = get_global_id(0) - 1;
if ((get_local_id(0) & 0xf) == 0)
gid += 16;
output[gid] = input[gid];
} |
float LaplacianXY(global float* C, int row, int column) {
float retval;
float dx = 1;
float dy = 1;
int current = row * (32 * 16) + column;
int left = row * (32 * 16) + column - 1;
int right = row * (32 * 16) + column + 1;
int top = (row - 1) * (32 * 16) + column;
int bottom = (row + 1) * (32 * 16) + c... |
kernel void Threshold(global const char* b, global char* c) {
int id = get_global_id(0);
if ((unsigned char)b[id] <= 100) {
c[id] = b[id] * 0;
} else {
c[id] = 255 + (b[id] * 0);
}
} |
kernel void plus_1d(global double* input, global double* output, const unsigned int count) {
unsigned int global_index = get_global_id(0);
if (global_index < count) {
double s = output[global_index];
double a = input[global_index];
for (long i = 0; i < 1024 * 1024 * 128; i++) {
s = s + a;
}
... |
kernel void memcpy(global unsigned int* dst, unsigned int dstofs, global unsigned int* src, unsigned int srcofs) {
dst[dstofs + get_global_id(0)] = src[srcofs + get_global_id(0)];
} |
kernel void depth_Ushort2Float(global ushort4* depth, global float4* fDepth, float scaling) {
unsigned int gX = get_global_id(0);
fDepth[gX] = convert_float4(depth[gX]) * scaling;
} |
kernel void multiply_short16short16(global short16* src_0, global short16* src_1, global short16* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] * src_1[gid];
} |
kernel void testWorkGroupFAdd(float a, global float* res) {
res[0] = work_group_reduce_add(a);
} |
kernel void dsp_compute(global const float2* M, global const float2* x, const float C, global float2* y, local float2* lM, local float2* lx, local float2* ly) {
int grp_id = get_group_id(0);
int num_elems = get_local_size(0);
event_t ev1 = async_work_group_copy(lM, M + grp_id * num_elems, num_elems, 0);
event_... |
kernel void partialTrueCount(global uchar* x, const unsigned int size, const unsigned int partSize, global unsigned int* dest) {
unsigned int part = get_global_id(0);
unsigned int correct = 0;
for (size_t i = part * partSize, end = min(part * partSize + partSize, size); i < end; ++i) {
if (x[i]) {
++co... |
kernel void pre_decrement_ulong2(global ulong2* src_0, global ulong2* dst) {
int gid = get_global_id(0);
dst[gid] = --src_0[gid];
} |
kernel void array_dmin_f32(global float* a, global float* b, const float threshold) {
unsigned int i = get_global_id(0);
if (a[i] < threshold) {
b[i] = 1;
} else {
b[i] = 0;
}
} |
kernel void AKAZE_compute_determinant(global const float* lxx, global const float* lxy, global const float* lyy, global float* dst, float sigma, int size) {
int i = get_global_id(0);
if (!(i < size)) {
return;
}
dst[i] = (lxx[i] * lyy[i] - lxy[i] * lxy[i]) * sigma;
} |
kernel void kernel_remainder_withoutDD1(global float* result_remainder, int N) {
float t1;
float t2;
float t3;
float t4;
float t5;
float t6;
float t7;
float t8;
float t9;
float t10;
float i = 1.0;
float j = 1.0;
float n = (float)(N);
for (i = 1.0; i < n; i = i + 1.0) {
t1 = remainder(i,... |
kernel void sample_single_kernel(global float* src, global int* dst) {
int tid = get_global_id(0);
dst[tid] = (int)src[tid];
} |
kernel void compiler_mixed_pointer1(global unsigned int* src, global unsigned int* dst1, global unsigned int* dst2) {
int x = get_global_id(0);
global unsigned int* tmp = x < 5 ? dst1 : dst2;
tmp[x] = src[x];
} |
kernel void sub(global ushort* out, ushort a, ushort b) {
out[0] = a - b;
} |
kernel void template_kernel(const global char* input, global char* output) {
const int tid = get_global_id(0);
output[tid] = input[tid];
} |
float linear_to_gamma_2_2(float value);
float gamma_2_2_to_linear(float value);
float linear_to_gamma_2_2(float value) {
if (value > 0.003130804954f)
return 1.055f * native_powr(value, (1.0f / 2.4f)) - 0.055f;
return 12.92f * value;
}
float gamma_2_2_to_linear(float value) {
if (value > 0.04045f)
return ... |
kernel void arithm_op_minMax_final(global float* data, int groupnum, global int* g_counter) {
g_counter[0] = 0;
float minVal = data[0];
float maxVal = data[groupnum];
for (int i = 1; i < groupnum; ++i) {
minVal = min(minVal, data[i]);
maxVal = max(maxVal, data[i + groupnum]);
}
data[0] = minVal;
d... |
kernel void kAtan(global const float* inputMatrix, global float* resultMatrix) {
int id = get_global_id(0);
resultMatrix[id] = atan(inputMatrix[id]);
} |
kernel void dwtHaar1D(global float* inSignal, global float* coefsSignal, global float* AverageSignal, local float* sharedArray, unsigned int tLevels, unsigned int signalLength, unsigned int levelsDone, unsigned int mLevels) {
size_t localId = get_local_id(0);
size_t groupId = get_group_id(0);
size_t globalId = ge... |
kernel void divide_shortshort(global short* src_0, global short* src_1, global float* dst) {
int gid = get_global_id(0);
dst[gid] = (float)(src_0[gid] / src_1[gid]);
} |
kernel void kernel_log10_withDD1(global float* result_log10, int N) {
float t1 = 1.34;
int i = 0;
for (i = 0; i < N; i++) {
t1 = log10((t1 + 0.1) / t1);
t1 = log10((t1 + 0.1) / t1);
t1 = log10((t1 + 0.1) / t1);
t1 = log10((t1 + 0.1) / t1);
t1 = log10((t1 + 0.1) / t1);
t1 = log10((t1 + 0.1... |
kernel void kernelStep(global float4* posArray, global float4* colorArray, global float* lifetimeArray, float4 baseColor, float4 par, float4 rayOrigin, float4 rayDir, float time, float deltaTime) {
int gid = get_global_id(0);
float4 pos = posArray[gid];
const float lifetime = 30.;
lifetimeArray[gid] -= delta... |
int numOfNeighbor(global const int* matrix, int posx, int posy, int sizeOfDim) {
int num = 0;
if (posy > 0) {
if (matrix[(posy - 1) * sizeOfDim + posx])
num++;
if (posx > 0 && matrix[(posy - 1) * sizeOfDim + (posx - 1)])
num++;
if (posx + 1 < sizeOfDim && matrix[(posy - 1) * sizeOfDim + (pos... |
;
kernel void plus_1d(global int* input, global int* output, const unsigned int count) {
unsigned int global_index = get_global_id(0);
if (global_index < count) {
for (int i = 0; i < 1024 * 1024 * 64; i++) {
output[global_index] = input[global_index] + input[global_index];
}
}
} |
kernel void kernelAllDatatypes(char inputChar, unsigned char inputUChar, short inputShort, unsigned short inputUShort, int inputInt, unsigned int inputUInt, long inputLong, unsigned long inputULong, float inputFloat, double inputDouble, global float* output) {
output[0] = convert_float(inputChar);
output[1] = conve... |
float3 debugToneMapAndGammaCorrect(float3 sample);
float3 debugToneMapAndGammaCorrect(float3 sample) {
sample *= 1.0f;
float3 mapped = sample / (sample + 1.0f);
return clamp(pow(mapped, 1.0f / 2.2f), 0.0f, 1.0f) * 255.0f;
}
kernel void debugClearBuffer(global uchar4* output) {
output[get_global_id(0)] = (ucha... |
kernel void simple_add(global const long* A, global const long* B, global long* C) {
int i = get_global_id(0);
C[i] = A[i] + B[i];
} |
kernel void test_asinh(const global float* in, global float* out) {
size_t gid = get_global_id(0);
out[gid] = asinh(in[gid]);
} |
kernel void complex_exp(global double2* a) {
unsigned int n = get_global_id(0);
double e = exp(a[n].x);
double s, c;
s = sincos(a[n].y, &c);
a[n].x = c * e;
a[n].y = s * e;
} |
kernel void second_moment_matrix_elements(global float* ddx, global float* ddy, global float* xx, global float* xy, global float* yy) {
int i = get_global_id(0);
float dx = ddx[i];
float dy = ddy[i];
xx[i] = dx * dx;
xy[i] = dx * dy;
yy[i] = dy * dy;
} |
kernel void ELUForward(global float* activationsBatch, global float* preActivationsBatch, const float alpha, const int nTotActivations) {
int i = get_global_id(0);
if (i < nTotActivations) {
if (preActivationsBatch[i] < 0)
activationsBatch[i] = alpha * (exp(preActivationsBatch[i]) - 1.0f);
else
... |
kernel void serial_find_extrema_max(global int* _buf0, global unsigned int* index, unsigned int size) {
int value = _buf0[0];
unsigned int value_index = 0;
for (unsigned int i = 1; i < size; i++) {
int candidate = _buf0[i];
if (((value) < (candidate))) {
value = candidate;
value_index = i;
... |
kernel void predec(global long* out, long in) {
out[0] = --in;
} |
kernel void kPow2(global const float* inputMatrix, global float* resultMatrix, float power) {
int id = get_global_id(0);
resultMatrix[id] = pow(power, inputMatrix[id]);
} |
kernel void brahmaKernel(global int* buf) {
buf[0] = (1 + 2);
} |
constant sampler_t sampler = 0 | 2 | 0x10;
constant sampler_t hpSampler = 0 | 4 | 0x10;
kernel void initFloatBuffer(global float* buffer) {
buffer[get_global_id(0)] = 0.0f;
} |
kernel void relational_less_than_shortshort(global short* src_0, global short* src_1, global int* dst) {
int gid = get_global_id(0);
dst[gid] = (int)(src_0[gid] < src_1[gid]);
} |
kernel void select_uint2_int2(global uint2* dest, global uint2* src1, global uint2* src2, global int2* 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 signbit_float2(global float2* src_0, global int2* dst) {
int gid = get_global_id(0);
dst[gid] = (int2)(signbit(src_0[gid]));
} |
kernel void kernel_acosh_withoutDD1(global float* result_acosh, int N) {
float p1 = 1.23;
float p2 = 1.23;
float p3 = 1.23;
float p4 = 1.23;
float p5 = 1.23;
float p6 = 1.23;
float p7 = 1.23;
float p8 = 1.23;
float p9 = 1.23;
float p10 = 1.23;
float i = 0.0;
float n = N + 1.0;
for (i = 0.0; ... |
kernel void frameDiffCharInt(global char* v, global int* v2) {
unsigned int i = get_global_id(0);
if (abs(v[i] - v2[i]) < 20) {
v[i] = 0;
}
} |
kernel void test_stream_write_int(global int* src, global int* dst) {
int tid = get_global_id(0);
dst[tid] = src[tid];
} |
kernel void Sgemv_naive(int trans, int m, int n, float alpha, global float* A, int lda, global float* x, int incx, float beta, global float* y, int incy) {
if (trans == (0)) {
for (unsigned int row_id = 0; row_id < m; ++row_id) {
float l_result = 0;
for (unsigned int col_id = 0; col_id < n; ++col_id) ... |
kernel void Histogram(global unsigned int* data, global unsigned int* histograms, unsigned int bits) {
size_t globalId = get_global_id(0);
unsigned int hist[(1 << 4)] = {0};
for (int i = 0; i < 32; ++i) {
unsigned int value = data[globalId * 32 + i];
unsigned int pos = (value >> bits) & ((1 << 4) - 1);
... |
kernel void VecAdd(global const int* a, global const int* b, global int* c, int numElements) {
int GID = get_global_id(0);
if (GID < numElements) {
c[GID] = a[GID] + b[numElements - GID - 1];
}
} |
kernel void kernel_asin_withDD1(global float* result_asin, int N) {
float t1 = 0.0;
int i = 0;
for (i = 0; i < N; i++) {
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
t1 = asin(t1);
... |
kernel void compiler_switch(global int* dst, global int* src) {
switch (get_global_id(0)) {
case 0:
dst[get_global_id(0)] = src[get_global_id(0) + 4];
break;
case 1:
dst[get_global_id(0)] = src[get_global_id(0) + 14];
break;
case 2:
dst[get_global_id(0)] = src[get_global_id(0... |
float4 sortElem(float4 r) {
float4 nr;
nr.x = (r.x > r.y) ? r.y : r.x;
nr.y = (r.y > r.x) ? r.y : r.x;
nr.z = (r.z > r.w) ? r.w : r.z;
nr.w = (r.w > r.z) ? r.w : r.z;
r.x = (nr.x > nr.z) ? nr.z : nr.x;
r.y = (nr.y > nr.w) ? nr.w : nr.y;
r.z = (nr.z > nr.x) ? nr.z : nr.x;
r.w = (nr.w > nr.y) ? nr.w :... |
kernel void foo(global int4* in, global int4* out, global int* index) {
size_t gid = get_global_id(0);
out[gid][index[gid]] = 42;
} |
kernel void reset_x(global float* x, const int n, const float val) {
int i = get_global_id(0);
if (i < n) {
x[i] = val;
}
return;
} |
constant unsigned long k[] = {0x428a2f98d728ae22UL, 0x7137449123ef65cdUL, 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL, 0x3956c25bf348b538UL, 0x59f111f1b605d019UL, 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL, 0xd807aa98a3030242UL, 0x12835b0145706fbeUL, 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL, 0x72be5d74f27b896fUL, 0x80... |
kernel void set_identity_kernel(const unsigned size, const unsigned skip, global float* py) {
const unsigned i = get_global_id(0);
if (i < size)
py[i] = !(i % skip);
} |
kernel void usm_hello_world_kernel(const global unsigned int* input, global unsigned int* output) {
const int tid = get_global_id(0);
output[tid] = input[tid];
} |
kernel void fill_vbo(global float* vbo) {
int id = get_global_id(0);
vbo[id] = (id % 6) / 3 + (id % 2) * (id / 6);
vbo[id] /= 3;
} |
float t_logpdf(float theta, float df, float loc, float scale) {
float part1 = lgamma((df + 1.0f) / 2.0f) - lgamma(0.5f * df) - log(pow(df * 3.14159265358979323846264338327950288f, 0.5f) * scale);
float part2 = -0.5f * (df + 1.0f) * log(1.0f + (1.0f / df) * pow((float)(theta - loc) / scale, 2.0f));
return part1 + ... |
kernel void dummy(global int* array) {
const int i = get_global_id(0);
array[i] = i;
} |
kernel void evaluateEllipsoid(global const float* parameter, global const float* samplingValues, global float* outputBuffer, int numKnotsU, int numKnotsV) {
int numElements = numKnotsU * numKnotsV;
int iGID = get_global_id(0);
if (iGID >= numElements) {
return;
}
int gridWidth = (int)sqrt((float)numEle... |
kernel void oclp_kernel(global float* ps, global float* vl, global float* r, global float* m, global float* q, float dt) {
size_t i = 3 * get_global_id(0);
float4 pos = (float4)(ps[i], ps[i + 1], ps[i + 2], 1);
float4 vel = (float4)(vl[i], vl[i + 1], vl[i + 2], 1);
float4 new_pos = pos + vel * dt;
if (fabs(... |
kernel void add_source(global float* dest, global float* src, float dt) {
int gid = get_global_id(0);
dest[gid] += dt * src[gid];
} |
kernel void add_numbers(global float4* data, local float* local_result, global float* group_result) {
float sum;
float4 input1, input2, sum_vector;
unsigned int global_addr, local_addr;
global_addr = get_global_id(0) * 2;
input1 = data[global_addr];
input2 = data[global_addr + 1];
sum_vector = input1 + i... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.