cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

kevinmanhn
Journeyman III

Problem with OpenCL 2.0

Hi!

I have an APU desktop computer A10 7850K, AMD Radeon(TM) R7 Graphics.

When I compiled the code, it understands the OpenCL 2.0 but I have two problems:

1. Whenever I placed a printf command in he kernel code, the result after running is totally wrong. However, if I ran this code in OpenCL 1.2, it worked fine.

2. I ran EnqueueDevice samples from AMD, it seem to be working fine. Yet, when I ran my simple code of enqueue device (Dynamic Parallelism feature), it locked up my computer.

The simple code looks like this:

__kernel void Mykernel(...)

{     //My kernel code

     if(get_global_id(0)==0){

    ndrange_t ndrange1=ndrange_1D(1);

    queue_t defQ = get_default_queue();   

    enqueue_kernel(defQ, CLK_ENQUEUE_FLAGS_WAIT_KERNEL,  ndrange,

    ^{ printf("%d\n", get_global_id(0)); });

    }

}   

Can someone please explain it to me?

Thank you in advance.

Kevin.

0 Likes
1 Solution
dipak
Big Boss

Hi Kevin,

My apologies for this delayed reply.

1. I've also found some issue with printf in OpenCL2.0 with latest driver. My observation was- a) not getting the expected result from printf (however, same kernel code worked fine when compiling for OpenCL 1.2) and b) printf didn't work (i.e. nothing printed at all) inside a child kernel. I've asked some concerned person regarding this. I'll get back to you once get any update.

2. Please try to run your kernel using any OpenCL2.0 sample from APP SDK. If it works then there may be some issue with your host-side code. Please ensure that you've created the default device queue before running the kernel on selected OpenCL2.0 device. You may also check whether get_default_queue() returns a valid device queue or not before enqueuing the child kernel.

Regards,

View solution in original post

0 Likes
2 Replies
dipak
Big Boss

Hi Kevin,

My apologies for this delayed reply.

1. I've also found some issue with printf in OpenCL2.0 with latest driver. My observation was- a) not getting the expected result from printf (however, same kernel code worked fine when compiling for OpenCL 1.2) and b) printf didn't work (i.e. nothing printed at all) inside a child kernel. I've asked some concerned person regarding this. I'll get back to you once get any update.

2. Please try to run your kernel using any OpenCL2.0 sample from APP SDK. If it works then there may be some issue with your host-side code. Please ensure that you've created the default device queue before running the kernel on selected OpenCL2.0 device. You may also check whether get_default_queue() returns a valid device queue or not before enqueuing the child kernel.

Regards,

0 Likes

Thank you for your answers.

Kevin.

0 Likes