1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#ifndef __OPENCL_VERSION__
#include "header.cl"
#endif
__kernel void TEMPLATE(fillbuffer,Dtype)(const int_tp n, const char alpha, __global char* x,
const int_tp offx) {
for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) {
x[index + offx] = alpha;
}
}
__kernel void TEMPLATE(fill,Dtype)(const int_tp n, const Dtype alpha, __global Dtype* x,
const int_tp offx) {
for (int_tp index = get_global_id(0); index < n; index += get_global_size(0)) {
x[index + offx] = alpha;
}
}
|