This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[HSA] libgomp and hsa-gen.c header file refactoring
- From: Martin LiÅka <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Nov 2015 11:14:50 +0100
- Subject: [HSA] libgomp and hsa-gen.c header file refactoring
- Authentication-results: sourceware.org; auth=none
Hello.
Following patch moves content of hsa-traits.h to gomp-constants.h.
Martin
>From 40179af53541cf3318f8710ac23b9908b90353e8 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 26 Oct 2015 11:49:02 +0100
Subject: [PATCH] HSA: move content of hsa-traits.h to gomp-constants.h
include/ChangeLog:
2015-10-26 Martin Liska <mliska@suse.cz>
* gomp-constants.h (struct hsa_kernel_dispatch): New structure.
gcc/ChangeLog:
2015-10-26 Martin Liska <mliska@suse.cz>
* hsa-gen.c (struct hsa_kernel_dispatch): Remove the
declaration.
libgomp/ChangeLog:
2015-10-26 Martin Liska <mliska@suse.cz>
* hsa-traits.h: Remove.
* plugin/plugin-hsa.c: Include gomp-constants.h.
---
gcc/hsa-gen.c | 30 +------------------------
include/gomp-constants.h | 31 ++++++++++++++++++++++++++
libgomp/hsa-traits.h | 54 ---------------------------------------------
libgomp/plugin/plugin-hsa.c | 1 -
4 files changed, 32 insertions(+), 84 deletions(-)
delete mode 100644 libgomp/hsa-traits.h
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index c36c9e0..ec5cd81 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -78,6 +78,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfganal.h"
#include "builtins.h"
#include "params.h"
+#include "gomp-constants.h"
/* Print a warning message and set that we have seen an error. */
@@ -112,35 +113,6 @@ along with GCC; see the file COPYING3. If not see
/* Following structures are defined in the final version
of HSA specification. */
-/* HSA kernel dispatch is collection of informations needed for
- a kernel dispatch. */
-
-struct hsa_kernel_dispatch
-{
- /* Pointer to a command queue associated with a kernel dispatch agent. */
- void *queue;
- /* Pointer to reserved memory for OMP data struct copying. */
- void *omp_data_memory;
- /* Pointer to a memory space used for kernel arguments passing. */
- void *kernarg_address;
- /* Kernel object. */
- uint64_t object;
- /* Synchronization signal used for dispatch synchronization. */
- uint64_t signal;
- /* Private segment size. */
- uint32_t private_segment_size;
- /* Group segment size. */
- uint32_t group_segment_size;
- /* Number of children kernel dispatches. */
- uint64_t kernel_dispatch_count;
- /* Number of threads. */
- uint32_t omp_num_threads;
- /* Debug purpose argument. */
- uint64_t debug;
- /* Kernel dispatch structures created for children kernel dispatches. */
- struct hsa_kernel_dispatch **children_dispatches;
-};
-
/* HSA queue packet is shadow structure, originally provided by AMD. */
struct hsa_queue_packet
diff --git a/include/gomp-constants.h b/include/gomp-constants.h
index 228d933..839081b 100644
--- a/include/gomp-constants.h
+++ b/include/gomp-constants.h
@@ -144,4 +144,35 @@ enum gomp_map_kind
#define GOMP_LAUNCH_OP(X) (((X) >> GOMP_LAUNCH_OP_SHIFT) & 0xffff)
#define GOMP_LAUNCH_OP_MAX 0xffff
+/* HSA specific data structures. */
+
+/* HSA kernel dispatch is collection of informations needed for
+ a kernel dispatch. */
+
+struct hsa_kernel_dispatch
+{
+ /* Pointer to a command queue associated with a kernel dispatch agent. */
+ void *queue;
+ /* Pointer to reserved memory for OMP data struct copying. */
+ void *omp_data_memory;
+ /* Pointer to a memory space used for kernel arguments passing. */
+ void *kernarg_address;
+ /* Kernel object. */
+ uint64_t object;
+ /* Synchronization signal used for dispatch synchronization. */
+ uint64_t signal;
+ /* Private segment size. */
+ uint32_t private_segment_size;
+ /* Group segment size. */
+ uint32_t group_segment_size;
+ /* Number of children kernel dispatches. */
+ uint64_t kernel_dispatch_count;
+ /* Number of threads. */
+ uint32_t omp_num_threads;
+ /* Debug purpose argument. */
+ uint64_t debug;
+ /* Kernel dispatch structures created for children kernel dispatches. */
+ struct hsa_kernel_dispatch **children_dispatches;
+};
+
#endif
diff --git a/libgomp/hsa-traits.h b/libgomp/hsa-traits.h
deleted file mode 100644
index 6fb7e48..0000000
--- a/libgomp/hsa-traits.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* HSA traits.
- Copyright (C) 2015 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-////////////////////////////////////////////////////////////////////////////////
-
-#ifndef HSA_TRAITS_H_
-#define HSA_TRAITS_H_
-
-/* HSA kernel dispatch is collection of informations needed for
- a kernel dispatch. */
-
-struct hsa_kernel_dispatch
-{
- /* Pointer to a command queue associated with a kernel dispatch agent. */
- void *queue;
- /* Pointer to reserved memory for OMP data struct copying. */
- void *omp_data_memory;
- /* Pointer to a memory space used for kernel arguments passing. */
- void *kernarg_address;
- /* Kernel object. */
- uint64_t object;
- /* Synchronization signal used for dispatch synchronization. */
- uint64_t signal;
- /* Private segment size. */
- uint32_t private_segment_size;
- /* Group segment size. */
- uint32_t group_segment_size;
- /* Number of children kernel dispatches. */
- uint64_t kernel_dispatch_count;
- /* Number of threads. */
- uint32_t omp_num_threads;
- /* Debug purpose argument. */
- uint64_t debug;
- /* Kernel dispatch structures created for children kernel dispatches. */
- struct hsa_kernel_dispatch **children_dispatches;
-};
-
-#endif // HSA_TRAITS_H_
diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c
index 45dfe9b..ea3e5eb 100644
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -5,7 +5,6 @@
#include "libgomp-plugin.h"
#include "gomp-constants.h"
#include "hsa.h"
-#include "hsa-traits.h"
#include "hsa_ext_finalize.h"
#include "dlfcn.h"
--
2.6.2