intel / intel-npu-acceleration-library

Intel® NPU Acceleration Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile question about using c++ API.

Septend-fun opened this issue · comments

Hi,experts. I'd like to use this repo by c++ API. But I met a question when I use the cmd to compile my code.

g++ test_matmul.cpp -o main.exe -I $intel_npu_acceleration_library_include_path -I $openvino_include_path -L $intel_npu_acceleration_library_lib -L $openvino_lib_path -lopenvino -lintel_npu_acceleration_library -mavx2 -mf16c.

There is test_matmul.cpp.

#include "nn.factory.h"
int main(){
   auto factory = ModelFactory("NPU",inC,outC,batch,true);
   // create model
   .......
}

Console output:

屏幕截图 2024-06-12 142408

Your is most probably a linking issue. I just created a c++ example to show how you can use the c++ API: https://github.com/intel/intel-npu-acceleration-library/tree/main/examples/cpp

It works, thank you a lot.