Skip to content

Commit

Permalink
added explicit branch for auto core mask, changed default case to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
james20902 committed Jan 29, 2024
1 parent ecc58ce commit 7045c21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/native/cpp/yolo_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ YoloModel::YoloModel(std::string modelPath, int num_classes_, ModelVersion type_
rknn_core_mask core_mask;
switch (coreNumber)
{
case -1:
core_mask = RKNN_NPU_CORE_AUTO;
break;
case 0:
core_mask = RKNN_NPU_CORE_0;
break;
Expand All @@ -102,7 +105,7 @@ YoloModel::YoloModel(std::string modelPath, int num_classes_, ModelVersion type_
core_mask = RKNN_NPU_CORE_0_1_2;
break;
default:
core_mask = RKNN_NPU_CORE_AUTO;
throw std::runtime_error("invalid core selection! core selected: " + coreNumber);
break;
}
ret = rknn_set_core_mask(ctx, core_mask);
Expand Down

0 comments on commit 7045c21

Please sign in to comment.