예제 #1
0
파일: blysk_task.c 프로젝트: podobas/BLYSK
  void
  GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
           long arg_size, long arg_align, char if_clause,
           unsigned flags __attribute__((unused)))
  {
  #if defined(__STAT_TASK)
      blysk__THREAD_get()->tsc[0] = rdtsc();
  #endif

    handleSpec();
    blysk__TASK_submit_simple(fn, data, cpyfn, arg_size, arg_align);


  #if defined(__STAT_TASK)
     blysk__THREAD_get()->tsc[4] = rdtsc();
  #endif
  }
예제 #2
0
char *formatString(char *s) {
  int i;
  char *ret, *p, c;

  ret = calloc(200, 1);
  p = ret;


  for (i = 0; i < strlen(s); i++, p++) {
    if (s[i] == '\\' && i < strlen(s)) {
      if ((c = handleSpec(s[i+1]))) {
        *p = c;
        i++;
      } else {
        p--;
      }
    } else {
      *p = s[i];
    }
  }
  return ret;
}
예제 #3
0
파일: blysk_task.c 프로젝트: podobas/BLYSK
  void
  GOMP_task(void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
          long arg_size, long arg_align, bool if_clause, unsigned flags,
          void **depend) {

  #if defined(__STAT_TASK)
      blysk__THREAD_get()->tsc[0] = rdtsc();
  #endif


    handleSpec();
    /* The representation of what GCC generates and what BlyskCC generates are no compatible.
       Here we transform from GCC to BlyskCC versioning 
       NOTE: GCC does not differ between out and inout. This can be a problem later. */
    if (depend == NULL) {
  #if BLYSK_ENABLE_FANOUT_CONTROL != 0
        if(expectTrue(blysk__thread->fanout != 0)) {
            blysk__TASK_submit_simple(fn, data, cpyfn, arg_size, arg_align);
        } else {
            fn(data);
        }
  #else // BLYSK_ENABLE_FANOUT_CONTROL == 0
        blysk__TASK_submit_simple(fn, data, cpyfn, arg_size, arg_align);
  #endif
        return;
        
    }
    // TODO do we actually want to have support for the if_clause? 
    unsigned int num_depend = (uintptr_t) depend[0];
    unsigned int num_inout = (uintptr_t) depend[1];
    blysk__TASK_submit_complex_bookmark(fn, data, cpyfn, arg_size, arg_align, (char**) (depend + 2 + num_inout), num_depend - num_inout, (char**) depend + 2, num_inout, NULL, 0, 0);


  #if defined(__STAT_TASK)
     blysk__THREAD_get()->tsc[4] = rdtsc();
  #endif
  }
예제 #4
0
파일: wrapper.c 프로젝트: podobas/BLYSK
char GOMP_single_start(void) {
    handleSpec();
    return BLYSK__single();
}
예제 #5
0
파일: wrapper.c 프로젝트: podobas/BLYSK
void GOMP_critical_end(void) {
    handleSpec(); 
    pthread_mutex_unlock(&critical_lock);
}
예제 #6
0
파일: wrapper.c 프로젝트: podobas/BLYSK
void GOMP_critical_start(void) {
    handleSpec();
    pthread_mutex_lock(&critical_lock);
}
예제 #7
0
파일: wrapper.c 프로젝트: podobas/BLYSK
void GOMP_critical_end(void) {
    handleSpec();
    slrUnlock(&critical_lock);
}
예제 #8
0
파일: wrapper.c 프로젝트: podobas/BLYSK
int omp_test_lock(omp_lock_t *lock) {
    handleSpec();
//    return pthread_mutex_trylock(lock);
    return tasTryLock((TASLock*)lock);
}