Modify for number of emul devices
authorJiho Chu <jiho.chu@samsung.com>
Tue, 11 Apr 2023 03:05:09 +0000 (12:05 +0900)
committer추지호/SoC Architecture팀(SR)/삼성전자 <jiho.chu@samsung.com>
Tue, 11 Apr 2023 09:32:53 +0000 (18:32 +0900)
It modified for the number of emul devices.

Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
src/core/npu/NPUdrvAPI.cc
src/core/npu/NPUdrvAPI.h
src/core/npu/NPUdrvAPI_emul.cc

index a3e7e7da5d27e910fc537435ac06062f4732df85..50869d0b0500a5f2e0790d6e8d31e450c14e5c9c 100644 (file)
@@ -37,7 +37,7 @@ DriverAPI::getNumDevices (dev_type type) {
   switch (type & DEVICETYPE_MASK) {
     case DEVICETYPE_TRIV2:
 #ifdef ENABLE_EMUL
-      return TrinityEmulAPI::getNumDevices ();
+      return TrinityEmulAPI::getNumDevices (type);
 #else
       return TrinityVision2API::getNumDevices ();
 #endif
index 07187f070543b8719f7f91a890e0faa9b1ada1e0..61115138ee182610d3bf13e1e8a9d8f1c682f690 100644 (file)
@@ -182,7 +182,7 @@ class EmulReq;
 /** @brief Driver APIs for emulation */
 class TrinityEmulAPI : public DriverAPI {
  public:
-  static int getNumDevices ();
+  static int getNumDevices (dev_type type);
 
   TrinityEmulAPI (int dev_id, dev_type type);
   ~TrinityEmulAPI ();
index 672bd985c9a08f90908a5507d1e024fdac4a9979..698b1aafafe45d013d4e77b4b60cdcf0360cf157 100644 (file)
@@ -442,9 +442,13 @@ TrinityEmulAPI::getDspmSize (uint32_t *dspm) const {
   }
 
   switch (dev_type_) {
+    case dev_type::NPUCOND_TRIV2_CONN_UNKNOWN:
+    case dev_type::NPUCOND_TRIV2_CONN_SOCIP:
+    case dev_type::NPUCOND_TRIV23_CONN_UNKNOWN:
     case dev_type::NPUCOND_TRIV23_CONN_SOCIP:
       *dspm = TRIV23_DEFAULT_DSPM_SIZE;
       break;
+    case dev_type::NPUCOND_TRIV24_CONN_UNKNOWN:
     case dev_type::NPUCOND_TRIV24_CONN_SOCIP:
       *dspm = TRIV24_DEFAULT_DSPM_SIZE;
       break;
@@ -489,7 +493,7 @@ TrinityEmulAPI::getDspmSize (uint32_t *dspm) const {
  * @return number of available devices.
  */
 int
-TrinityEmulAPI::getNumDevices () {
+TrinityEmulAPI::getNumDevices (dev_type type) {
   return MAX_EMUL_DEVICES;
 }