aboutsummaryrefslogtreecommitdiff
path: root/libgomp/work.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2019-11-13 12:38:09 +0000
committerAndrew Stubbs <ams@gcc.gnu.org>2019-11-13 12:38:09 +0000
commitcee1645106465bc593b4cf31716b0a8ddd59af61 (patch)
tree7509f5cbce6597d2c912531eb3324118262c88b0 /libgomp/work.c
parentfa4999953db61cf94c0e57a9ab8b006d950e54ca (diff)
downloadgcc-cee1645106465bc593b4cf31716b0a8ddd59af61.zip
gcc-cee1645106465bc593b4cf31716b0a8ddd59af61.tar.gz
gcc-cee1645106465bc593b4cf31716b0a8ddd59af61.tar.bz2
Optimize GCN OpenMP malloc performance
2019-11-13 Andrew Stubbs <ams@codesourcery.com> libgomp/ * config/gcn/team.c (gomp_gcn_enter_kernel): Set up the team arena and use team_malloc variants. (gomp_gcn_exit_kernel): Use team_free. * libgomp.h (TEAM_ARENA_SIZE): Define. (TEAM_ARENA_START): Define. (TEAM_ARENA_FREE): Define. (TEAM_ARENA_END): Define. (team_malloc): New function. (team_malloc_cleared): New function. (team_free): New function. * team.c (gomp_new_team): Initialize and use team_malloc. (free_team): Use team_free. (gomp_free_thread): Use team_free. (gomp_pause_host): Use team_free. * work.c (gomp_init_work_share): Use team_malloc. (gomp_fini_work_share): Use team_free. From-SVN: r278136
Diffstat (limited to 'libgomp/work.c')
-rw-r--r--libgomp/work.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgomp/work.c b/libgomp/work.c
index a589b8b..28bb0c1 100644
--- a/libgomp/work.c
+++ b/libgomp/work.c
@@ -120,7 +120,7 @@ gomp_init_work_share (struct gomp_work_share *ws, size_t ordered,
else
ordered = nthreads * sizeof (*ws->ordered_team_ids);
if (ordered > INLINE_ORDERED_TEAM_IDS_SIZE)
- ws->ordered_team_ids = gomp_malloc (ordered);
+ ws->ordered_team_ids = team_malloc (ordered);
else
ws->ordered_team_ids = ws->inline_ordered_team_ids;
memset (ws->ordered_team_ids, '\0', ordered);
@@ -142,7 +142,7 @@ gomp_fini_work_share (struct gomp_work_share *ws)
{
gomp_mutex_destroy (&ws->lock);
if (ws->ordered_team_ids != ws->inline_ordered_team_ids)
- free (ws->ordered_team_ids);
+ team_free (ws->ordered_team_ids);
gomp_ptrlock_destroy (&ws->next_ws);
}