aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2024-06-11 17:05:04 +0300
committerGitHub <noreply@github.com>2024-06-11 17:05:04 +0300
commit2eb60e2de812187839954d2ce35e1479817631db (patch)
tree3dcb44842346858cd53335201980cbb6121d3870
parent37e9bf9d151ec088685eb7f08c5124981eb5a82d (diff)
downloadllvm-2eb60e2de812187839954d2ce35e1479817631db.zip
llvm-2eb60e2de812187839954d2ce35e1479817631db.tar.gz
llvm-2eb60e2de812187839954d2ce35e1479817631db.tar.bz2
[Offload][NFCI] Initialize the KernelArgsTy to default values (#95117)
Co-authored-by: Joseph Huber <huberjn@outlook.com>
-rw-r--r--offload/include/Shared/APITypes.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/offload/include/Shared/APITypes.h b/offload/include/Shared/APITypes.h
index e8fc277..a84b685 100644
--- a/offload/include/Shared/APITypes.h
+++ b/offload/include/Shared/APITypes.h
@@ -89,22 +89,26 @@ struct __tgt_async_info {
/// This struct contains all of the arguments to a target kernel region launch.
struct KernelArgsTy {
- uint32_t Version; // Version of this struct for ABI compatibility.
- uint32_t NumArgs; // Number of arguments in each input pointer.
- void **ArgBasePtrs; // Base pointer of each argument (e.g. a struct).
- void **ArgPtrs; // Pointer to the argument data.
- int64_t *ArgSizes; // Size of the argument data in bytes.
- int64_t *ArgTypes; // Type of the data (e.g. to / from).
- void **ArgNames; // Name of the data for debugging, possibly null.
- void **ArgMappers; // User-defined mappers, possibly null.
- uint64_t Tripcount; // Tripcount for the teams / distribute loop, 0 otherwise.
+ uint32_t Version = 0; // Version of this struct for ABI compatibility.
+ uint32_t NumArgs = 0; // Number of arguments in each input pointer.
+ void **ArgBasePtrs =
+ nullptr; // Base pointer of each argument (e.g. a struct).
+ void **ArgPtrs = nullptr; // Pointer to the argument data.
+ int64_t *ArgSizes = nullptr; // Size of the argument data in bytes.
+ int64_t *ArgTypes = nullptr; // Type of the data (e.g. to / from).
+ void **ArgNames = nullptr; // Name of the data for debugging, possibly null.
+ void **ArgMappers = nullptr; // User-defined mappers, possibly null.
+ uint64_t Tripcount =
+ 0; // Tripcount for the teams / distribute loop, 0 otherwise.
struct {
uint64_t NoWait : 1; // Was this kernel spawned with a `nowait` clause.
uint64_t Unused : 63;
- } Flags;
- uint32_t NumTeams[3]; // The number of teams (for x,y,z dimension).
- uint32_t ThreadLimit[3]; // The number of threads (for x,y,z dimension).
- uint32_t DynCGroupMem; // Amount of dynamic cgroup memory requested.
+ } Flags = {0, 0};
+ // The number of teams (for x,y,z dimension).
+ uint32_t NumTeams[3] = {0, 0, 0};
+ // The number of threads (for x,y,z dimension).
+ uint32_t ThreadLimit[3] = {0, 0, 0};
+ uint32_t DynCGroupMem = 0; // Amount of dynamic cgroup memory requested.
};
static_assert(sizeof(KernelArgsTy().Flags) == sizeof(uint64_t),
"Invalid struct size");