Sha256: 40763ddf1603c4d9436c3112cc64ff710470415e0665f1a9df41aef500f87d63
Contents?: true
Size: 771 Bytes
Versions: 19
Compression:
Stored size: 771 Bytes
Contents
/* Extract an element only if self is a dimensionless NArray. @overload extract_cpu @return [Numeric,Cumo::NArray] --- Extract element value as Ruby Object if self is a dimensionless NArray, otherwise returns self. This method is compatible with Numo NArray's `extract` method. */ static VALUE <%=c_func(0)%>(VALUE self) { volatile VALUE v; char *ptr; cumo_narray_t *na; CumoGetNArray(self,na); if (na->ndim==0) { ptr = cumo_na_get_pointer_for_read(self) + cumo_na_get_offset(self); CUMO_SHOW_SYNCHRONIZE_WARNING_ONCE("<%=name%>", "<%=type_name%>"); cumo_cuda_runtime_check_status(cudaDeviceSynchronize()); v = m_extract(ptr); cumo_na_release_lock(self); return v; } return self; }
Version data entries
19 entries across 19 versions & 1 rubygems