MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / ThreadedInputSplit

Method ThreadedInputSplit

src/io/threaded_input_split.h:29–42  ·  view source on GitHub ↗

! * \brief constructor * \param base an base object to define how to read data */

Source from the content-addressed store, hash-verified

27 * \param base an base object to define how to read data
28 */
29 explicit ThreadedInputSplit(InputSplitBase *base, const size_t batch_size)
30 : buffer_size_(InputSplitBase::kBufferSize),
31 batch_size_(batch_size),
32 base_(base), tmp_chunk_(NULL) {
33 iter_.set_max_capacity(2);
34 // initalize the iterator
35 iter_.Init([this](InputSplitBase::Chunk **dptr) {
36 if (*dptr == NULL) {
37 *dptr = new InputSplitBase::Chunk(buffer_size_);
38 }
39 return base_->NextBatchEx(*dptr, batch_size_);
40 },
41 [base]() { base->BeforeFirst(); });
42 }
43 // destructor
44 virtual ~ThreadedInputSplit(void) {
45 iter_.Destroy();

Callers

nothing calls this directly

Calls 4

set_max_capacityMethod · 0.80
InitMethod · 0.45
NextBatchExMethod · 0.45
BeforeFirstMethod · 0.45

Tested by

no test coverage detected