cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Franchute13
Journeyman III

KERNELANALYZER problem

Hello.
Sorry for my English.

I'm running the following code at the KERNELANALYZER . When you press on the button "compile", closes the program without an ERROR message.

Why is this happening?

 

 

inline int mezclar(int *vector, int *vectorTemp, int posIzq, int posDer, int posFin) { int finIzq = posDer -1; int posAux = posIzq; int numElementos = posFin - posIzq +1; while (posIzq<= finIzq && posDer <= posFin){ if(vector[posIzq] < vector[posDer]) vectorTemp[posAux++] = vector [posIzq++]; else vectorTemp[posAux++] = vector[posDer++]; } while (posIzq<= finIzq){ vectorTemp[posAux++] = vector[posIzq++]; } while (posDer<=posFin){ vectorTemp[posAux++]=vector[posDer++]; } int i = get_global_id(0); //for (int i=0; i < numElementos; i++, posFin--){ //vector[posFin] = vectorTemp[posFin]; vector = vectorTemp; //} } inline mergeSort(int *vector, int *vectorTemp, int indexIzq, int indexDer) { if(indexIzq<indexDer){ int centro = (indexIzq+indexDer)/2; mergeSort(vector, vectorTemp,indexIzq,centro); mergeSort(vector, vectorTemp, centro+1,indexDer); mezclar(vector, vectorTemp, indexIzq, centro+1, indexDer); } } __kernel void main(__global int *vector,__global int *vectorTemp, int tamano, __global int *salida) { salida = mergeSort(*vector, *vectorTemp, 0, tamano); }

0 Likes
4 Replies
bpurnomo
Staff

Are you able to run this program properly without SKA?  It looks like you are using a recursive function in the kernel.

0 Likes

Hi.

Do not try to run it without SKA. Should work?

Yes, it is recursive. It mergesort

 

0 Likes

Recursive functions are not supported in OpenCL.

0 Likes

Ouuuch!.

Ok, thank

0 Likes