ext/cumo/narray/gen/tmpl_bit/where.c in cumo-0.1.0 vs ext/cumo/narray/gen/tmpl_bit/where.c in cumo-0.1.1
- old
+ new
@@ -6,46 +6,46 @@
} where_opt_t;
#define STORE_INT(ptr, esz, x) memcpy(ptr,&(x),esz)
static void
-<%=c_iter%>(na_loop_t *const lp)
+<%=c_iter%>(cumo_na_loop_t *const lp)
{
size_t i;
- BIT_DIGIT *a;
+ CUMO_BIT_DIGIT *a;
size_t p;
ssize_t s;
size_t *idx;
- BIT_DIGIT x=0;
+ CUMO_BIT_DIGIT x=0;
char *idx1;
size_t count;
size_t e;
where_opt_t *g;
// TODO(sonots): CUDA kernelize
- SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%>", "<%=type_name%>");
+ CUMO_SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%>", "<%=type_name%>");
cumo_cuda_runtime_check_status(cudaDeviceSynchronize());
g = (where_opt_t*)(lp->opt_ptr);
count = g->count;
idx1 = g->idx1;
e = g->elmsz;
- INIT_COUNTER(lp, i);
- INIT_PTR_BIT_IDX(lp, 0, a, p, s, idx);
+ CUMO_INIT_COUNTER(lp, i);
+ CUMO_INIT_PTR_BIT_IDX(lp, 0, a, p, s, idx);
if (idx) {
for (; i--;) {
- LOAD_BIT(a, p+*idx, x);
+ CUMO_LOAD_BIT(a, p+*idx, x);
idx++;
if (x!=0) {
STORE_INT(idx1,e,count);
idx1 += e;
}
count++;
}
} else {
for (; i--;) {
- LOAD_BIT(a, p, x);
+ CUMO_LOAD_BIT(a, p, x);
p+=s;
if (x!=0) {
STORE_INT(idx1,e,count);
idx1 += e;
}
@@ -66,25 +66,25 @@
{
volatile VALUE idx_1;
size_t size, n_1;
where_opt_t *g;
- ndfunc_arg_in_t ain[1] = {{cT,0}};
- ndfunc_t ndf = { <%=c_iter%>, FULL_LOOP, 1, 0, ain, 0 };
+ cumo_ndfunc_arg_in_t ain[1] = {{cT,0}};
+ cumo_ndfunc_t ndf = { <%=c_iter%>, CUMO_FULL_LOOP, 1, 0, ain, 0 };
- size = RNARRAY_SIZE(self);
+ size = CUMO_RNARRAY_SIZE(self);
n_1 = NUM2SIZET(<%=find_tmpl("count_true_cpu").c_func%>(0, NULL, self));
g = ALLOCA_N(where_opt_t,1);
g->count = 0;
if (size>4294967295ul) {
- idx_1 = nary_new(cumo_cInt64, 1, &n_1);
+ idx_1 = cumo_na_new(cumo_cInt64, 1, &n_1);
g->elmsz = 8;
} else {
- idx_1 = nary_new(cumo_cInt32, 1, &n_1);
+ idx_1 = cumo_na_new(cumo_cInt32, 1, &n_1);
g->elmsz = 4;
}
- g->idx1 = na_get_pointer_for_write(idx_1);
+ g->idx1 = cumo_na_get_pointer_for_write(idx_1);
g->idx0 = NULL;
- na_ndloop3(&ndf, g, 1, self);
- na_release_lock(idx_1);
+ cumo_na_ndloop3(&ndf, g, 1, self);
+ cumo_na_release_lock(idx_1);
return idx_1;
}