Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Using 3rd party library functions in kernel

Benjam1n
Beginner
869 Views

Hello,

I was wondering if I could use the C++ library PcapPlusPlus in my SYCL Code. I would like to dissect packets in a pcap file with SYCL on a FPGA. On the Host it has worked but not for the Kernels, so I was wondering if this even possible?

I downloaded the Github repository and built the files for my CentOS Stream 8 and could integrate the CMake parameters necessary in the vector-add project, so it would work properly. I tested it by using the Tutorial which reads a pcap file and outputs IPv4 addresses. When trying to offload this on my FPGA device, it causes an error, that the identifier "pcapp" was not declared, seemingly not knowing about the library.

PcapPlusPlus is not a header-only library, so I figured this could get more complex.

I am aware of the SYCL_EXTERNAL Macro but I'm non sure if/how this would work, if I change the functions of PcapPlusPlus like this.

 

For example, this code snippet does not work and throws and "undeclared identifier 'pcapp'" error when it does work fine outside the kernel:

q.submit([&](sycl::handler& cgh) {
cgh.single_task([=]() { pcpp::RawPacket rawPacket;

 

I am using:

* pcapplusplus-23.09

* CentOS Stream 8

* oneAPI Base Toolkit 2023.1

 

What can I do? Thanks for any help.

0 Kudos
1 Solution
Alex_Y_Intel
Moderator
804 Views

No, unfortunately you cannot use 3rd party library directly in the device code. 

View solution in original post

0 Kudos
1 Reply
Alex_Y_Intel
Moderator
805 Views

No, unfortunately you cannot use 3rd party library directly in the device code. 

0 Kudos
Reply