@@ -1002,7 +1002,6 @@ class hexagon_profiler {
10021002
10031003        if  (0  == elapse_time) {
10041004            // filter invalid profiler data
1005-             GGMLHEXAGON_LOG_DEBUG (" _enable_profiler %d"  , _enable_profiler);
10061005            return ;
10071006        }
10081007
@@ -1197,10 +1196,10 @@ class hexagon_perf {
11971196
11981197        _end_time = ggml_time_us ();
11991198        _duration = (_end_time - _begin_time);
1200-         // I think  add following judgement will useful for other developers and AI experts although:
1199+         // add following judgement will useful for other developers and AI experts although:
12011200        //  it breaks the original logic
12021201        //  it's not mandatory
1203-         //  I  had to expose two public function in hexagon_profiler class
1202+         //  had to expose two public function in hexagon_profiler class
12041203        if  (g_hexagon_profiler.profiler_get_frame_index () <= g_hexagon_profiler.profiler_get_threshold_count ()) {
12051204            GGMLHEXAGON_LOG_VERBOSE (" inference duration of %s through %s: %lld microseconds"  ,
12061205                                    _perf_name.c_str (), ggmlhexagon_get_hwaccel_approach_name (g_hexagon_appcfg.hwaccel_approach ), _duration);
@@ -1774,7 +1773,7 @@ static void ggmlhexagon_load_cfg() {
17741773    });
17751774    std::string precision_mode;
17761775    std::string ggml_hexagon_version;
1777-     hexagoncfg_instance.get_stringvalue (" general"  , " ggml_hexagon_version"  , ggml_hexagon_version, " 1.00 "  );
1776+     hexagoncfg_instance.get_stringvalue (" general"  , " ggml_hexagon_version"  , ggml_hexagon_version, " 1.03 "  );
17781777    hexagoncfg_instance.get_intvalue (" general"  , " enable_perf"  , g_hexagon_appcfg.enable_perf , 1 );
17791778    hexagoncfg_instance.get_intvalue (" general"  , " print_tensors_info"  , g_hexagon_appcfg.print_tensors_info , 0 );
17801779    hexagoncfg_instance.get_intvalue (" general"  , " dump_op_info"  , g_hexagon_appcfg.dump_op_info , 0 );
@@ -1888,7 +1887,7 @@ static void ggmlhexagon_print_running_timestamp(ggml_backend_hexagon_context * c
18881887// ================================================================================================= 
18891888//   section-5: QNN helper function/class
18901889// ================================================================================================= 
1891- // ensure  every QNN tensor/opcfg name is unique, threadsafe is not required at the moment
1890+ // make sure  every QNN tensor/opcfg name is unique, threadsafe is not required at the moment
18921891static  void  ggmlqnn_reset_idx () {
18931892    g_qnntensor_idx = 0 ;
18941893    g_qnnopcfg_idx = 0 ;
@@ -5341,7 +5340,7 @@ static int ggmlhexagon_init_dsp(ggml_backend_hexagon_context * ctx) {
53415340        goto  bail;
53425341    }
53435342
5344-     // ensure  test-backend-ops get the correct backend name when hwaccel approach is 2(HWACCEL_CDSP)
5343+     // make sure  test-backend-ops get the correct backend name when hwaccel approach is 2(HWACCEL_CDSP)
53455344    memcpy (g_hexagon_mgr[ctx->device ].name , " Hexagon-cDSP"  , strlen (" Hexagon-cDSP"  ));
53465345
53475346    return  0 ;
@@ -5740,7 +5739,7 @@ struct ggml_backend_hexagon_buffer_context {
57405739    ~ggml_backend_hexagon_buffer_context () {
57415740        if  (buffer) {
57425741            if  ((g_hexagon_appcfg.hwaccel_approach  == HWACCEL_CDSP) && (1  == g_hexagon_appcfg.enable_rpc_ion_mempool )) {
5743-                 // do nonthing  here because rpc mempool was used for HWACCEL_CDSP
5742+                 // do nothing  here because rpc mempool was used for HWACCEL_CDSP
57445743            } else  {
57455744                ggml_aligned_free (buffer, 0 );
57465745            }
@@ -6272,6 +6271,9 @@ static void ggml_backend_hexagon_set_n_threads(ggml_backend_t backend, int n_thr
62726271int  ggml_backend_hexagon_get_device_count () {
62736272    if  (g_hexagon_appcfg.hwaccel_approach  == HWACCEL_CDSP) {
62746273        GGML_ASSERT (g_hexagon_appcfg.hexagon_backend  == HEXAGON_BACKEND_CDSP);
6274+         // here is the trick:
6275+         // there only 1 backend_device when g_hexagon_appcfg.hwaccel_approach == HWACCEL_CDSP
6276+         // so return 1
62756277        return  1 ;
62766278    } else  {
62776279        return  GGML_HEXAGON_MAX_DEVICES;
@@ -6516,7 +6518,7 @@ ggml_backend_t ggml_backend_hexagon_init(size_t device, const char * runtime_lib
65166518            return  nullptr ;
65176519        }
65186520    } else  {
6519-         // got  fully description of SoC when hwaccel approach is HWACCEL_QNN and backend is HEXAGON_BACKEND_QNNNPU
6521+         // get  fully description of SoC when hwaccel approach is HWACCEL_QNN and backend is HEXAGON_BACKEND_QNNNPU
65206522        GGMLHEXAGON_LOG_INFO (" device name %s"  , ggml_backend_hexagon_device_get_description (hexagon_backend->device ));
65216523    }
65226524    GGMLHEXAGON_LOG_DEBUG (" leave %s"  , __func__);
0 commit comments