kernel_code
stringlengths
49
1.22M
kernel void compiler_clz_int(global int* src, global int* dst) { int i = get_global_id(0); dst[i] = clz(src[i]); }
kernel void wander(global float* in_pos_x, global float* in_pos_y, global float* in_pos_z, global float* in_vel_x, global float* in_vel_y, global float* in_vel_z) { const int i = get_global_id(0); in_pos_x[i] + 1.0f; }
kernel void toColorDense(global float* buff) { int gid = get_global_id(0); buff[gid] = exp(-buff[gid]); }
kernel void relational_greater_than_or_equal_to_int8int8(global int8* src_0, global int8* src_1, global int8* dst) { int gid = get_global_id(0); dst[gid] = src_0[gid] >= src_1[gid]; }
kernel void set_elem_vector(global float* in, const int index, global float* out) { if (get_global_id(0) == 0) out[index] = (*in); }
kernel void kernel_atan2_withoutDD1(global float* result_atan2, int N) { float t1 = 12345.64; float t2 = 12345.64; float t3 = 12345.64; float t4 = 12345.64; float t5 = 12345.64; float t6 = 12345.64; float t7 = 12345.64; float t8 = 12345.64; float t9 = 12345.64; float t10 = 12345.64; float i = 0.0...
kernel void test2(global int* buf0, global int* buf1) { int gidx = get_global_id(0); buf0[gidx] = buf1[gidx] + 1; }
kernel void pmax(global int* A, global int* B, const int x, const unsigned int n) { const int globalRow = get_global_id(0); if (globalRow < n) { B[globalRow] = max(A[globalRow], x); } }
kernel void NL_SIGM_BWD(global float* dX, global float* Y, global float* dY) { unsigned int element = get_global_id(0); const float Y_value = Y[element]; const float dY_value = dY[element]; dX[element] = dY_value * Y_value * (1.0 - Y_value); }
constant size_t ELEMENTS_PER_WORK_ITEM_SCAN = 2; constant size_t ELEMENTS_PER_WORK_ITEM_OTHERS = 2; kernel void prefixSumScan(global unsigned int* elements, const unsigned int count, local unsigned int* temp, global unsigned int* sums, const unsigned int doWriteSums, const unsigned int bitMask, global unsigned int* pre...
inline float _distance_2_point(float x, float y, float rx, float ry, float sw, float sh, float ez, float ex, float ey) { float dx = x / rx * sw - sw / 2.0f + ex; float dy = y / ry * sh - sh / 2.0f - ey; return sqrt(ez * ez + dx * dx + dy * dy); } kernel void distance_2_point(global float* x, global float* y, flo...
kernel void sax_vectorized_and_squarenorm_reduction(global float* out, global float* result_tmp, const unsigned int elems, const unsigned int num_fields) { const unsigned int id = get_global_id(0); for (unsigned int i = 0; i < num_fields; i++) out[i] = 0.0; if (id == 0) { for (unsigned int s = 0; s < ele...
kernel void mem_write(global volatile float* buffer, int num_it, global float* dummyBuffer) { const int k = get_global_id(0); while (num_it-- != 0) buffer[k] = 0; }
kernel void Stencil2D(global float const* restrict memory_in, global float* restrict memory_out) { for (int i = 1; i < 32 - 1; ++i) { for (int j = 0; j < 32; ++j) { const float above = memory_in[(i - 1) * 32 + j]; const float center = memory_in[i * 32 + j]; const float below = memory_in[(i + 1) ...
kernel void kernel_1(global float* inputA, global float* inputB, global float* output, const unsigned int count) { float L = 0; for (int i = 0; i < count; i++) { float x = fabs(inputA[i] - inputB[i]); L += x; } output[1] = L; }
kernel void foo(global float2* A, float2 y, float2 x) { *A = atan2pi(y, x); }
union BufferType { float f; unsigned int u; }; kernel void applyCoulombsLaw(global float4* pointPosition, global float4* pointAcceleration, global float* pointMass, const int numPoints, const float repulsion) { const int p1 = get_global_id(0); if (p1 >= numPoints) return; float4 pointPositionP1 = pointP...
kernel void pre_increment_float(global float* src_0, global float* dst) { int gid = get_global_id(0); dst[gid] = ++src_0[gid]; }
kernel void abs_diff_ulong2ulong2(global ulong2* src_0, global ulong2* src_1, global ulong2* dst) { int gid = get_global_id(0); dst[gid] = abs_diff(src_0[gid], src_1[gid]); }
kernel void compiler_hadd(global int* src1, global int* src2, global int* dst) { int i = get_global_id(0); dst[i] = hadd(src1[i], src2[i]); }
kernel void fill_ones(global float* out) { out[get_global_id(0)] = 1.0; }
kernel void initWorkBuffer(global float* workBuffer) { int idx = get_global_id(0); workBuffer[idx] = 0; }
kernel void foo(global int* data) { *data = get_global_offset(0) + get_num_groups(0) + get_enqueued_local_size(0) + get_global_size(0) + get_global_id(0) + get_group_id(0); }
kernel void kernel_fmax_withoutDD2(global float* result_fmax, int N) { float2 t1 = -1 + (float2)(0); float2 t2 = -1 + (float2)(0); float2 t3 = t1; float2 t4 = t3; float2 t5 = t4; float2 t6 = t5; float2 t7 = t6; float2 t8 = t7; float2 t9 = t8; float2 t10 = t9; float2 t11 = -1 + (float2)(0); float...
inline int changeTranspositionIndex(int i, int n) { int ip; ip = i; return ip; } kernel void kernel_ScanHistograms(global int* histo, local int* temp, global int* globsum) { size_t it = get_local_id(0); size_t ig = get_global_id(0); int decale = 1; size_t n = get_local_size(0) * 2; size_t gr = get_gr...
kernel void compact_exscan(global int* pred, global int* prefSum) { int id = get_global_id(0); prefSum[id] = (id > 0) ? pred[id - 1] : 0; barrier(0x02); for (int s = 1; s < get_global_size(0); s *= 2) { int tmp = prefSum[id]; if (id + s < get_global_size(0)) { prefSum[id + s] += tmp; } ba...
kernel void Test(global unsigned int* dst) { unsigned int index = get_global_id(0); dst[index] = index; }
int whoHasWon(global const float* ballPosX, global const int* ballRad, global const int* width, global const float* ballVelX) { if (*ballPosX + *ballRad >= *width && *ballVelX > 0) return -1; else if (*ballPosX <= 0 && *ballVelX < 0) return 1; else return 0; } void reset(global float* ballPosX, globa...
kernel void kraljice_brojac1(global float* data, global float* output) { int brPolja = 4; int n = 4; int k, ind; int x[4]; int resenje; float sum = 0.0; x[1] = 0; k = 1; while (k > 0) { x[k]++; if (x[k] <= n) { if (k == n) { resenje = 0; for (ind = 1; ind <= brPolja; in...
kernel void test_shuffle(const global char16* in, global char16* out) { char16 tmp = in[0]; char16 tmp1 = in[1]; out[0] = shuffle(tmp, (uchar16)(7, 6, 4, 8, 1, 12, 13, 1, 0, 9, 14, 15, 4, 3, 8, 6)); out[1] = shuffle2(tmp, tmp1, (uchar16)(1, 7, 11, 18, 21, 15, 8, 9, 0, 19, 2, 1, 17, 13, 7, 8)); char16 tmp2 ...
float myAbs(float v) { if (v < 0) return -1.0 * v; else return v; } float lanczos(float x, int a) { if (x == 0) return 1; float absX = myAbs(x); if (0 < absX && absX < a) return (a * sin(3.1415926535897932384626433832795 * x) * sin(3.1415926535897932384626433832795 * x / a)) / (9.869604401089...
kernel void selfdot_ints_withscratch(global int* in, global int* out, local int* scratch1, local int* scratch2) { int globalId = get_global_id(0); int localId = get_local_id(0); int workgroupSize = get_local_size(0); int workgroupid = get_group_id(0); scratch1[localId] = in[globalId]; barrier(0x01); int ...
kernel void dotProduct1(global const float* gridA, global const float* gridB, global float* result, int const numElements) { int iGID = get_global_id(0); int totalThreads = get_global_size(0); int workPerThread = (numElements / totalThreads) + 1; int offset = 0; offset = iGID * workPerThread; result[iGID]...
kernel void mul(global long* out, long a, long b) { out[0] = a * b; }
kernel void ScanNaive(global int* src, global int* dst, unsigned int offset, unsigned int n) { size_t id = get_global_id(0); if (id >= n) return; if (id >= offset) dst[id] = src[id] + src[id - offset]; else if (id >= (offset >> 1)) dst[id] = src[id]; }
kernel void array_exp_f32(global float* a, global float* b) { unsigned int i = get_global_id(0); b[i] = exp(a[i]); }
kernel void kernelVectorSixteen(char16 inputChar, uchar16 inputUChar, short16 inputShort, ushort16 inputUShort, int16 inputInt, uint16 inputUInt, long16 inputLong, ulong16 inputULong, float16 inputFloat, double16 inputDouble, global float16* output) { output[0] = convert_float16(inputChar); output[1] = convert_floa...
extern constant float foo; kernel void test(global float* buf) { buf[0] += foo; }
kernel void op_test(global int4* output) { int4 vec = (int4)(1, 2, 3, 4); vec += 4; if (vec.s2 == 7) vec &= (int4)(-1, -1, 0, -1); vec.s01 = vec.s23 < 7; while (vec.s3 > 7 && (vec.s0 < 16 || vec.s1 < 16)) vec.s3 >>= 1; *output = vec; }
kernel void async_copy_out_of_bounds(local int* src, global int* dst) { int l = get_local_id(0); src[l] = l; barrier(0x01); event_t event = async_work_group_copy(dst + 1, src, get_local_size(0), 0); wait_group_events(1, &event); }
kernel void test_clamp(global char2* out, global char2* in) { *out = clamp(*in, (char2)7, (char2)42); }
float4 calculateLocalDirection(global const float4* points, int begin, int trackLength, int myIndex) { int end = begin + trackLength - 1; int first = myIndex - 1; int last = myIndex + 1; first = max(begin, first); last = min(end, last); float4 result = normalize(points[last] - points[first]); return res...
inline int modulo(int a, int b) { const int result = a % b; return result >= 0 ? result : result + b; } kernel void gameOfLifeKernel(int rows, int columns, global int* matrix, global int* result) { int globalId = get_global_id(0); short neighbors = 0; int x = globalId % columns; int y = globalId / column...
kernel void FillIndices(global float* x, float start, float step) { unsigned int id = get_global_id(0); x[id] = start + id * step; }
float2 force_LJ(float2 p1, float2 p2) { float2 d = p2 - p1; float ir2 = 1 / (d.x * d.x + d.y * d.y + 1.0e-2); float ir6 = ir2 * ir2 * ir2; float fr = ir6 - ir6 * ir6; return d * fr; } kernel void NBody_force_naive(unsigned int num, global float2* pos, global float2* force) { const int i = get_global_id(0);...
kernel void dot3(global float* a_vec, global float* b_vec, global float* output, local float* l_vec) { size_t gid = get_global_id(0); size_t lid = get_local_id(0); l_vec[lid] = a_vec[gid] * b_vec[gid]; barrier(0x01); if (lid == 0) { l_vec[lid] = l_vec[lid] + l_vec[lid + 1]; } output[gid] = l_vec[li...
union BufferType { float f; unsigned int u; }; kernel void totalEnergyGroup(global float4* pointVelocity, global float* pointMass, global float* pointEnergy, const int workGroupSize, const int numPoints) { int p = get_global_id(0); float energy = (float)0; while (p < numPoints) { float speed = length(poi...
kernel void divide(global float* a, global float* b, global float* result) { int i; i = get_global_id(0); if (b[i] != 0) { result[i] = a[i] / b[i]; } else { result[i] = 0; } }
void calc_pq_index(int size, int idx, int* p, int* q); void calc_pq_index(int size, int idx, int* p, int* q) { int i; int count = idx; *p = 0; *q = *p + 1; for (i = size - 1; i > 0; i--) { if (count < i) { *q = count + *q; break; } else { count -= i; *p = *p + 1; *q = *p ...
kernel void test_kernel(global ulong* output) { local char l_int8[3]; local int l_int32[3]; local float l_float[3]; output[0] = (ulong)l_int8; output[1] = (ulong)l_int32; output[2] = (ulong)l_float; }
constant float GRAVITY = 0.000000000066742; kernel void vortex(global float4* pos, global float4* float3, global float* masses, global float4* vel, float dt) { unsigned int i = get_global_id(0); unsigned int particle_count = get_global_size(0); float4 p = pos[i]; float4 v = vel[i]; float mass = masses[i]; ...
kernel void abs_diff_intint(global int* src_0, global int* src_1, global unsigned int* dst) { int gid = get_global_id(0); dst[gid] = (unsigned int)(abs_diff(src_0[gid], src_1[gid])); }
kernel void test_uchar(global uchar* C, global uchar* A, global uchar* B) { int id = get_global_id(0); C[id] = add_sat(A[id], B[id]); }
kernel void prefixSum(global int* restrict output, global int* restrict input, const unsigned int in_size) { int8 tmp_buff; tmp_buff.s0 = 0; int size = in_size / 8; for (int i = 0; i < size; i++) { int8 in = ((global int8*)input)[i]; tmp_buff.s1 = tmp_buff.s0 + in.s0; tmp_buff.s2 = tmp_buff.s1 + in....
kernel void sph_kernel_sort(global uint2* partIdx, int stage, int passOfStage, int direction) { unsigned int sortIncreasing = direction; unsigned int threadId = get_global_id(0); unsigned int pairDistance = 1 << (stage - passOfStage); unsigned int blockWidth = 2 * pairDistance; unsigned int leftId = (thread...
kernel void qssa2_kernel(global float* RF, global float* RB, global const float* A) { float xq4 = (A[((((((4) * (11)) + 0)) - 1) * (4)) + (get_global_id(0))]); float xq3 = (A[((((((3) * (11)) + 0)) - 1) * (4)) + (get_global_id(0))]) + (A[((((((3) * (11)) + 4)) - 1) * (4)) + (get_global_id(0))]) * xq4; float xq7 =...
float3 matrixmul3(const constant float* m, float3 v) { float3 retr; retr.x = dot(vload3(0, m), v); retr.y = dot(vload3(1, m), v); retr.z = dot(vload3(2, m), v); return retr; } float4 matrixmul4(const constant float* m, float4 v) { float4 retr; retr.x = dot(vload4(0, m), v); retr.y = dot(vload4(1, m), ...
kernel void loop(global float* a) { for (int i = 0; i < 100; i++) { a[i] = i * 2; } }
kernel void minus(global long* out, long in) { out[0] = -in; }
kernel void dynproc_kernel(global int* restrict wall, global int* restrict src, global int* restrict dst, int cols, int t) { for (int n = 0; n < cols; n++) { int min = src[n]; if (n > 0) { min = ((min) <= (src[n - 1]) ? (min) : (src[n - 1])); } if (n < cols - 1) { min = ((min) <= (src[n + ...
kernel void intraBlockInclusiveScanByKey(global unsigned int* keySumArray, global int* preSumArray, global int* postSumArray, const unsigned int vecSize, local unsigned int* ldsKeys, local int* ldsVals, const unsigned int workPerThread) { size_t groId = get_group_id(0); size_t gloId = get_global_id(0); size_t loc...
kernel void sph_kernel_indexx(int kParticleCount, global float4* sortedPos, global int* gridCellIdx) { unsigned int gid = get_global_id(0); gridCellIdx[gid] = -1; int low = 0; int hi = kParticleCount - 1; int mid = 0; while (low <= hi) { mid = (hi + low) / 2; if (floor(sortedPos[mid].w) == gid) { ...
kernel void saxpy_naive(const int numElems, const float factor, global const float* src_0, global const float* src_1, global float* dst_0) { unsigned int gid = get_global_id(0); if (gid < numElems) dst_0[gid] = factor * src_0[gid] * src_1[gid]; }
kernel void test_arg_1_1_kern(global float* a0, global float* b0) { unsigned int gtid = get_global_id(0); float tmp0 = a0[gtid] + 0.1f; b0[gtid] = (0.0f + 1.1f) * (+tmp0); }
kernel void double_test(global float* a, global float* b, global float* out) { *out = *a * *b; }
kernel void isnotequal_float2float2(global float2* src_0, global float2* src_1, global int2* dst) { int gid = get_global_id(0); dst[gid] = (int2)(isnotequal(src_0[gid], src_1[gid])); }
kernel void Reduction_Decomp(const global unsigned int* inArray, global unsigned int* outArray, unsigned int N, local unsigned int* block) { int LID = get_local_id(0); int Elem = get_local_size(0) * get_group_id(0) * 2 + LID; int LSize = get_local_size(0); block[LID] = inArray[Elem] + inArray[Elem + LSize]; b...
kernel void Sdot_naive(int n, global float* x, int incx, global float* y, int incy, global float* result) { float acc = 0.f; for (int i = 0; i < n; ++i) { acc += x[i * incx] * y[i * incy]; ; } result[0] = acc; }
__attribute__((work_group_size_hint(256, 1, 1))) kernel void vector_equals(global const float* x, const unsigned int offset_x, const unsigned int stride_x, global const float* y, const unsigned int offset_y, const unsigned int stride_y, global unsigned int* eq_flag) { const unsigned int ix = offset_x + get_global_id(...
kernel void test_arg_1_1_kern(global float4* a0, global float4* b0) { 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; b0[gtid] = (0.0f + 1.1f) * (+tmp0); }
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 test_normalize(const global float* in, global float* out) { unsigned int gid = get_global_id(0); vstore3(normalize(vload3(gid, in)), gid, out); }
kernel void sub(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 multiply_matrix(global float* m1, global float* m2, global float* res, unsigned long int wm1, unsigned long int wm2) { unsigned long int i = get_group_id(0); unsigned long int j = get_local_id(0); unsigned long int k; float sum = 0.0f; for (k = 0; k < wm1; ++k) sum += m1[i * wm1 + k] * m2[k * ...
kernel void kernel_fmin_withoutDD1(global float* result_fmin, int N) { float t1 = 0.234; float t2 = 0.235; float t3 = t1; float t4 = t3; float t5 = t4; float t6 = t5; float t7 = t6; float t8 = t7; float t9 = t8; float t10 = t9; float t11 = 0.234; float t12 = 0.235; float t13 = t1; float t14 ...
kernel void private_array_initializer_list(global float* output) { float scratch[4] = {7.f, 42.f, -1.f, 0.f}; for (int i = 0; i < 4; i++) { output[i] = scratch[i]; } }
kernel void prefixSum(global int* restrict output, global int* restrict input, const unsigned int in_size) { output[0] = 0; for (int i = 1; i < in_size; i++) output[i] = output[i - 1] + input[i - 1]; }
kernel void createSpace(float d1, float d2, float n, global float* result, int type) { int i = get_global_id(0); float n1 = floor(n) - 1; float value = d1 + i * (d2 - d1) / n1; if (type == 1) result[i] = value; else result[i] = pown(value, 10); if (i == n1) { result[0] = d1; result[i] = d...
typedef enum { LOGISTIC, RELU, RELIE, LINEAR, RAMP, TANH, PLSE, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN } ACTIVATION; kernel void image2columarray3x3(int n, global float* data_im, int height, int width, int ksize, const int pad, int stride, int height_col, int width_col, global float* data_col) { int index = get_gl...
kernel void vector_mult_opencl(global float* val, int nx, float factor) { const int i = get_global_id(0); if (i < nx) { val[i] *= factor; } }
kernel void find_minimum(global const float* values, global float* results, local float* scratch) { int i = get_local_id(0); int n = get_local_size(0); scratch[i] = values[get_global_id(0)]; barrier(0x01); for (int j = n / 2; j > 0; j /= 2) { if (i < j) scratch[i] = min(scratch[i], scratch[i + j]); ...
kernel void test_select_read_address_simple(const global int* in0, const global int* in1, global int* out) { unsigned int gid = (unsigned int)get_global_id(0); const global int* ptr = (gid & 1) ? in1 : in0; int tmp = ptr[gid]; out[gid] = tmp + 17; }
kernel void prescanReduce(global unsigned int const* restrict a, global unsigned int* restrict sum, unsigned int m, unsigned int n) { size_t localID = get_local_id(0); size_t groupID = get_group_id(0); local unsigned int lsum[256]; m >>= 2; global uint4* a4 = (global uint4*)a; size_t startIndex = m * gro...
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 compiler_double_convert_float(global double* src, global float* dst) { int i = get_global_id(0); float f = src[i]; dst[i] = f; }
kernel void paste(global int* histograms, global int* globsum) { int ig = get_global_id(0); int gr = get_group_id(0); int s; s = globsum[gr]; histograms[2 * ig] += s; histograms[2 * ig + 1] += s; barrier(0x02); }
kernel void minus(global short* out, short in) { out[0] = -in; }
kernel void testMemCL(global unsigned int* memoryC, global const unsigned int* memoryA, global const unsigned int* memoryB) { size_t id = get_global_id(0); memoryC[id] = memoryA[id] + memoryB[id]; }
constant float beta = 0.66666f; kernel void calc_layer_gradient(global const float* inputs, global const float* errors, int inputs_ofs, int errors_ofs, int inputs_per_neuron, int grad_ofs, global float* gradient, int weights_count, local float* temp_mem) { int i = get_global_id(0); global const float* err = errors...
kernel void frequencies(global double* kx, const double Lx, const int Nx) { const int ind = get_global_id(0); if (ind < Nx / 2) kx[ind] = -1.0 * ((double)((ind)) / Lx) * ((double)(ind) / Lx); if (ind == Nx / 2) kx[ind] = 0.0; if (ind > Nx / 2) kx[ind] = -1.0 * (double)(Nx - ind) / Lx * (double)(Nx -...
kernel void cl_square_array_int(global float* in_data, global float* out_data) { int g_x = get_global_id(0); int l_x = get_local_id(0); int size_g_x = get_global_size(0); int size_l_x = get_local_size(0); if (g_x < size_g_x && l_x < size_l_x) out_data[l_x + (g_x * size_l_x)] = sqrt(in_data[l_x + (g_x * ...
kernel void test_arg_4_1_kern(global int* a0, global int* a1, global int* a2, global int* a3, global int* b0) { 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 + tmp3); }
kernel void scaleAdd_vector(global double* a, const int aoffset, const double afactor, global double* b, const int boffset, const double bfactor, const double c) { int i = get_global_id(0); a[i + aoffset] = (a[i + aoffset] * afactor) + (b[i + boffset] * bfactor) + c; }
kernel void compute_means(global unsigned int* coords, global int* sizes) { int pos = get_global_id(0); uint2 sum = vload2(pos, coords); int size = sizes[pos]; uint2 centroid = (uint2)(sum.x / size, sum.y / size); vstore2(centroid, pos, coords); }
int baz(global int* x) { return x[0]; } int bar(global int* x) { return baz(x); } kernel void foo(global int* data) { int x = bar(data); barrier(0x02); data[1] = x; }
kernel void blockAddition_kernel(global int* restrict input, global int* restrict output) { int globalId = get_global_id(0); int groupId = get_group_id(0); int localId = get_local_id(0); local int value[1]; if (localId == 0) { value[0] = input[groupId]; } barrier(0x01); output[globalId * 2] += va...
int getPosHash(int4 gridPos, global float4* pParams) { int4 gridDim = *((global int4*)(pParams + 1)); gridPos.x &= gridDim.x - 1; gridPos.y &= gridDim.y - 1; gridPos.z &= gridDim.z - 1; int hash = gridPos.z * gridDim.y * gridDim.x + gridPos.y * gridDim.x + gridPos.x; return hash; } int4 getGridPos(float4 w...
kernel void test_tgamma(const global float* in, global float* out) { size_t gid = get_global_id(0); out[gid] = tgamma(in[gid]); }
kernel void dlacpy_kernel(int m, int n, global double* A, int offset_A, int lda, global double* B, int offset_B, int ldb) { int row = get_group_id(0) * 64 + get_local_id(0); if (row < m) { A += (offset_A + row); B += (offset_B + row); global double* Aend = A + lda * n; while (A < Aend) { *B = ...
kernel void matMulSingle(global int* matC, const unsigned int mC, const unsigned int nC, const global int* matA, const unsigned int mA, const unsigned int nA, const global int* matB, const unsigned int mB, const unsigned int nB) { unsigned int w = get_global_id(0); unsigned int c = w % nC; unsigned int r = (w - c...