Sha256: 6a1f0450afcec96f457c3c45181212389f87edc938047a23543b9e180c4fe4d7

Contents?: true

Size: 633 Bytes

Versions: 19

Compression:

Stored size: 633 Bytes

Contents

static VALUE
<%=c_func(0)%>(VALUE self)
{
    cumo_narray_t *na;
    char *ptr;

    CumoGetNArray(self,na);

    switch(CUMO_NA_TYPE(na)) {
    case CUMO_NARRAY_DATA_T:
        ptr = CUMO_NA_DATA_PTR(na);
        if (na->size > 0 && ptr == NULL) {
            ptr = cumo_cuda_runtime_malloc(((na->size-1)/8/sizeof(CUMO_BIT_DIGIT)+1)*sizeof(CUMO_BIT_DIGIT));
            CUMO_NA_DATA_PTR(na) = ptr;
        }
        break;
    case CUMO_NARRAY_VIEW_T:
        rb_funcall(CUMO_NA_VIEW_DATA(na), rb_intern("allocate"), 0);
        break;
    default:
        rb_raise(rb_eRuntimeError,"invalid narray type");
    }
    return self;
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cumo-0.4.3 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.4.2 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.4.1 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.4.0 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.5 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.4 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.3 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.2 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.1 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.0 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.3.0.pre1 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.5 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.4 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.3 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.2 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.1 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.2.0 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.1.2 ext/cumo/narray/gen/tmpl_bit/allocate.c
cumo-0.1.1 ext/cumo/narray/gen/tmpl_bit/allocate.c