Results 1 to 4 of 4

Thread: strange array problem

  1. #1

    strange array problem

    I have this method:
    Code :
    kernel void myKern(global int* paiOut) // real function has more parameters

    inside of the method, I have this:

    Code :
        int aiTravel[11514];
        aiTravel[0] = 0;
        int iTravels = 1;

    I have a while-loop to fill the "aiTravel"-array with numbers.. it doesn't return error, but the while-loop's "break"-function is supposed to go off depending on the number from "aiTravel[x]". it doesn't ever break, and it loops forever.

    anyway, I think the problem is that aiTravel[x] is returning wrong numbers, I did this test:

    Code :
                        paiOut[0] = iTravels;
                        paiOut[1] = aiTravel[iTravels];
                        paiOut[2] = aiTravel[2];
                        break;

    then I print these values from c#:
    paiOut[0] = 2
    paiOut[1] = 2
    paiOut[2] = -1


    why is paiOut[1] different compared to paiOut[2] ?


    I can try to make a complete, simpler kernel to try to reproduce the problem and post full code if you don't understand it. The kernel I am currently using is very big

  2. #2
    Member
    Join Date
    Jul 2011
    Location
    Moscow, Russia
    Posts
    41

    Re: strange array problem

    Did I get you right? You are allocating aiTravel[11514] array as private variable?
    Blog (in russian)

  3. #3

    Re: strange array problem

    Quote Originally Posted by Maxim Milakov
    Did I get you right? You are allocating aiTravel[11514] array as private variable?
    yes

  4. #4
    Member
    Join Date
    Jul 2011
    Location
    Moscow, Russia
    Posts
    41

    Re: strange array problem

    Quote Originally Posted by katerpillar801
    Quote Originally Posted by Maxim Milakov
    Did I get you right? You are allocating aiTravel[11514] array as private variable?
    yes
    Well, I cannot say anything on the issue you initially specified but allocating 44KB private memory buffer is just not workable for GPUs. Register resources are scarse in these devices. Compiler might spill excessive register allocations to global memory (with dramatic reduction in kernel execution speed), but only up to some limit. 44KB is just overkill.
    Blog (in russian)

Similar Threads

  1. Array in global memory - strange results
    By phaethon in forum OpenCL
    Replies: 3
    Last Post: 11-04-2012, 05:50 PM
  2. Strange linking problem
    By Tori in forum OpenCL
    Replies: 1
    Last Post: 06-15-2011, 12:43 PM

Posting Permissions

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