AnsweredAssumed Answered

How to use clCreateProgramWithSource function with not single string?[CLOSED]

Question asked by amdkid on Sep 9, 2012
Latest reply on Sep 11, 2012 by amdkid

Hi to all.

 

I try to use clCreateProgramWithSource function with  strings parameter equivalent not single string.

I equate count parameter to number of strings in strings parameter

then as strings parameter I use pointer to an array of PChar strings

as lengths parameter I use NULL

 

In that case function  clCreateProgramWithSource not returns an error, but function clBuildProgram return error code -11 (CL_BUILD_PROGRAM_FAILURE)

which is not arises if in function  clCreateProgramWithSource i use single PChar string as strings parameter and count=1  lengths=NULL.

 

Below I show my cl code:

 

inline void Work0()

{

return;

}

 

inline void Work1(__global const float4 * a1, __global const float4 * b1, __global float4 * c1, int i1)

{

     float4 bufa;             

     float4 bufb;

     bufa=a1[i1];                 

     bufb=b1[i1];

     bufa += bufb;        

     c1[i1]=bufa;                  

}

 

__kernel void VectorAdd( __global const float4 * a, __global const float4 * b, __global float4 * c, int N)

{

     int i = get_global_id(0);   // Получаем номер потока

     if(i>N-1)

     {

          Work0();

     }

     else

     {

          Work1(a, b, c, i);

     }

}

 

Somebody please help me to solve that's problem.

 

Answer find in post Sep 10, 2012 7:32 AM

Outcomes