TODO: get rid of this. Refactor everything to const in template type instead of holder-objects
| 221 | |
| 222 | //TODO: get rid of this. Refactor everything to const in template type instead of holder-objects |
| 223 | TCudaBuffer<T, TSingleMapping, Type> DeviceView(ui32 devId) const { |
| 224 | TCudaBuffer<T, TSingleMapping, Type> buffer; |
| 225 | const auto devSlice = Mapping.DeviceSlice(devId); |
| 226 | buffer.Mapping = TSingleMapping(devId, devSlice.Size(), Mapping.SingleObjectSize()); |
| 227 | |
| 228 | if (Buffers.at(devId).NotEmpty()) { |
| 229 | buffer.Buffers.at(devId) = Buffers.at(devId).ShiftedBuffer(Mapping.DeviceMemoryOffset(devId, devSlice)); |
| 230 | } |
| 231 | buffer.IsSliceView = true; |
| 232 | buffer.ReadOnly = true; |
| 233 | buffer.ColumnCount = ColumnCount; |
| 234 | return buffer; |
| 235 | } |
| 236 | |
| 237 | TCudaBuffer<const T, TSingleMapping, Type> ConstDeviceView(ui32 devId) const { |
| 238 | TCudaBuffer<const T, TSingleMapping, Type> buffer; |