Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*

Printing in DPC++/SYCL

RAror6
New Contributor I
1,595 Views

Hello,

I have code in DPC++ that is using an FPGA as the device and CPU host. I am trying to print to the console in tis code for debugging/state analysis, but I am failing.

I looked at the code in the tutorials and those print statements work beautifully. But when I try to add print statements of own, they fail (nothing printed to the screen). Specifically, any print statements earlier in the code (before the print "Platform Name") print sometimes and don't print the other times.

I use the following two ways of printing:
1) printf("About to Read Stuff\n");
2) std::cout << "About to Read Stuff" << std::endl;

Could I please get some help with this? I have attached my source code

Thank you!

0 Kudos
1 Solution
AbhishekD_Intel
Moderator
1,595 Views

Hi,

We tried the code sample given by you and tested on devcloud using FPGA Emulation Device but we didn't get any such issue which you are mentioning. We also tried printing before the print "Platform Name" and run multiple executions (15 times ) but didn't observe the problem mentioned by you.

 For more information, I have attached my screenshot of execution and let me know where I have to make changes to reproduce the problem you are getting. As you have not provided the aes.hpp file I have to change the image height, width, and key_length accordingly. I have attached the modified code below.

 

Warm Regards,

Abhishek 

 

View solution in original post

0 Kudos
5 Replies
AbhishekD_Intel
Moderator
1,596 Views

Hi,

We tried the code sample given by you and tested on devcloud using FPGA Emulation Device but we didn't get any such issue which you are mentioning. We also tried printing before the print "Platform Name" and run multiple executions (15 times ) but didn't observe the problem mentioned by you.

 For more information, I have attached my screenshot of execution and let me know where I have to make changes to reproduce the problem you are getting. As you have not provided the aes.hpp file I have to change the image height, width, and key_length accordingly. I have attached the modified code below.

 

Warm Regards,

Abhishek 

 

0 Kudos
RAror6
New Contributor I
1,595 Views

Thank you for the reply!

How are you running on the FPGA? I am using this command: dpcpp -fintelfpga src/run_me.cpp -DFPGA_EMULATOR -o bin/run_me.emu

Could you try running it with that command and see what happens? Could you also tell me the command you are using? I tried running it with dpcpp printerror.cpp -o printerror (what i see in the screenshot) but it says I cannot specify a device that way.

I have also attached all header and source files

 

Thank you!

0 Kudos
RAror6
New Contributor I
1,594 Views

I figured out the error :) 

 

Thank you so much! Your file helped a lot

0 Kudos
AbhishekD_Intel
Moderator
1,589 Views

Hi,

Thank you for confirming that your issue got resolved.

Please let us know if we can close this thread. You can always post a new thread if you face any other issue.



Warm Regards,

Abhishek


0 Kudos
AbhishekD_Intel
Moderator
1,535 Views

Hi,

As your issue got resolved we are closing this thread. Please feel free to post a new thread if you have any issues.


Warm Regards,

Abhishek


0 Kudos
Reply