cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

pumpkin83
Journeyman III

printf debug in kernel

Jump to solution

Hi, all:

I am working on the OpenACC compiler for the AMD GPUs. It is extremely difficult to debug the OpenCL kernel in AMD platform without the printf.

This is the simple kernel I am using.

#pragma OPENCL EXTENSION cl_amd_printf : enable

kernel void helloworld()

{

        printf("hello world!\n");

}

However, it doesn't printf anything.

I use the version AMDAPPSDK-3.0-0-Beta.

This is the output that I received from my machine:

[0] Platform Name: AMD Accelerated Parallel Processing

Choose Platform [0].

32692 CPU device available.

1 GPU device available.

Choose GPU Device:1

Device Name = Hawaii

Device Vendor = Advanced Micro Devices, Inc.

The sample code is attached. Any suggestion is appreciated.

Thank you very much,

Daniel

0 Likes
1 Solution

Accepted Solutions
boxerab
Challenger

Re: printf debug in kernel

Jump to solution

Why are you using 3.0 Beta ? The actual release in available, in which they fixed the printf bug.

Please upgrade to the full release.

View solution in original post

0 Likes
4 Replies
pumpkin83
Journeyman III

Re: printf debug in kernel

Jump to solution

Please, someone help me solve it. This is very important for me to debug my compiler CL kernel generation phase.

0 Likes
pradyotsn
Journeyman III

Re: printf debug in kernel

Jump to solution

I dont think so you can use printf in the kernel code. The extension which you are specifying , make sure that your hardware/compilier supports that. It would be helpful to debug if you can give the clinfo of your system.

0 Likes
boxerab
Challenger

Re: printf debug in kernel

Jump to solution

Why are you using 3.0 Beta ? The actual release in available, in which they fixed the printf bug.

Please upgrade to the full release.

View solution in original post

0 Likes
pradyotsn
Journeyman III

Re: printf debug in kernel

Jump to solution

I also tried to pull off the printf in kernel. You can refer to my program at:

https://github.com/pradyotsn/opencl_printf

Thank you

0 Likes