MCPcopy Create free account
hub / github.com/apache/singa / mutable_data

Method mutable_data

src/core/common/common.cc:25–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace singa {
24
25void* Block::mutable_data() {
26 if (data_ == nullptr && size_ > 0) {
27 data_ = device_->Malloc((int)size_);
28 }
29 initialized_ = true;
30 return static_cast<char*>(data_) + offset_;
31}
32
33const void* Block::data() const {
34 CHECK(initialized_) << "Must initialize data before reading it";

Callers 15

TESTFunction · 0.80
Opencl>Method · 0.80
traverse_unaryFunction · 0.80
traverse_binaryFunction · 0.80
Cpp>Method · 0.80
Cuda>Method · 0.80
TransformImplFunction · 0.80
CopyDataToFromMethod · 0.80
FreeBlockMethod · 0.80
CopyDataToFromMethod · 0.80
CopyDataFromHostPtrMethod · 0.80

Calls 1

MallocMethod · 0.45

Tested by 1

TESTFunction · 0.64