cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

rick_weber
Adept II

async_work_group_copy causes compiler seg fault

I get a seg fault in clBuildProgram() when I call async_work_group_copy() with struct arguments. The struct is defined as:

typedef struct _MSScanInfo
{
  unsigned int mMinMZ;
  unsigned int mMaxMZ;
  unsigned int mTotalCurrent;
  unsigned int mMSLevel;
  unsigned int mNumPeaks;
  unsigned int mPrecursorMass;
  unsigned int mNumHoles;
  unsigned int charge;
}MSScanInfo;

If I do the following, it doesn't seg fault:
  cl_event loadInfoDone
    = async_work_group_copy((__local unsigned int*)&scanInfoLocal, 
                            (__global unsigned int*)&scanInfo[mySpectra], 
                            sizeof(MSScanInfo) / sizeof(unsigned int),
                            0); 


 

0 Likes
5 Replies

rick,
can you give a small complete kernel snippet that shows the crash? I am getting the following errors when I try to do it:
----

C:\Users\mvillmow.AMD\AppData\Local\Temp\OCL46D2.tmp.cl(15): error: invalid
type conversion
async_work_group_copy((__local unsigned int*)&scanInfoLocal,
^

C:\Users\mvillmow.AMD\AppData\Local\Temp\OCL46D2.tmp.cl(15): error: bad
argument type: expected pointer to addrSpace global/local
async_work_group_copy((__local unsigned int*)&scanInfoLocal,
^

Thanks,
Micah
0 Likes

typedef struct _MSScanInfo

{

  unsigned int mMinMZ;

  unsigned int mMaxMZ;

  unsigned int mTotalCurrent;

  unsigned int mMSLevel;

  unsigned int mNumPeaks;

  unsigned int mPrecursorMass;

  unsigned int mNumHoles;

  unsigned int mCharge;

}MSScanInfo;

 

__kernel void preprocessSpectra(__global unsigned int* intensity,

                                __global unsigned int* mz,

                                __global unsigned int* intensity2,

                                __global unsigned int* mz2,

                                unsigned int stride,

                                __global MSScanInfo* scanInfo,

                                float cutoffFactor,

                                __global unsigned int* classThreshhold,

                                unsigned int numClasses)

{

  __local unsigned int scratch1;

  __local unsigned int scratch2;

  __local unsigned int scanZeros[64];

  __local unsigned int scanOnes[64];

  __local MSScanInfo scanInfoLocal;

  size_t mySpectra = get_global_id(1);

  unsigned int arrayLen;

  unsigned int maxPeak;

  event_t loadInfoDone;

 

  loadInfoDone

    = async_work_group_copy(&scanInfoLocal, 

                            &scanInfo[mySpectra], 

                            1,  

                            0); 

}



0 Likes

stack trace:

#0  0x00007ffff6c73052 in ?? () from /lib/libc.so.6

#1  0x00007ffff5917de6 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#2  0x00007ffff59197a1 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#3  0x00007ffff591aa40 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#4  0x00007ffff58fc1ae in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#5  0x00007ffff5902161 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#6  0x00007ffff58fc5a2 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#7  0x00007ffff5900647 in ?? ()

   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so

#8  0x00007ffff5a177f4 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#9  0x00007ffff5a18e4e in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#10 0x00007ffff593c4c1 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#11 0x00007ffff593ce5a in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#12 0x00007ffff5acc34a in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#13 0x00007ffff5acd404 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#14 0x00007ffff5ace063 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#15 0x00007ffff5a70bb8 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#16 0x00007ffff58daab2 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#17 0x00007ffff5832a08 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#18 0x00007ffff519bd01 in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#19 0x00007ffff51954ba in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#20 0x00007ffff51e216a in ?? ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so
#21 0x00007ffff517377a in clBuildProgram ()
   from /nfs/sw/opencl/ati/current/lib/x86_64/libatiocl64.so


0 Likes

rick.weber,
This does not crash with the internal compiler. Also you cannot pass a struct argument to this function, so you have to cast the pointer to an integer and this compiles if done with the next release.
0 Likes

Yeah I figured this shouldn't actually be allowed. I'll just cast to an unsigned int pointer.

0 Likes