kernel_code stringlengths 49 1.22M |
|---|
kernel void test_fa1_3_1_kern(global float* a0, global float* a1, global float* a2, global float* b0) {
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;
barrier(0x01);
b0[gtid] = (0.0f + 1.1f) * (+tmp0 + tmp1 + tmp2);
} |
kernel void evaluateCylinder(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)numElem... |
kernel void addBySaveVal(global float* grid, const float value, int const num_elements) {
int global_id = get_global_id(0);
if (global_id >= num_elements)
return;
if (isnan(grid[global_id]) || isinf(grid[global_id]))
grid[global_id] = 0;
grid[global_id] += value;
} |
kernel void serial_adjacent_find(const unsigned int size, global unsigned int* output, global int* _buf0) {
unsigned int result = size;
for (unsigned int i = 0; i < size - 1; i++) {
if (_buf0[i] == _buf0[i + 1]) {
result = i;
break;
}
}
*output = result;
} |
kernel void rdft(global float* x, global float* y, const int N) {
int num_vectors = N / 4;
float X_real = 0.0f;
float X_imag = 0.0f;
float4 input, arg, w_real, w_imag;
float two_pi_k_over_N = 2 * 3.14159265358979323846264338327950288f * get_global_id(0) / N;
for (int i = 0; i < num_vectors; i++) {
ar... |
inline void order(unsigned int* x, unsigned int a, unsigned int b, bool asc) {
if (asc ^ (x[a] < x[b])) {
unsigned int auxa = x[a];
unsigned int auxb = x[b];
x[a] = auxb;
x[b] = auxa;
}
}
inline void merge2(unsigned int* x, bool asc) {
for (int j = 0; j < 1; j++)
order(x, j, j + 1, asc);
;
... |
kernel void vector_mult_opencl(unsigned int nx, global float* val, float factor) {
const int i = get_global_id(0);
if (i < nx) {
val[i] *= factor;
}
} |
kernel void half_log_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = half_log(src_0[gid]);
} |
kernel void same_location(global float* buffer, global float* dummyBuffer) {
*dummyBuffer = buffer[0];
} |
kernel void multiply_floatfloat(global float* src_0, global float* src_1, global float* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] * src_1[gid];
} |
kernel void clkernel_sigmoid(const int num, global const float* in, global float* out) {
const int i = get_global_id(0);
if (i >= num)
return;
out[i] = 1 / (1 + exp(-(in[i])));
} |
kernel void foo(global int* a) {
*a = *a + 1;
} |
kernel void bitselect_long16long16long16(global long16* src_0, global long16* src_1, global long16* src_2, global long16* dst) {
int gid = get_global_id(0);
dst[gid] = bitselect(src_0[gid], src_1[gid], src_2[gid]);
} |
kernel void prefix_sum_init(global int* counts, global unsigned long* prefix_sum) {
int thread_idx = get_global_id(0);
int n = get_global_size(0);
prefix_sum[thread_idx] = (thread_idx > 0) ? counts[thread_idx - 1] : 0;
} |
kernel void buffSizeTest(global int* v) {
unsigned int i = get_global_id(0);
v[i] = 0;
} |
kernel void copy(global int* _buf0, global int* _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] = _buf1[index];
index += 8;
}
}
} |
kernel void cl_copy_weigthed_blend(global const float4* in, global float4* out) {
int gid = get_global_id(0);
float4 in_v = in[gid];
out[gid] = in_v;
} |
kernel void test_block_4_5_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* b0, global int* b1, global int* b2, global int* b3, global int* b4, local int* c0, local int* c1, local int* c2, local int* c3) {
int i;
unsigned int gtid = get_global_id(0);
unsigned int ltid = get_local_i... |
kernel void average(global const int* a, global const int* b, global int* out, int n) {
int i = get_global_id(0);
if (i >= n)
return;
out[i] = (95 * b[i]) / 100 + (5 * a[i]) / 100;
} |
kernel void test_switch_more(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;
break;
case -1:
out[gid] = val * 5;
break;
case 1:
out[gid] = val * 17;
... |
inline float sigmoid(float z) {
return 1.0f / (1.0f + exp(-z));
}
inline float sigmoid_gradient(float y) {
return y * (1.0f - y);
}
inline float relu(float z) {
return z > 0 ? z : 0;
}
inline float relu_gradient(float y) {
return y > 0 ? 1 : 0;
}
inline float tanh_gradient(float y) {
return 1.0f - y * y;
}
... |
kernel void add_sat_ulong8ulong8(global ulong8* src_0, global ulong8* src_1, global ulong8* dst) {
int gid = get_global_id(0);
dst[gid] = add_sat(src_0[gid], src_1[gid]);
} |
kernel void isordered_float2float2(global float2* src_0, global float2* src_1, global int2* dst) {
int gid = get_global_id(0);
dst[gid] = (int2)(isordered(src_0[gid], src_1[gid]));
} |
kernel void pre_increment_uchar(global uchar* src_0, global uchar* dst) {
int gid = get_global_id(0);
dst[gid] = ++src_0[gid];
} |
kernel void test_arg_7_1_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* a4, global float* a5, global float* a6, global float* b0) {
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 ... |
kernel void atomTest3(global int* out) {
int lid = get_local_id(0);
int t1 = atomic_add(&out[0], lid);
} |
float calculation(global float* dataEndListArg, global float* dataTurnoverListArg, global float* successListArg, int dataSize, int samplingSize, global float* parameterListArgs, int parameterCellSize, global float* resultListArgs, int resultCellSize, int i, int x) {
float result = 0;
for (int j = samplingSize - 1;... |
kernel void kernel0_local_read(global char* ptr, unsigned long memsize, volatile global unsigned int* err_count, global unsigned long* err_addr, global unsigned long* err_expect, global unsigned long* err_current, global unsigned long* err_second_read) {
int i;
global unsigned long* buf = (global unsigned long*)ptr... |
kernel void default_kernel(global uchar* dst, global const uchar* src, const unsigned int size) {
int gid = get_global_id(0);
int lid = get_local_id(0);
dst[gid] = src[gid];
} |
float Phi(float X) {
float y, absX, t;
const float c1 = 0.319381530f;
const float c2 = -0.356563782f;
const float c3 = 1.781477937f;
const float c4 = -1.821255978f;
const float c5 = 1.330274429f;
const float oneBySqrt2pi = 0.398942280f;
absX = fabs(X);
t = 1.0f / (1.0f + 0.2316419f * absX);
y = ... |
kernel void AtomicSum(global int* s) {
const int i = 1;
atomic_add(s, i);
} |
kernel void pre_decrement_char16(global char16* src_0, global char16* dst) {
int gid = get_global_id(0);
dst[gid] = --src_0[gid];
} |
kernel void foo(global char* out, int a, int b) {
char x;
if (a == 10 || b == 2)
x = 2;
else if (b == 12 && a == 4)
x = 3;
else if (b != 3 || a != 5)
x = 1;
else
x = 0;
*out = x;
} |
kernel void hypot_float4float4(global float4* src_0, global float4* src_1, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = hypot(src_0[gid], src_1[gid]);
} |
kernel void sub_sat_uintuint(global unsigned int* src_0, global unsigned int* src_1, global unsigned int* dst) {
int gid = get_global_id(0);
dst[gid] = sub_sat(src_0[gid], src_1[gid]);
} |
kernel void isless_float4float4(global float4* src_0, global float4* src_1, global int4* dst) {
int gid = get_global_id(0);
dst[gid] = (int4)(isless(src_0[gid], src_1[gid]));
} |
kernel void mc_kernel_gridGrad(int volnx, int volny, int volnz, float edgex, float edgey, float edgez, global float4* mcgrid, global float4* mcgridGrad) {
size_t gid = get_global_id(0);
if (mcgridGrad[gid].w != -1.0) {
mcgridGrad[gid].x = (mcgrid[gid - 1].w - mcgrid[gid + 1].w) / edgex;
mcgridGrad[gid].y =... |
float boundRange(float x, float lowerLimit, float upperLimit) {
return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x));
}
float Logistic_fn(float x) {
if (x < 88.722839f) {
if (x > -88.722839f)
return (float)1.0 / ((float)1.0 + exp(-x));
else
return 0;
}
return 1;
}
floa... |
kernel void serial_insertion_sort_by_key_float(local float* keys, local float4* data, unsigned int n, global float* _buf0, global float4* _buf1) {
for (unsigned int i = 0; i < n; i++) {
keys[i] = _buf0[i];
data[i] = _buf1[i];
}
for (unsigned int i = 1; i < n; i++) {
const float key = keys[i];
cons... |
kernel void clkernel_divide_scalar_matx(const int num, global const float* in1, const float x, global float* out) {
const int i = get_global_id(0);
if (i >= num)
return;
out[i] = in1[i] / x;
} |
kernel void relational_less_than_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 SignedDistanceTransformUnsignedByte(global const unsigned char* vIn, global unsigned char* vOut, int iDx, int iDy, int max_dist) {
int iGID = get_global_id(0);
if (iGID >= (iDx * iDy)) {
return;
}
int idX = iGID % iDy;
int idY = iGID / iDy;
float2 pos = (float2)(idX, idY);
int minX = cla... |
kernel void multiply_kernel2D(global float2* projFFT, int4 fftDimension, global float2* kernelFFT) {
const unsigned int idx = get_global_id(0);
const unsigned int w = idx % (fftDimension.x * fftDimension.y);
int j = w / fftDimension.x;
int i = w % fftDimension.x;
long int kernel_idx = i + j * fftDimension.x... |
kernel void search(unsigned int p_count, global char* _buf0, global char* _buf1, global unsigned int* _buf2) {
unsigned int i = get_global_id(0);
const unsigned int i1 = i;
unsigned int j;
for (j = 0; j < p_count; j++, i++) {
if (_buf0[j] != _buf1[i])
j = p_count + 1;
}
if (j == p_count)
_buf2... |
kernel void test_min(const global float* x, const global float* y, global float* out) {
unsigned int gid = get_global_id(0);
out[gid] = min(x[gid], y[gid]);
} |
kernel void div(global int* out, int a, int b) {
out[0] = a / b;
} |
double dev_round_double(double value) {
int newValue = (int)(value);
if (value - newValue < .5f)
return newValue;
else
return newValue++;
}
double calcLikelihoodSum(global unsigned char* I, global int* ind, int numOnes, int index) {
double likelihoodSum = 0.0;
int x;
for (x = 0; x < numOnes; x++)
... |
float boundRange(float x, float lowerLimit, float upperLimit) {
return (x < lowerLimit ? lowerLimit : (x > upperLimit ? upperLimit : x));
}
float Logistic_fn(float x) {
if (x < 88.722839f) {
if (x > -88.722839f)
return (float)1.0 / ((float)1.0 + exp(-x));
else
return 0;
}
return 1;
}
floa... |
kernel void square(global int* data, unsigned int size) {
unsigned int gid = get_global_id(0);
if (gid < size) {
data[gid] = data[gid] * data[gid];
}
} |
kernel void matvec_mul4_float(global const float* A, int offA, unsigned int A_col_size, unsigned int trail_item, global const float* v, int offv, float alpha, float beta, global float4* result, int offr, local float4* work) {
unsigned int row_gid = get_group_id(0);
unsigned int lid = get_local_id(0);
const global... |
inline void addData1024(volatile local unsigned int* s_WarpHist, unsigned int data, unsigned int tag) {
unsigned int count;
do {
count = s_WarpHist[data] & 0x07FFFFFFU;
count = tag | (count + 1);
s_WarpHist[data] = count;
} while (s_WarpHist[data] != count);
}
kernel void histogram1024Kernel(global u... |
kernel void FillBufferLeftLeftover(global uchar* pDst, unsigned int dstOffsetInBytes, const global uchar* pPattern, const unsigned int patternSizeInEls) {
unsigned int gid = get_global_id(0);
pDst[gid + dstOffsetInBytes] = pPattern[gid & (patternSizeInEls - 1)];
} |
kernel void mergeData(global const int* input, unsigned int dataSize, unsigned int partsCount, global int* output, unsigned int outputSize) {
int id = get_global_id(0);
int itemsPerThread = outputSize / get_global_size(0);
for (int i = 0; i < itemsPerThread; i++) {
output[(id * itemsPerThread) + i] = input[... |
kernel void fir(global int* in, global int* coeff, global int* out, int filter_len) {
int index = get_global_id(0);
int i = 0, acc = 0;
do {
acc += in[index + i] * coeff[i];
i++;
} while (i != filter_len);
out[index] = acc;
} |
kernel void unifiedBlockScan(global unsigned int* output, global unsigned int* input, local unsigned int* sharedMem, const unsigned int block_size) {
int id = get_local_id(0);
int gid = get_global_id(0);
int bid = get_group_id(0);
sharedMem[id] = input[gid];
unsigned int cache = sharedMem[0];
for (int st... |
kernel void testWorkGroupSMax(int a, global int* res) {
res[0] = work_group_reduce_max(a);
} |
kernel void subtractBy(global float* gridA, const global float* gridB, int const num_elements) {
int global_id = get_global_id(0);
if (global_id >= num_elements)
return;
gridA[global_id] -= gridB[global_id];
} |
kernel void WipeBufferBoolKernel(global bool* buffer, const int nBufferElements) {
const unsigned int i = get_global_id(0);
if (i < nBufferElements) {
buffer[i] = false;
}
} |
kernel void builtin_tgamma(global float* src, global float* dst) {
int i = get_global_id(0);
dst[i] = tgamma(src[i]);
} |
kernel void prefixSum(global int* restrict output, global int* restrict input, const unsigned int in_size) {
local int p_in[512];
local int p_out[512];
int base = 0;
int cnt = in_size / 512;
for (int i = 0; i < cnt; i++) {
for (int b = 0; b < 512; b++)
p_in[b] = input[i * 512 + b];
p_out[0] = ... |
kernel void expontial(global float* grid, int const num_elements) {
int global_id = get_global_id(0);
if (global_id >= num_elements)
return;
grid[global_id] = exp(grid[global_id]);
} |
kernel void cosh_float16(global float16* src_0, global float16* dst) {
int gid = get_global_id(0);
dst[gid] = cosh(src_0[gid]);
} |
kernel void cube(global int* input, global int* output) {
int i = get_global_id(0);
output[i] = input[i] * input[i] * input[i];
} |
kernel void test_clamp(global char3* out, global char3* in) {
*out = clamp(*in, (char3)7, (char3)42);
} |
kernel void builtin_shuffle(global float* src1, global float* src2, global float* dst1, global float* dst2) {
int i = get_global_id(0);
float2 src = (float2)(src1[i], src2[i]);
uint2 mask = (uint2)(1, 0);
float2 dst = shuffle(src, mask);
dst1[i] = dst.s0;
dst2[i] = dst.s1;
} |
kernel void expm1_float2(global float2* src_0, global float2* dst) {
int gid = get_global_id(0);
dst[gid] = expm1(src_0[gid]);
} |
kernel void kernelFloat(float2 input, global float2* output) {
output[0] = input;
} |
kernel void inverse(global float* a, global float* result) {
int gid = get_global_id(0);
result[gid] = 1.0f / a[gid];
} |
int divRndUp(int n, int d) {
return (n / d) + ((n % d) ? 1 : 0);
}
void storeComponents(global int* d_r, global int* d_g, global int* d_b, int r, int g, int b, int pos) {
d_r[pos] = r - 128;
d_g[pos] = g - 128;
d_b[pos] = b - 128;
}
void storeComponent(global int* d_c, const int c, int pos) {
d_c[pos] = c - 1... |
kernel void plus(global short* out, short in) {
out[0] = +in;
} |
kernel void test_switch_2_default(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 17:
out[gid] = val;
break;
default:
out[gid] = -val;
}
} |
kernel void CopyBufferToBufferBytes(const global uchar* pSrc, global uchar* pDst, unsigned int srcOffsetInBytes, unsigned int dstOffsetInBytes, unsigned int bytesToRead) {
pSrc += (srcOffsetInBytes + get_global_id(0));
pDst += (dstOffsetInBytes + get_global_id(0));
pDst[0] = pSrc[0];
} |
kernel void kernel_write(global char* ptr, unsigned long memsize, unsigned long p1) {
int i;
global unsigned long* buf = (global unsigned long*)ptr;
int idx = get_global_id(0);
unsigned long n = memsize / sizeof(unsigned long);
int total_num_threads = get_global_size(0);
for (i = idx; i < n; i += total_num... |
float addLogs(float A, float B) {
float maxi = fmax(A, B);
float corr = native_log(1.0 + native_exp(-fabs(A - B)));
return maxi + corr;
}
kernel void dataOut(global float* alpha, global float* beta, global float* gamma, global float* dataOUT) {
int _outputs[16] = {0, 0, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 2, 2, 3, 3... |
kernel void fill(global float* grid, const float value, int const num_elements) {
int global_id = get_global_id(0);
if (global_id >= num_elements)
return;
grid[global_id] = value;
} |
kernel void reduce4_sl(global float* restrict out, global const float4* restrict in, int n_hex) {
int i = get_global_id(0);
int gws = get_global_size(0);
if (i >= n_hex)
return;
float4 v0 = in[i + 0 * gws];
float4 v1 = in[i + 1 * gws];
float4 v2 = in[i + 2 * gws];
float4 v3 = in[i + 3 * gws];
float... |
float calcFirstDer(float x11, float x21, float x31, float x12, float x22, float x32, float x13, float x23, float x33, float inputNodataValue, float outputNodataValue, float zFactor, float mCellSize) {
int weight = 0;
float sum = 0;
if (x31 != inputNodataValue && x11 != inputNodataValue) {
sum += (x31 - x11);... |
kernel void post_increment_uchar(global uchar* src_0, global uchar* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid]++;
} |
kernel void prefix_sum(global int* restrict A, global int* restrict B, private int numOfIterations) {
size_t tid = get_global_id(0);
for (int d = 0; d < numOfIterations; ++d) {
if (tid >= (1 << d)) {
B[tid] = A[tid - (1 << d)] + A[tid];
} else {
B[tid] = A[tid];
}
barrier(0x02);
gl... |
kernel void test_arg_4_5_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* b0, global int4* b1, global int4* b2, global int4* b3, global int4* b4) {
int4 za = (int4)(0, 1, 2, 3);
unsigned int gtid = get_global_id(0);
int4 tmp0 = a0[gtid] + 0 + za;
int4 tmp1 = a1[gtid] + 1 + z... |
kernel void async_copy_loop(global int* data, local int* scratch) {
int i = get_local_id(0);
event_t event = 0;
for (int j = 0; j < get_local_size(0); j++) {
int offset = j;
event = async_work_group_copy(scratch + offset, data + offset, 1, event);
}
wait_group_events(1, &event);
data[get_local_siz... |
kernel void ratxb_kernel(global const float* T, global const float* C, global float* RF, global float* RB, global const float* RKLOW, const float TCONV) {
const float TEMP = T[get_global_id(0)] * TCONV;
const float ALOGT = log((TEMP));
float CTOT = 0.0f;
float PR, PCOR, PRLOG, FCENT, FCLOG, XN;
float CPRLOG, ... |
kernel void mainKernel(global const float4* a, const long num, global float4* c) {
int iGID = get_global_id(0);
c[iGID] = a[iGID];
} |
int func_1(global int* in, int n) {
return in[n];
}
kernel void func_0(global int* in, global int* out, int n) {
out[n] = func_1(in, n);
} |
kernel void Film_MergeBufferFinalize(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];
const float pixelR = ch... |
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 Film_MergeRADIANCE_PER_SCREEN_NORMALIZED(const unsigned int filmWidth, const unsigned int filmHeight, global float* channel_IMAGEPIPELINE, global float* mergeBuffer, const float scaleR, const float scaleG, const float scaleB) {
const size_t gid = get_global_id(0);
if (gid > filmWidth * filmHeight)
r... |
kernel void serial_reduce_by_key(unsigned int count, global unsigned int* result_size, global int* _buf0, global int* _buf1, global int* _buf2, global int* _buf3) {
int result = _buf0[0];
int previous_key = _buf1[0];
int value;
int key;
unsigned int size = 1;
_buf2[0] = previous_key;
_buf3[0] = result;
... |
void SHA256(uint4* restrict state0, uint4* restrict state1, const uint4 block0, const uint4 block1, const uint4 block2, const uint4 block3) {
uint4 S0 = *state0;
uint4 S1 = *state1;
uint4 W[4];
W[0].x = block0.x;
S1.w += (rotate(S1.x, 26U) ^ rotate(S1.x, 21U) ^ rotate(S1.x, 7U)) + bitselect(S1.z, S1.y, S1.x)... |
kernel void test_arg_4_3_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* b0, global int* b1, global int* b2) {
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) * (+tmp... |
kernel void kernelChar(char8 input, global char8* output) {
output[0] = input;
} |
kernel void round_float4(global float4* src_0, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = round(src_0[gid]);
} |
kernel void encrypt1(const global uint4* input, global uint4* output, const global uint2* constant_key, const global unsigned int* global_sbox1, const global unsigned int* global_sbox2, const global unsigned int* global_sbox3, const global unsigned int* global_sbox4, local unsigned int* sbox1, local unsigned int* sbox2... |
kernel void kernel_round_withoutDD1(global float* result_round, 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 n = 0.3 * (float)(N);
for (i = 1.0; i < n; i = i + 0.01) {
t1 = round(i);
t2 = round(i + 0... |
kernel void MaxPoolingForward(global float* output, global float* input, 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 * miniBatch... |
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
kernel void builtin_convert_float_to_short_sat(global float* src, global short* dst) {
int i = get_global_id(0);
dst[i] = convert_short_sat(src[i]);
} |
kernel void moveObjectsKernel(global float4* posOrnColors, int numObjects) {
int iGID = get_global_id(0);
if (iGID >= numObjects)
return;
global float4* positions = &posOrnColors[0];
if (iGID < 0.5 * numObjects) {
positions[iGID].y += 0.01f;
}
global float4* colors = &posOrnColors[numObjects * 2];
... |
kernel void calculateBin(const unsigned int bin, global uchar4* sm_mapping) {
unsigned char offset = bin % 4;
unsigned char indexlo = (bin >> 2) % 256;
unsigned char indexhi = (bin >> 10) % 2;
unsigned char block = bin / 8;
offset *= 8;
uchar4 sm;
sm.x = block;
sm.y = indexhi;
sm.z = indexlo;
sm.w... |
kernel void kernel_rsqrt_withDD8(global float* result_rsqrt, int N) {
float t1 = 23456.234;
float8 t2 = t1 + (float8)(1, 1, 1, 0, 1, 0, 1, 1.1);
int i = 0;
for (i = 0; i < N; i++) {
t2 = rsqrt(t2);
t2 = rsqrt(t2);
t2 = rsqrt(t2);
t2 = rsqrt(t2);
t2 = rsqrt(t2);
t2 = rsqrt(t2);
t2 = r... |
kernel void compiler_double_3(global float* src, global double* dst) {
int i = get_global_id(0);
float d = 1.234567890123456789f;
dst[i] = i < 14 ? d : 14;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.