cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

nickpenny
Adept I

OpenCL 2.0 producer/consumer pattern example on Kaveri HSA Beta

Hi,

The Kaveri OpenCL Programmer Guide.docx suggests that producer/consumer patterns are allowed, is it possible to have an example please?

I'm running on the HSA Beta.

What can be used as a semaphore between the producer and consumer?

Thanks in advance.

Nick

0 Likes
5 Replies
sourcery
Journeyman III

Good question Nick, It's not obvious is it.

The "how" should be better explained since it's stated to be available in the Beta,

But then the documentation kind of implies that it will work with Windows 7 SP! or 8.1,.

We found the Beta only worked on 8.1

Hope someone else has a solution.

Cheers

Steve

0 Likes

Hi,

  I have also found this message from a few months ago, which seems relevent here - I can't see an answer to it?

From AMD Developer Forums : All Content - OpenCL

  


Hello,



I am trying to make CPU and GPU synchronize via HSA using a shared variable in a A10 - 7850, so I tried to modify the examples provided with the HSA driver. This is my kernel code:


#pragma OPENCL EXTENSION cl_amd_c11_atomics : enable 
#define NULL 0 


__kernel void consumer(global volatile atomic_int * data)


{


     int id = get_global_id(0);


     int counter = 2;


     while(data[0] == 0)


     {


         counter = (counter + 1) ;


     }


     data[0] = counter;




The host simply sets data[0] = 0; sleeps for 2 ms and sets data[0] = 1.



First issue:


This example works fine, but whenever I update counter with a different operation (I tested counter = (counter + 1);  counter = (counter + 1)%10; counter = (counter * 3); ) it freezes for a moment and restarts the computer.


Before restarting, windows 8.1 informs of an unhandled exception (sometimes SYSTEM_THREAD_EXCEPTION_NOT_HANDLED and sometimes SYSTEM_SERVICE_EXCEPTION) in the file amdkfd.sys


Is there any restriction with the beta driver, or am I doing something wrong?


I also often get the errors mentioned above as I experiment with sleep and syncronisation.

Has anyone got a method that doesn't depend on sleep?

Thanks.

Nick.

0 Likes
dipak
Big Boss

Hi,

As I came to know, the above mentioned driver package was published only for experimental purpose and not intended to support OpenCL 2.0. It no longer exists now. Please wait till AMD releases it official support for OpenCL 2.0 [OpenCL™ 2.0 is here!].

Note: For HSA related query, you can post to HSA forum.

Regards,

I see that the new OpenCL v2.0 driver is now available.  Will the next version of the SDK, to match this release, provide synchronisation between CPU and GPU's for producer/consumer patterns?

Regards,

Nick

I guess upcoming OpenCL 2.0 SDK is going to support various new features including SVM, PIPE which can be used to write applications having producer/consumer patterns.

Regards,

0 Likes