Skip to content

Commit

Permalink
Remove Layout Interface
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Mercier <[email protected]>
  • Loading branch information
GuillaumeMercier committed Jun 28, 2024
1 parent 3f191fe commit 8008c6c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 414 deletions.
103 changes: 0 additions & 103 deletions include/quo-vadis-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ extern "C" {
/**
* Mapping policies types.
*/
/*
typedef enum qv_policy_s {
QV_POLICY_PACKED = 1,
QV_POLICY_COMPACT = 1,
QV_POLICY_CLOSE = 1,
QV_POLICY_SPREAD = 2,
QV_POLICY_DISTRIBUTE = 3,
QV_POLICY_ALTERNATE = 3,
QV_POLICY_CORESFIRST = 3,
QV_POLICY_SCATTER = 4,
QV_POLICY_CHOOSE = 5,
} qv_policy_t;
*/

typedef enum qv_policy_s {
QV_POLICY_PACKED = 1,
Expand Down Expand Up @@ -75,7 +62,6 @@ qv_thread_context_free(
qv_context_t *ctx
);

#ifndef USE_LAYOUTS
typedef struct {
qv_context_t *ctx;
qv_scope_t *scope;
Expand Down Expand Up @@ -118,95 +104,6 @@ qv_thread_scope_split(
qv_scope_t ***subscope
);

#else // TODO(skg) Can we get rid of the old interface?
/**
* Layout for fine-grain binding
* with default behaviour
*/
typedef struct qv_layout_params_s {
qv_policy_t policy;
qv_hw_obj_type_t obj_type;
int stride;
} qv_layout_params_t;

typedef struct qv_layout_cached_info_s {
qv_layout_params_t params;
hwloc_const_cpuset_t cpuset;
hwloc_obj_type_t hwloc_obj_type;
int nb_objs;
int nb_threads;
int *rsrc_idx;
} qv_layout_cached_info_t;

typedef struct qv_layout_s {
qvi_hwloc_t *hwl; // in cached infos instead?
hwloc_topology_t hw_topo; // in cached infos instead?
qv_layout_params_t params;
qv_context_t *ctx;
qv_layout_cached_info_t cached_info;
int is_cached;
} qv_layout_t;

/**
* Used to pass args to pthreads.
*/
typedef struct {
qv_context_t *ctx;
qv_scope_t *scope;
qv_layout_t *thread_layout;
int th_id;
int num_th;
} qv_thread_args_t;

int
qv_thread_layout_create(
qv_context_t *ctx,
qv_layout_params_t params,
qv_layout_t **layout
);

int
qv_thread_layout_free(
qv_layout_t *layout
);

int
qv_thread_layout_apply(
qv_thread_args_t th_args
);

/**
* Used for args to pthreads.
*/
int
qv_thread_args_set(
qv_context_t *ctx,
qv_scope_t *scope,
qv_layout_t *thread_layout,
int th_id,
int num_th,
qv_thread_args_t *th_args
);

int
qv_thread_layout_set_policy(
qv_layout_t *layout,
qv_policy_t policy
);

int
qv_thread_layout_set_obj_type(
qv_layout_t *layout,
qv_hw_obj_type_t obj_type
);

int
qv_thread_layout_set_stride(
qv_layout_t *layout,
int stride
);
#endif // USE_LAYOUTS

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 8008c6c

Please sign in to comment.