kernel_code stringlengths 49 1.22M |
|---|
kernel void mataccKernel4(global float4* mA, global float* mC, const unsigned int mWidth) {
unsigned int g_id = get_group_id(0);
unsigned int nunits = get_num_groups(0);
float4 elt = (float4)(0.0);
for (unsigned int idx = 0; idx < mWidth * mWidth / 4 / nunits; idx++) {
float4 mAtmp = mA[idx];
elt.s0 += ... |
double2 when_eq(double2 x, double2 y) {
return 1.0f - fabs(sign(x - y));
}
double when_neq(double x, double y) {
return fabs(sign(x - y));
}
double2 when_gt(double2 x, double2 y) {
return max(sign(x - y), 0.0);
}
double2 when_lt(double2 x, double2 y) {
return min(1.0f - sign(x - y), 1.0f);
}
double2 when_ge(... |
kernel void callback(global float* buffer) {
float4 five_vector = (float4)(5.0);
for (int i = 0; i < 1024; i++) {
vstore4(five_vector, i, buffer);
}
} |
kernel void remainder_int4int4(global int4* src_0, global int4* src_1, global int4* dst) {
int gid = get_global_id(0);
dst[gid] = src_0[gid] % src_1[gid];
} |
kernel void vadd(global float* a, global float* b, global float* c, global float* d, const unsigned int count) {
int i = get_global_id(0);
if (i < count) {
d[i] = a[i] + b[i] + c[i];
}
} |
kernel void fir_byte_improved(global char4* in, global char4* coeff, global char4* out, int filter_len) {
int index = get_global_id(0);
int i = 0, acc1 = 0, acc2 = 0, acc3 = 0, acc4 = 0;
do {
acc1 += in[index + i].x * coeff[i].x;
acc1 += in[index + i].y * coeff[i].y;
acc1 += in[index + i].z * coeff[i]... |
kernel void bsort_preprocess_kv(global uint4* g_data, global uint4* g_data_v, unsigned int valMax) {
unsigned int id, global_start;
uint4 input1, input2, input1_v, input2_v;
id = get_local_id(0) * 2;
global_start = get_group_id(0) * get_local_size(0) * 2 + id;
input1 = g_data[global_start];
input2 = g_dat... |
kernel void test_arg_5_2_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* a4, 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;
int4 tmp1 = a1[gtid] + 1 + za;
int4 tmp2 = a2[gtid] + 2 + za... |
kernel void atomic(global int* x) {
local int a, b;
a = 0;
b = 0;
a++;
atomic_inc(&b);
x[0] = a;
x[1] = b;
} |
kernel void bar(global float* out, float a, float b) {
*out = a + b;
} |
kernel void ZeroUnpad(global float* unpaddedArrayBatch, global float* paddedArrayBatch, global int* paddingLookupTable, const int unpaddedVolume, const int paddedVolume, const int miniBatchSize) {
const int iUnpadded = get_global_id(0);
if (iUnpadded < unpaddedVolume * miniBatchSize) {
int iExample = iUnpadded... |
kernel void min_charchar(global char* src_0, global char* src_1, global char* dst) {
int gid = get_global_id(0);
dst[gid] = min(src_0[gid], src_1[gid]);
} |
kernel void relu2D(global float* X, global int* xdims, global float* out) {
int i = get_global_id(0);
int total = xdims[0] * xdims[1];
if (i < total) {
out[i] = (X[i] < 0) ? 0 : X[i];
}
} |
float formFactor(float4 RecvPos, float4 ShootPos, float4 RecvNormal, float4 ShootNormal, float ShootDArea) {
float pi = (float)3.14159265358979323846f;
if (ShootPos.x == RecvPos.x && ShootPos.y == RecvPos.y && ShootPos.z == RecvPos.z) {
return 0.0;
}
float4 r = ShootPos - RecvPos;
float distance2 = dot... |
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 relational_less_than_charchar(global char* src_0, global char* src_1, global int* dst) {
int gid = get_global_id(0);
dst[gid] = (int)(src_0[gid] < src_1[gid]);
} |
kernel void EM_betaB_alphabeta(global const float* beta, global const float* B, global float* betaB, global const float* alpha, global float* alpha_beta, const int N, const int current, const int previous) {
size_t idx = get_global_id(0);
if (idx < N) {
betaB[idx] = beta[previous + idx] * B[previous + idx];
... |
kernel void Scan(global int* globalArray, int length, int step, local int* localArray) {
int localID = get_local_id(0);
int groupID = get_group_id(0);
int groupSize = get_local_size(0);
int startOffset = (groupSize << 1) * groupID * step;
int posi1 = startOffset + localID * step;
int posi2 = posi1 + groupS... |
kernel void ave_pool_forward(const int nthreads, global const float* const bottom, const int channels, const int height, const int width, const int pooled_h, const int pooled_w, const int kernel_h, const int kernel_w, const int stride_h, const int stride_w, const int pad_h, const int pad_w, global float* top) {
for (... |
float3 VertexInterp(float isolevel, float3 p1, float3 p2, float valp1, float valp2) {
float mu;
float3 p;
if ((isolevel - valp1 < 0 ? -(isolevel - valp1) : (isolevel - valp1)) < 0.00001)
return (p1);
if ((isolevel - valp2 < 0 ? -(isolevel - valp2) : (isolevel - valp2)) < 0.00001)
return (p2);
if ((va... |
kernel void test_arg_5_1_kern(global int4* a0, global int4* a1, global int4* a2, global int4* a3, global int4* a4, global int4* b0) {
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 + za;
int4 tmp2 = a2[gtid] + 2 + za;
int4 tmp3 = a... |
kernel void frameDiffCharFloat(global char* v, global float* v2) {
unsigned int i = get_global_id(0);
if (abs(v[i] - (int)v2[i]) < 20) {
v[i] = 0;
}
} |
kernel void as_cpu(global float* s1, float fac2, unsigned int options2, global const float* s2) {
float alpha = fac2;
if (options2 & (1 << 0))
alpha = -alpha;
if (options2 & (1 << 1))
alpha = ((float)(1)) / alpha;
*s1 = *s2 * alpha;
} |
constant double fourPi = 12.566370614359172;
constant double2 cmp0 = (double2)(0, 0);
constant double2 cmpi1 = (double2)(0, 1);
double2 prod_c(double2 a, double2 b) {
return (double2)(a.x * b.x - a.y * b.y, a.y * b.x + a.x * b.y);
}
double2 conj_c(double2 a) {
return (double2)(a.x, -a.y);
}
double abs_c(double2 a) ... |
kernel void hadd_char16char16(global char16* src_0, global char16* src_1, global char16* dst) {
int gid = get_global_id(0);
dst[gid] = hadd(src_0[gid], src_1[gid]);
} |
kernel void ParallelBitonic_B4(global unsigned int* restrict data, int inc, int dir) {
inc >>= 1;
int t = get_global_id(0);
int low = t & (inc - 1);
int i = ((t - low) << 2) + low;
bool reverse = ((dir & i) == 0);
data += i;
unsigned int x0 = data[0];
unsigned int x1 = data[inc];
unsigned int x2 = da... |
kernel void phase_shift(global float* xFFT, int xRealSize, global float* shiftFFT, float shift, float dt) {
float a, b, c, d, omega;
int i = get_global_id(0);
if (i > xRealSize)
return;
a = xFFT[2 * i];
b = xFFT[2 * i + 1];
if (i == 0) {
omega = 3.14159265358979323846f / dt;
shiftFFT[0] = a;
... |
kernel void abs_diff_char4char4(global char4* src_0, global char4* src_1, global uchar4* dst) {
int gid = get_global_id(0);
dst[gid] = (uchar4)(abs_diff(src_0[gid], src_1[gid]));
} |
kernel void multiply_float_const(global float* restrict a, global float* restrict c) {
size_t index = get_global_id(0);
c[index] = a[index] * 3.0;
} |
kernel void compiler_long(global long* src1, global long* src2, global long* dst, long zero) {
int i = get_global_id(0);
if (i < 5)
dst[i] = src1[i] + src2[i] + src2[i] * zero;
if (i > 5)
dst[i] = src1[i] - src2[i] - zero;
} |
constant float QUAR = 0.25;
constant float HALF = 0.5;
constant float TWO = 2.;
constant float SIX = 6.;
constant bool isHiPrecision = sizeof(TWO) == 8;
constant float2 zero2 = (float2)(0, 0);
constant float PI2 = (float)6.283185307179586476925286766559;
constant float E2W = 1.51926751475e15;
constant float C = 2.99792... |
size_t my_strlen(constant char* str) {
size_t len = 0;
if (str)
while (*str++)
++len;
return len;
}
void my_strcpy(global char* dest, constant char* src, size_t n) {
while (n--)
*dest++ = *src++;
}
void set_error_msg(global char* error_msg, size_t error_msg_size, constant char* msg) {
const si... |
kernel void kern(global unsigned int* a, global unsigned int* b, global unsigned* result) {
result[0] = a[0] / b[0];
} |
kernel void test_arg_1_4_kern(global int* a0, global int* b0, global int* b1, global int* b2, global int* b3) {
unsigned int gtid = get_global_id(0);
int tmp0 = a0[gtid] + 0;
b0[gtid] = (0 + 1) * (+tmp0);
b1[gtid] = (1 + 1) * (+tmp0);
b2[gtid] = (2 + 1) * (+tmp0);
b3[gtid] = (3 + 1) * (+tmp0);
} |
kernel void max_float8float8(global float8* src_0, global float8* src_1, global float8* dst) {
int gid = get_global_id(0);
dst[gid] = max(src_0[gid], src_1[gid]);
} |
kernel void Scan(global unsigned int* histogram) {
unsigned int sum = 0;
for (size_t i = 0; i < (1 << 2); ++i) {
unsigned int val = histogram[i];
histogram[i] = sum;
sum += val;
}
} |
kernel void kPown(global const float* inputMatrix, global float* resultMatrix, int power) {
int id = get_global_id(0);
resultMatrix[id] = pown(inputMatrix[id], power);
} |
kernel void Srotg_naive(global float* a, global float* b, global float* c, global float* s) {
float r, z;
float roe = *b;
float fabsa = fabs(*a);
float fabsb = fabs(*b);
if (fabsa > fabsb)
roe = *a;
float scale = fabsa * fabsb;
if (scale == 0.0f) {
*c = 1.0f;
*s = 0.0f;
r = 0.0f;
z... |
kernel void kernel_acospi_withoutDD1(global float* result_acospi, int N) {
float t1 = -2.3;
float t2 = -2.3;
float t3 = -2.3;
float t4 = -2.3;
float t5 = -2.3;
float t6 = -2.3;
float t7 = -2.3;
float t8 = -2.3;
float t9 = -2.3;
float t10 = -2.3;
float i = -1.0;
for (i = -1.0; i <= 1.0; i = i + ... |
kernel void global_bandwidth_v16_local_offset(global float16* A, global float* B) {
int id = (get_group_id(0) * get_local_size(0) * 16) + get_local_id(0);
float16 sum = 0;
sum += A[id];
id += get_local_size(0);
sum += A[id];
id += get_local_size(0);
;
sum += A[id];
id += get_local_size(0);
sum += A... |
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... |
uint2 ROTL64_1(const uint2 x, const unsigned int y) {
return (uint2)((x.x << y) ^ (x.y >> (32 - y)), (x.y << y) ^ (x.x >> (32 - y)));
}
uint2 ROTL64_2(const uint2 x, const unsigned int y) {
return (uint2)((x.y << y) ^ (x.x >> (32 - y)), (x.x << y) ^ (x.y >> (32 - y)));
}
ulong ROTL641(const ulong x) {
return (x <... |
kernel void CopyBufferToBufferSideRegion(global uchar* pDst, const global uchar* pSrc, unsigned int len, unsigned int dstSshOffset, unsigned int srcSshOffset) {
unsigned int gid = get_global_id(0);
global uchar* pDstWithOffset = (global uchar*)((global uchar*)pDst + dstSshOffset);
global uchar* pSrcWithOffset = (... |
kernel void test_arg_3_3_kern(global float4* a0, global float4* a1, global float4* a2, 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] + 1.1f + za;
float... |
kernel void min_float16float16(global float16* src_0, global float16* src_1, global float16* dst) {
int gid = get_global_id(0);
dst[gid] = min(src_0[gid], src_1[gid]);
} |
kernel void gf_ab(global float4* mean_p, global float4* mean_p2, global float4* a, global float4* b, float eps) {
int gX = get_global_id(0);
float4 m_p = mean_p[gX];
float4 var_p = mean_p2[gX] - pown(m_p, 2);
float4 a_ = var_p / (var_p + eps);
a[gX] = a_;
b[gX] = (1.f - a_) * m_p;
} |
kernel void max_char16char16(global char16* src_0, global char16* src_1, global char16* dst) {
int gid = get_global_id(0);
dst[gid] = max(src_0[gid], src_1[gid]);
} |
kernel void update_positions(const unsigned N, const float dt, int reflect_x, int reflect_y, int reflect_z, global float* px, global float* py, global float* pz, global float* vx, global float* vy, global float* vz, global float* fx, global float* fy, global float* fz, float xmin, float ymin, float zmin, float xmax, fl... |
kernel void normdata(global float* ioim, global float* tim, int size, int doavrg, float avrg) {
const int index = get_global_id(0);
const int elnan = isnan(*(ioim + index));
if (doavrg && !elnan)
*(tim + index) *= avrg;
else if (!doavrg && elnan)
*(tim + index) /= avrg;
} |
kernel void bin256(global unsigned int* histo, global const unsigned int* binResult, unsigned int subHistogramSize) {
size_t j = get_local_id(0);
size_t binSize = get_global_size(0);
unsigned int histValue = 0;
for (int i = 0; i < subHistogramSize; ++i) {
histValue += binResult[i * binSize + j];
}
histo... |
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 sum_byte_improved_atomic(global char4* in, global char* out, unsigned int reduce_factor) {
int x = get_global_id(0);
int size0 = get_global_size(0);
unsigned int begin = x;
int i;
int sum = 0;
for (i = 0; i < reduce_factor / 4; i++) {
sum += in[begin].x;
sum += in[begin].y;
sum += in... |
kernel void __cl_fill_region_align128(global float16* dst, float16 pattern0, unsigned int offset, unsigned int size, float16 pattern1) {
int i = get_global_id(0);
if (i < size) {
dst[i * 2 + offset] = pattern0;
dst[i * 2 + offset + 1] = pattern1;
}
} |
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
kernel void builtin_convert_long_to_ulong_sat(global long* src, global ulong* dst) {
int i = get_global_id(0);
dst[i] = convert_ulong_sat(src[i]);
} |
kernel void decode_gpu(global const char* in, global char* out, ulong strlength) {
int num = get_global_id(0);
if (num < strlength)
out[num] = in[num] + 1;
} |
kernel void updateParticles(global float* buf, float t, float dt, global float* info) {
int idx = get_global_id(0) * 2;
if (t < 0.000001f) {
buf[idx] = -1.0f;
buf[idx + 1] = -1.0f;
} else {
float2 dir = (float2)(info[idx], info[idx + 1]);
float2 speed = (float2)(info[idx + 2], info[idx + 3]);
... |
kernel void compiler_long_cmp_ge(global long* src1, global long* src2, global long* dst) {
int i = get_global_id(0);
dst[i] = (src1[i] >= src2[i]) ? 3 : 4;
} |
kernel void hadd_uintuint(global unsigned int* src_0, global unsigned int* src_1, global unsigned int* dst) {
int gid = get_global_id(0);
dst[gid] = hadd(src_0[gid], src_1[gid]);
} |
double2 rotateValue2(double2 value, double2 sinCos) {
return (double2)(dot(value, (double2)(sinCos.y, -sinCos.x)), dot(value, sinCos));
}
kernel void cooleyTukeyFFTTwiddleFactors(int N, global double2* twiddleFactors) {
int k = get_global_id(0);
double param = -3.14159265358979323846f * 2 * k / (double)N;
doub... |
kernel void addXY(double off, global double2* restrict a, global double2* restrict b, global double2* restrict c, local double* tmp) {
int i = get_global_id(0);
tmp[i] = a[i].x + b[i].x;
c[i].x = tmp[i] + off;
c[i].y = a[i].y + b[i].y;
} |
kernel void tanpi_float8(global float8* src_0, global float8* dst) {
int gid = get_global_id(0);
dst[gid] = tanpi(src_0[gid]);
} |
kernel void compiler_vector_inc(global char* dst, global char* src) {
size_t i = get_global_id(0);
char2 dst2 = vload2(i, dst);
if (src[i] == 0)
dst2++;
else if (src[i] == 1)
++dst2;
else if (src[i] == 2)
dst2--;
else
--dst2;
vstore2(dst2, i, dst);
} |
kernel void matrixmul(const int N, global float* A, global float* B, global float* C, local float* CWork) {
int i = get_global_id(0);
int j, k;
int iloc = get_local_id(0);
int nloc = get_local_size(0);
private
float BWork[1024];
for (k = 0; k < N; ++k) {
BWork[k] = B[i * N + k];
}
for (j = 0; j... |
kernel void Scan_WorkEfficientAdd(global unsigned int* higherLevelArray, global unsigned int* array, local unsigned int* localBlock) {
unsigned int id = get_local_id(0);
unsigned int group = get_group_id(0);
unsigned int pos = id + (group + 2) * get_local_size(0);
localBlock[id] = array[pos];
localBlock[id]... |
int volume_coords(int3 coords, int3 size) {
return coords.x + coords.y * size.x + coords.z * size.x * size.y;
}
int3 volume_position(int index, int3 size) {
return (int3)(index % size.x, (index / (size.x)) % size.y, index / (size.x * size.y));
}
float smoothstepmap(float val) {
return val * val * (3 - 2 * val);... |
kernel void concat_fw_kernel(const global float* px, const unsigned span, const unsigned skip, const unsigned x_size, const unsigned y_size, global float* py, const unsigned shift) {
const unsigned i = get_global_id(0);
if (i < y_size)
py[(i / span) * skip + (i % span) + shift] = px[i % x_size];
} |
kernel void asin_float4(global float4* src_0, global float4* dst) {
int gid = get_global_id(0);
dst[gid] = asin(src_0[gid]);
} |
kernel void set_f64(unsigned int length, global double* out, double value) {
const unsigned int id = get_global_id(0);
if (id < length) {
out[id] = value;
}
} |
kernel void test_arg_6_3_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, 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] +... |
kernel void atomic_race_before(global int* data) {
if (get_global_id(0) == 0) {
*data = 0;
}
atomic_dec(data);
} |
kernel void dereference_null(global int* input, global int* output) {
output[0] *= input[0];
} |
kernel void simple_add(global const int* A, global const int* B, global int* C) {
C[get_global_id(0)] = A[get_global_id(0)] + B[get_global_id(0)];
} |
inline float atomic_add_float(global float* const address, const float value) {
unsigned int oldval, newval, readback;
*(float*)&oldval = *address;
*(float*)&newval = (*(float*)&oldval + value);
while ((readback = atomic_cmpxchg((global unsigned int*)address, oldval, newval)) != oldval) {
oldval = readback... |
kernel void test(int totalElements, global float* data) {
int offset = 0;
int linearId = get_global_id(0);
if (linearId >= totalElements) {
return;
}
data[linearId] = data[linearId] + 1;
} |
kernel void array_copy_to_f32(global const float* f, global float* t) {
unsigned int i = get_global_id(0);
t[i] = f[i];
} |
kernel void kernel_fmax_withDD1(global float* result_fmax, int N) {
float t1 = 1.0;
int i = 0;
for (i = 0; i < N; i++) {
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = fmax(t1, t1);
t1 = ... |
kernel void batch_slice_bw_kernel(const global float* pgy, const unsigned size, global float* pgx, const unsigned shift) {
const unsigned i = get_global_id(0);
if (i < size)
pgx[i + shift] += pgy[i];
} |
kernel void linearpart(global double2* uhat, global double2* vhat, global const double* Kx, global const double* Ky, const double Du, const double Dv, const double A, const double B, const double dt, const double c, const int Nx, const int Ny) {
const int ind = get_global_id(0);
int i, j, k;
j = floor((double)(... |
float2 clrand2(unsigned int id, global uint4* clrng) {
unsigned int s1 = clrng[id].x;
unsigned int s2 = clrng[id].y;
unsigned int s3 = clrng[id].z;
unsigned int b;
b = (((s1 << 13) ^ s1) >> 19);
s1 = (((s1 & 4294967294) << 12) ^ b);
b = (((s2 << 2) ^ s2) >> 25);
s2 = (((s2 & 4294967288) << 4) ^ b);
b... |
kernel void min_ulong8ulong8(global ulong8* src_0, global ulong8* src_1, global ulong8* dst) {
int gid = get_global_id(0);
dst[gid] = min(src_0[gid], src_1[gid]);
} |
kernel void compiler_function_argument1(global int* dst, char value, short value0, int value1) {
int id = (int)get_global_id(0);
dst[id] = value + value0 + value1;
} |
kernel void scan_add_adjust(global int* A, global const int* B) {
int id = get_global_id(0);
int gid = get_group_id(0);
A[id] += B[gid];
} |
kernel void test_stream_read_short(global short* dst) {
dst[0] = (short)((1 << 8) + 1);
} |
typedef float4 float4;
kernel void descriptor(global float4* keypoints, global unsigned char* descriptors, global float* grad, global float* orim, int octsize, int keypoints_start, global int* keypoints_end, int grad_width, int grad_height) {
int gid0 = get_global_id(0);
float4 k = keypoints[gid0];
if (!(keypoint... |
kernel void store_keys_gpu(global unsigned char* in, global unsigned char* out) {
unsigned int global_addr = get_global_id(0);
in[global_addr] = out[global_addr];
} |
uint2 ROTL64_1(const uint2 x, const unsigned int y) {
return (uint2)((x.x << y) ^ (x.y >> (32 - y)), (x.y << y) ^ (x.x >> (32 - y)));
}
uint2 ROTL64_2(const uint2 x, const unsigned int y) {
return (uint2)((x.y << y) ^ (x.x >> (32 - y)), (x.x << y) ^ (x.y >> (32 - y)));
}
ulong ROTL641(const ulong x) {
return (x <... |
kernel void brahmaKernel(global int* buf) {
int x = 0;
int y = (x + 1);
int z = (y * 2);
int a = (z - x);
int i = (a / 2);
buf[0] = i;
} |
kernel void example(global char* buf, global char* buf2) {
int x = get_global_id(0);
buf2[x] = buf[x];
} |
kernel void _memset_opencl(global int* val, int nx) {
const int i = get_global_id(0);
if (i < nx)
val[i] = 42;
} |
kernel void scaled_sum_three_d(global double* output, global double* x, global double* y, const unsigned int size) {
unsigned int tid = get_global_id(0);
if (tid < size)
output[tid] = output[tid] + x[tid] * y[tid];
} |
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... |
unsigned __popc(unsigned int x) {
if (x == 0)
return 0;
if ((x &= x - 1) == 0)
return 1;
if ((x &= x - 1) == 0)
return 2;
if ((x &= x - 1) == 0)
return 3;
if ((x &= x - 1) == 0)
return 4;
if ((x &= x - 1) == 0)
return 5;
if ((x &= x - 1) == 0)
return 6;
if ((x &= x - 1) == 0)... |
kernel void test_block_4_5_kern(global float* a0, global float* a1, global float* a2, global float* a3, global float* b0, global float* b1, global float* b2, global float* b3, global float* b4, local float* c0, local float* c1, local float* c2, local float* c3) {
int i;
unsigned int gtid = get_global_id(0);
unsig... |
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 testSToU(global int2* a, global uchar2* res) {
res[0] = convert_uchar2_sat(*a);
} |
kernel void test_arg_1_3_kern(global int4* a0, global int4* b0, global int4* b1, global int4* b2) {
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);
b2[gtid] = (2 + 1) * (+tmp0);
} |
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++)
... |
__attribute__((max_global_work_dim(0))) kernel void nw_kernel1(global int* restrict reference, global int* restrict data, global int* restrict input_v, int dim, int penalty, int loop_exit, int block_offset) {
int out_SR[4 - 1][3];
int last_chunk_col_SR[16 - (4 - 1) + 2];
int ref_SR[4][4];
int data_h_SR[4][4];
... |
kernel void test_rotate(global uint4* out, uint4 a, uint4 b) {
*out = rotate(a, b);
} |
kernel void foo(global int* out, char c, short s, int i, long l, float f, float h, double d) {
*out = i + get_global_id(0);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.