Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Layout Interface #184

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading