Skip to content

Commit

Permalink
use set_data_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
chraac committed Dec 14, 2024
1 parent 7aae6fe commit 74ecc7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion ggml/src/ggml-qnn/op-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool ggml_qnn_op_config_base::add_tensor_param(const std::string &name, const qn
}

GGML_ASSERT(data_size > 0);
if (!param_tensor->bind_buffer(const_cast<uint8_t *>(data), data_size)) {
if (!param_tensor->set_data_buffer(data, data_size)) {
QNN_LOG_ERROR("parameter tensor bind_buffer failed");
return false;
}
Expand Down
9 changes: 0 additions & 9 deletions ggml/src/ggml-qnn/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ class ggml_qnn_tensor : public std::enable_shared_from_this<ggml_qnn_tensor> {
return true;
}

bool bind_buffer(uint8_t *buffer, const size_t buffer_size) {
if (!_buffer_storage.empty()) {
QNN_LOG_DEBUG("[%s]already has buffer storage, skip bind", _tensor_name.c_str());
return true;
}

return bind_buffer_impl(buffer, buffer_size);
}

bool bind_ggml_tensor(ggml_tensor *tensor) {
if (!_buffer_storage.empty()) {
QNN_LOG_DEBUG("[%s]already has buffer storage, skip bind", _tensor_name.c_str());
Expand Down

0 comments on commit 74ecc7b

Please sign in to comment.