Results 1 to 4 of 4

Thread: havin error code -38 in opencl ?

  1. #1

    havin error code -38 in opencl ?

    hi
    i am having error code -38 when i print err or status of clEnqueueReadBuffer (.....)
    pls help what does it mean?
    thanks

  2. #2

    Re: havin error code -38 in opencl ?

    i have solved the problem by writing NULL in destination array in which i am storing the value of addition of two source arrays value,i am posting the code but pls help me to tell the reason why it has happened when change it to NULL


    float a[100],b[100];,c[100];
    //For addition c[i]=a[i]+b[i];
    cl_mem d_A,d_B,d_C; //mem object
    d_A =clCreateBuffer(context,CL_MEM_READ_ONLY|CL_MEM_CO PY_HOST_PTR,
    N*sizeof(float),a,&err);
    d_B= clCreateBuffer(context,CL_MEM_READ_ONLY|CL_MEM_COP Y_HOST_PTR,
    N*sizeof(float),b,&err);

    the above 2 statements are same,but when i do change from "c to NULL" in below statment it works fine
    pls tell the reason why it is happening if i write c then error and if NULL it works fine

    d_C=clCreateBuffer(context,CL_MEM_READ_ONLY|CL_MEM _COPY_HOST_PTR,
    N*sizeof(float),c,&err);//here is the problem why i cant write c ,as did in above two statement,why i have to put NULL instead of c (which is same is array as a & b)when destination mem object i have to create on gpu...

    pls help
    thanks

  3. #3

    Re: havin error code -38 in opencl ?

    sorry this statement mis written it contains CL_MEM_WRITE_ONLY

    d_C=clCreateBuffer(context,CL_MEM_WRITE_ONLY,N*siz eof(float),c,NULL);
    rest is same in above question
    thanks

  4. #4
    Senior Member
    Join Date
    Dec 2011
    Posts
    150

    Re: havin error code -38 in opencl ?

    Could it be the extra semicolon here:

    float a[100],b[100];,c[100];

    (after b before c)

Similar Threads

  1. Replies: 1
    Last Post: 01-20-2011, 06:22 PM
  2. Replies: 1
    Last Post: 12-06-2010, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •