Skip to content

snRuntime/api/omp/eu_decls.h

Classes

Name
struct eu_t

Functions

Name
void eu_init(void )
Initialize the event unit.
void eu_exit(uint32_t core_idx)
send all workers in loop to exit()
void eu_event_loop(uint32_t cluster_core_idx)
Enter the event unit loop, never exits.
int eu_dispatch_push(void()(void , uint32_t) fn, uint32_t argc, void * data, uint32_t nthreads)
Set function to execute by nthreads number of threads.
void eu_run_empty(uint32_t core_idx)
wait for all workers to idle
void eu_print_status()
Debugging info to printf.

Functions Documentation

function eu_init

inline void eu_init(
    void 
)

Initialize the event unit.

function eu_exit

inline void eu_exit(
    uint32_t core_idx
)

send all workers in loop to exit()

Parameters:

  • core_idx cluster-local core index

function eu_event_loop

inline void eu_event_loop(
    uint32_t cluster_core_idx
)

Enter the event unit loop, never exits.

Parameters:

  • cluster_core_idx cluster-local core index
  • cluster_core_idx cluster-local core index

function eu_dispatch_push

inline int eu_dispatch_push(
    void(*)(void *, uint32_t) fn,
    uint32_t argc,
    void * data,
    uint32_t nthreads
)

Set function to execute by nthreads number of threads.

Parameters:

  • fn pointer to worker function to be executed
  • data pointer to function arguments
  • argc number of elements in data
  • nthreads number of threads that have to execute this event

function eu_run_empty

inline void eu_run_empty(
    uint32_t core_idx
)

wait for all workers to idle

Parameters:

  • core_idx cluster-local core index

function eu_print_status

inline void eu_print_status()

Debugging info to printf.

Source code

// Copyright 2021 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

typedef struct {
    uint32_t workers_in_loop;
    uint32_t exit_flag;
    uint32_t workers_mutex;
    uint32_t workers_wfi;
    struct {
        void (*fn)(void *, uint32_t);  // points to microtask wrapper
        void *data;
        uint32_t argc;
        uint32_t nthreads;
        uint32_t fini_count;
    } e;
} eu_t;

inline void eu_init(void);

inline void eu_exit(uint32_t core_idx);

inline void eu_event_loop(uint32_t cluster_core_idx);

inline int eu_dispatch_push(void (*fn)(void *, uint32_t), uint32_t argc,
                            void *data, uint32_t nthreads);

inline void eu_run_empty(uint32_t core_idx);

inline void eu_print_status();

Updated on 2023-06-19 at 09:43:56 +0000