Skip to content

Commit

Permalink
npu: probe htp info and capacity of rpc ion memory
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou.weiguo committed Jun 9, 2024
1 parent 08574cc commit dafa5f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ggml-qnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ int qnn_instance::qnn_init(const QnnSaver_Config_t ** saver_config) {
size_t candidate_size = 0;
uint8_t * rpc_buffer = nullptr;
const int SIZE_IN_MB = (1 << 20);
size_t probe_slots[] = { 1024, 1536, 2048 - 48, 2048};
size_t probe_slots[] = {1024, 1536, 2048 - 48, 2048};
size_t probe_counts = sizeof(probe_slots) / sizeof(size_t);
for (size_t idx = 0; idx < probe_counts; idx++) {
rpc_buffer = static_cast<uint8_t *>(alloc_rpcmem(probe_slots[idx] * SIZE_IN_MB, 4));
Expand All @@ -1589,10 +1589,8 @@ int qnn_instance::qnn_init(const QnnSaver_Config_t ** saver_config) {
break;
} else {
candidate_size = probe_slots[idx];
if (nullptr != rpc_buffer) {
free_rpcmem(rpc_buffer);
rpc_buffer = nullptr;
}
free_rpcmem(rpc_buffer);
rpc_buffer = nullptr;
}
}
if (candidate_size > _rpcmem_capacity)
Expand Down

0 comments on commit dafa5f1

Please sign in to comment.