Community
cancel
Showing results for 
Search instead for 
Did you mean: 
RAror6
New Contributor I
315 Views

Printing in DPC++/SYCL

Jump to solution

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!

Tags (1)
0 Kudos
1 Solution
AbhishekD_Intel
Moderator
315 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

5 Replies
AbhishekD_Intel
Moderator
316 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

RAror6
New Contributor I
315 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!

RAror6
New Contributor I
315 Views

I figured out the error :) 

 

Thank you so much! Your file helped a lot

AbhishekD_Intel
Moderator
309 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


AbhishekD_Intel
Moderator
255 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


Reply