Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix_issue583_Remove unnecessary null pointer checks #1140

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cinn/runtime/buffer.cc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Shape::Shape(const Shape &other) : data_(new value_type[other.ndims()]), ndims_(
void Shape::Resize(int ndim) {
CHECK_GT(ndim, 0);
ndims_ = ndim;
data_ = new value_type[ndim];
data_ = new value_type[ndim];
enkilee marked this conversation as resolved.
Show resolved Hide resolved
}

Shape::value_type &Shape::operator[](int i) {
Expand Down
4 changes: 1 addition & 3 deletions cinn/runtime/buffer.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class Buffer {
CHECK(data_) << "alloc buffer failed";
}
//! Deallocate the memory in host device.
void DeallocHost() {
data_ = nullptr;
}
void DeallocHost() { data_ = nullptr; }
enkilee marked this conversation as resolved.
Show resolved Hide resolved

T& operator()(int i0) {
CHECK_EQ(shape_.ndims(), 1);
Expand Down