AnsweredAssumed Answered

Issues testing HSA driver

Question asked by avillegas on Mar 27, 2014
Latest reply on Apr 22, 2014 by avillegas

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=

 

Second issue:

I might want to launch this kernel in the CPU, but when building the program, it does not recognize the #pragma. Is there any way to force the CPU to recognize said pragma?

 

Thank you.

Outcomes