@@ -832,6 +832,7 @@ static void ggmlhexagon_get_timestring(char * p_currenttime) {
832
832
memset (buf, 0 , GGMLHEXAGON_TMPBUF_LEN);
833
833
snprintf (buf, sizeof (buf), " %04d-%02d-%02d,%02d:%02d:%02d" ,
834
834
tm .tm_year + 1900 , tm .tm_mon + 1 , tm .tm_mday , tm .tm_hour , tm .tm_min , tm .tm_sec );
835
+ GGML_UNUSED (ms);
835
836
return buf;
836
837
};
837
838
@@ -2937,8 +2938,6 @@ void * qnn_instance::get_rpcmem_from_memhandle(Qnn_MemHandle_t mem_handle) {
2937
2938
}
2938
2939
2939
2940
void qnn_instance::unregister_rpcmem () {
2940
- Qnn_ErrorHandle_t error = QNN_SUCCESS;
2941
-
2942
2941
if (_qnn_mem_set.empty ()) {
2943
2942
GGMLHEXAGON_LOG_WARN (" no rpcmem registered\n " );
2944
2943
}
@@ -6039,6 +6038,7 @@ static void ggml_backend_hexagon_free(ggml_backend_t backend) {
6039
6038
for (auto & tensor : ptensors) {
6040
6039
ggmlqnn_free_qnntensor (tensor);
6041
6040
}
6041
+ GGML_UNUSED (graph_handle);
6042
6042
GGMLHEXAGON_LOG_DEBUG (" graph handle %p" , graph_handle);
6043
6043
GGMLHEXAGON_LOG_DEBUG (" clean up graph:%s" , graph_name.c_str ());
6044
6044
}
@@ -6134,13 +6134,18 @@ static void ggml_backend_hexagon_device_get_memory(ggml_backend_dev_t dev, size_
6134
6134
} else if (HEXAGON_BACKEND_QNNNPU == ctx->device ) {
6135
6135
size_t rpc_ion_memsize = 0 ;
6136
6136
size_t rpc_ion_usage = 0 ;
6137
- if (HWACCEL_CDSP != g_hexagon_appcfg.hwaccel_approach ) {
6138
- rpc_ion_memsize = ctx->instance ->get_rpcmem_capacity ();
6139
- rpc_ion_usage = ctx->instance ->get_rpcmem_usage ();
6140
- } else {
6141
- rpc_ion_memsize = ctx->rpc_mempool_capacity ;
6142
- rpc_ion_usage = ctx->rpc_mempool_usage ;
6143
- }
6137
+ GGML_ASSERT (nullptr != ctx->instance );
6138
+ rpc_ion_memsize = ctx->instance ->get_rpcmem_capacity ();
6139
+ rpc_ion_usage = ctx->instance ->get_rpcmem_usage ();
6140
+ *total = rpc_ion_memsize;
6141
+ *free = (rpc_ion_memsize - rpc_ion_usage);
6142
+ GGMLHEXAGON_LOG_DEBUG (" rpc memsize %d MiB" , rpc_ion_memsize / SIZE_IN_MB);
6143
+ GGMLHEXAGON_LOG_DEBUG (" rpc usage %d MiB\n\n " , rpc_ion_usage / SIZE_IN_MB);
6144
+ } else if (HEXAGON_BACKEND_CDSP == ctx->device ) {
6145
+ size_t rpc_ion_memsize = 0 ;
6146
+ size_t rpc_ion_usage = 0 ;
6147
+ rpc_ion_memsize = ctx->rpc_mempool_capacity ;
6148
+ rpc_ion_usage = ctx->rpc_mempool_usage ;
6144
6149
*total = rpc_ion_memsize;
6145
6150
*free = (rpc_ion_memsize - rpc_ion_usage);
6146
6151
GGMLHEXAGON_LOG_DEBUG (" rpc memsize %d MiB" , rpc_ion_memsize / SIZE_IN_MB);
0 commit comments