MCPcopy Create free account
hub / github.com/catboost/catboost / DeviceView

Method DeviceView

catboost/cuda/cuda_lib/cuda_buffer.h:223–235  ·  view source on GitHub ↗

TODO: get rid of this. Refactor everything to const in template type instead of holder-objects

Source from the content-addressed store, hash-verified

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;

Callers 9

ReadReduceFunction · 0.45
RunReshardTestFunction · 0.45
Y_UNIT_TESTFunction · 0.45
TestAllReduceFunction · 0.45
DeviceViewFunction · 0.45
CheckDataSetFunction · 0.45

Calls 8

SingleObjectSizeMethod · 0.80
ShiftedBufferMethod · 0.80
DeviceMemoryOffsetMethod · 0.80
TSingleMappingClass · 0.70
DeviceSliceMethod · 0.45
SizeMethod · 0.45
NotEmptyMethod · 0.45
atMethod · 0.45

Tested by 4

RunReshardTestFunction · 0.36
Y_UNIT_TESTFunction · 0.36
TestAllReduceFunction · 0.36
CheckDataSetFunction · 0.36