ext/cumo/narray/gen/tmpl/rand_norm.c in cumo-0.1.0 vs ext/cumo/narray/gen/tmpl/rand_norm.c in cumo-0.1.1
- old
+ new
@@ -2,11 +2,11 @@
dtype mu;
rtype sigma;
} randn_opt_t;
static void
-<%=c_iter%>(na_loop_t *const lp)
+<%=c_iter%>(cumo_na_loop_t *const lp)
{
size_t i;
char *p1;
ssize_t s1;
size_t *idx1;
@@ -17,17 +17,17 @@
<% end %>
dtype mu;
rtype sigma;
randn_opt_t *g;
- INIT_COUNTER(lp, i);
- INIT_PTR_IDX(lp, 0, p1, s1, idx1);
+ CUMO_INIT_COUNTER(lp, i);
+ CUMO_INIT_PTR_IDX(lp, 0, p1, s1, idx1);
g = (randn_opt_t*)(lp->opt_ptr);
mu = g->mu;
sigma = g->sigma;
- SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%>", "<%=type_name%>");
+ CUMO_SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%>", "<%=type_name%>");
cumo_cuda_runtime_check_status(cudaDeviceSynchronize());
if (idx1) {
<% if is_complex %>
for (; i--;) {
a0 = (dtype*)(p1+*idx1);
@@ -100,12 +100,12 @@
<%=c_func(-1)%>(int argc, VALUE *args, VALUE self)
{
int n;
randn_opt_t g;
VALUE v1=Qnil, v2=Qnil;
- ndfunc_arg_in_t ain[1] = {{OVERWRITE,0}};
- ndfunc_t ndf = {<%=c_iter%>, FULL_LOOP, 1,0, ain,0};
+ cumo_ndfunc_arg_in_t ain[1] = {{CUMO_OVERWRITE,0}};
+ cumo_ndfunc_t ndf = {<%=c_iter%>, CUMO_FULL_LOOP, 1,0, ain,0};
n = rb_scan_args(argc, args, "02", &v1, &v2);
if (n == 0) {
g.mu = m_zero;
} else {
@@ -114,8 +114,8 @@
if (n == 2) {
g.sigma = NUM2DBL(v2);
} else {
g.sigma = 1;
}
- na_ndloop3(&ndf, &g, 1, self);
+ cumo_na_ndloop3(&ndf, &g, 1, self);
return self;
}