From 85efa5f57dd818a9b009e00550fc7ccadb2e8ea8 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 11 Apr 2013 18:25:30 +0200 Subject: [PATCH] fix handling of --no-private-memory and --no-shared-memory Support for these flags was broken in 5da0148 (gpu.c: compute private tile during array reference grouping, Sat Dec 15 15:46:13 2012 +0100). In particular, since then the --no-private-memory and --no-shared-memory options were only respected if both of them were specified. Also handle the options individually. Reported-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- gpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gpu.c b/gpu.c index 4a2a9fc..272d745 100644 --- a/gpu.c +++ b/gpu.c @@ -2532,9 +2532,10 @@ static void compute_group_bounds_core(struct gpu_gen *gen, int n_index = group->array->n_index; int no_reuse; isl_map *acc; + int use_shared = gen->options->use_shared_memory; + int use_private = gen->options->use_private_memory; - if (!gen->options->use_shared_memory && - !gen->options->use_private_memory) + if (!use_shared && !use_private) return; if (gpu_array_is_read_only_scalar(group->array)) return; @@ -2542,13 +2543,13 @@ static void compute_group_bounds_core(struct gpu_gen *gen, access = group_access_relation(group, 1, 1); no_reuse = isl_union_map_is_injective(access); - if (!no_reuse || !access_is_coalesced(gen, access)) { + if (use_shared && (!no_reuse || !access_is_coalesced(gen, access))) { group->shared_tile = create_tile(ctx, group->array->n_index); if (!can_tile(group->access, group->shared_tile)) group->shared_tile = free_tile(group->shared_tile); } - if (no_reuse) { + if (!use_private || no_reuse) { isl_union_map_free(access); return; } -- 2.11.4.GIT