Ejemplo n.º 1
0
DWORD run(void * data)
{
  int thread_idxx;
  int block_idxx;
  long long lhandle;
  int exception;
  int handle;    
  int index;

  lock_thread_id();
  thread_idxx = global_thread_id;
    
  ++global_thread_id;
  unlock_thread_id();
  
  block_idxx = global_block_idxx;

  TlsSetValue(blockIdxxKey, (void *) block_idxx);
  TlsSetValue(blockDimxKey, (void *) global_block_dimx);
  TlsSetValue(gridDimxKey, (void *) global_grid_dimx);
  TlsSetValue(threadIdxxKey, (void *) thread_idxx);

  index = block_idxx * global_block_dimx + thread_idxx;
  lhandle = global_handles[index];
  lhandle = lhandle >> 4;
  handle = (int) lhandle;
  exception = 0;
  %%invoke_run%%(global_gc_info, handle, &exception);
Ejemplo n.º 2
0
static void * run(void * data){
  int thread_idxx;
  int block_idxx;
  long long lhandle;
  int exception;
  int handle;
  int index;

  lock_thread_id();
  thread_idxx = global_thread_id;

  ++global_thread_id;
  unlock_thread_id();

  block_idxx = global_block_idxx;

  pthread_setspecific(blockIdxxKey, (void *) block_idxx);
  pthread_setspecific(blockDimxKey, (void *) global_block_dimx);
  pthread_setspecific(gridDimxKey, (void *) global_grid_dimx);
  pthread_setspecific(threadIdxxKey, (void *) thread_idxx);

  index = block_idxx * global_block_dimx + thread_idxx;
  lhandle = global_handles[index];
  lhandle = lhandle >> MallocAlignZeroBits;
  handle = (int) lhandle;
  exception = 0;
  %%invoke_run%%(global_gc_info, handle, &exception);