Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Backends/NNPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ if(NOT NNPI_INFERENCE_API)
message(FATAL_ERROR "nnpi_inference include files not found at ${NNPI_INF_LIB_DIR}")
endif()

find_path(NNPI_MG_API nnpiml.h ${NNPI_MG_SEARCH_PATH})
find_path(NNPI_MG_API nnpi_ice_caps.h ${NNPI_MG_SEARCH_PATH})
if(NOT NNPI_MG_API)
message(FATAL_ERROR "nnpiml include files not found at ${NNPI_MG_API_DIR}")
message(FATAL_ERROR "nnpi_ice_caps include files not found at ${NNPI_MG_API_DIR}")
endif()

find_library(NNPI_MG_LIB nnpiml ${NNPI_MG_LIB_SEARCH_PATH})
find_library(NNPI_MG_LIB nnpi_icecaps ${NNPI_MG_LIB_SEARCH_PATH})
if(NOT NNPI_MG_LIB)
message(FATAL_ERROR "nnpiml library not found at ${NNPI_MG_LIB_SEARCH_PATH}")
message(FATAL_ERROR "nnpi_icecaps library not found at ${NNPI_MG_LIB_SEARCH_PATH}")
endif()

message(STATUS "[NNPI] NNPI_API_DIR = ${NNPI_API_DIR}")
Expand Down
9 changes: 8 additions & 1 deletion lib/Backends/NNPI/ClassGen/NNPISpecificNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ BB.newNode("NNPICustomDSP")
.setDocstring("This is an experimental NNPI-specific node representing a "
"custom DSP op");

BB.includeBackendSpecificVerification("glow/NNPISpecificNodesVerification.h");
BB.newNode("NNPICustomIA")
.addMember(MemberType::VectorNodeValue, "Inputs")
.addResultFromCtorArg() // for now use single output
.addMember(MemberType::String, "KernelName")
.addMember(MemberType::String, "IAPath")
.setDocstring("This is an experimental NNPI-specific node representing a "
"custom IA op");

BB.includeBackendSpecificVerification("glow/NNPISpecificNodesVerification.h");
#endif // GLOW_WITH_NNPI
4 changes: 4 additions & 0 deletions lib/Backends/NNPI/ClassGen/NNPISpecificNodesVerification.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ bool NNPICustomDSPNode::verify() const {
return true; // actual verification to happen in the backend
}

bool NNPICustomIANode::verify() const {
return true; // actual verification to happen in the backend
}

#endif // GLOW_WITH_NNPI
11 changes: 11 additions & 0 deletions lib/Backends/NNPI/DebugMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "nnpi_transformer.h"
#include <chrono>
#include <glog/logging.h>
#include <sstream>
#include <string>

// Macro for memory instrumentation.
Expand Down Expand Up @@ -273,4 +274,14 @@ GetNNPIInferenceErrorDesc(NNPIInferenceErrorCode err) {
"\n"; \
}

// Break long log messages to individual lines (Glog limits to 30k chars).
#define LONG_LOG(level, msg) \
{ \
std::istringstream iss(msg); \
std::string line; \
while (std::getline(iss, line)) { \
LOG(level) << line; \
} \
}

#endif // GLOW_NNPI_DEBUG_MACROS_H
Loading