Resize the memory space. Reallocate only if the capacity is not enough. */
| 135 | |
| 136 | /** Resize the memory space. Reallocate only if the capacity is not enough. */ |
| 137 | void resize(Index _count) { |
| 138 | if (_count > capacity || (capacity && *refer_count > 1)) |
| 139 | reallocate(_count); |
| 140 | count = _count; |
| 141 | } |
| 142 | |
| 143 | /** Copy the memory space to GPU */ |
| 144 | void to_device(Index copy_count = 0) { |