summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/src/main.c b/src/main.c
index 381040a..c482f36 100644
--- a/src/main.c
+++ b/src/main.c
@@ -200,34 +200,30 @@ static int load_io_functions(struct settings const * const s, struct stream * co
{
int ret = 0;
- if (in->type == stream_out) {
- if (s->format == array) {
- in->get_next_element_cache = cached_get_array;
- in->place_next_element_cache = cached_put_array;
- in->split = cache_block_split;
- in->rewind = cache_rewind;
- } else { /* if (s->format == list */
- /* TODO */
- }
- } else if (in->type == stream_in) { /* reading streams do not support dumping */
- if (s->format == array) {
- in->get_next_element_cache = cached_get_array;
- in->place_next_element_cache = cached_put_array;
- in->split = cache_block_split;
- in->rewind = cache_rewind;
- } else { /* if (s->format == list */
- /* TODO */
- }
- } else if (in->type == stream_randread) { /* data generation streams do not support dumping nor any cache I/O beyond initial data generation */
- if (s->format == array) {
- in->get_next_element_direct = gen_get_array;
- in->place_next_element_cache = cached_put_array;
- } else { /* if (s->format == list */
- in->get_next_element_direct = gen_get_list;
- in->place_next_element_cache = cached_put_list;
+ if (in->settings->access == cached) {
+ if (in->type == stream_randread) { /* data generation streams only support data generation and not much else */
+ if (s->format == array) {
+ in->get_next_element_direct = gen_get_array;
+ in->place_next_element_cache = cached_put_array;
+ } else { /* if (s->format == list */
+ in->get_next_element_direct = gen_get_list;
+ in->place_next_element_cache = cached_put_list;
+ }
+ } else {
+ if (s->format == array) {
+ in->get_next_element_cache = cached_get_array;
+ in->place_next_element_cache = cached_put_array;
+ in->split = cache_block_split;
+ in->rewind = cache_rewind;
+ } else { /* if (s->format == list */
+ in->get_next_element_cache = cached_get_list;
+ in->place_next_element_cache = cached_put_list;
+ in->split = cache_list_split;
+ in->rewind = cache_rewind;
+ }
}
} else {
- ret = EINVAL;
+ ret = ENOSYS;
}
return ret;