xref: /libCEED/rust/libceed-sys/c-src/backends/hip-gen/ceed-hip-gen.h (revision d4cc18453651bd0f94c1a2e078b2646a92dafdcc)
1*9ba83ac0SJeremy L Thompson // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
37d8d0e25Snbeams //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
57d8d0e25Snbeams //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
7509d4af6SJeremy L Thompson #pragma once
83d576824SJeremy L Thompson 
949aac155SJeremy L Thompson #include <ceed.h>
10ec3da8bcSJed Brown #include <ceed/backend.h>
1149aac155SJeremy L Thompson #include <ceed/jit-source/hip/hip-types.h>
123d576824SJeremy L Thompson #include <hip/hip_runtime.h>
132b730f8bSJeremy L Thompson 
147d8d0e25Snbeams typedef struct {
150183ed61SJeremy L Thompson   bool          use_fallback, use_assembly_fallback;
167d8d0e25Snbeams   CeedInt       dim;
1774398b5aSJeremy L Thompson   CeedInt       Q, Q_1d;
189e201c85SYohann   CeedInt       max_P_1d;
19a61b1c91SJeremy L Thompson   CeedInt       thread_1d;
206eee1ffcSZach Atkins   hipStream_t   streams[CEED_COMPOSITE_MAX];
215daefc96SJeremy L Thompson   hipModule_t   module, module_assemble_full, module_assemble_diagonal, module_assemble_qfunction;
225daefc96SJeremy L Thompson   hipFunction_t op, assemble_full, assemble_diagonal, assemble_qfunction;
239e201c85SYohann   FieldsInt_Hip indices;
249e201c85SYohann   Fields_Hip    fields;
259e201c85SYohann   Fields_Hip    B;
269e201c85SYohann   Fields_Hip    G;
277d8d0e25Snbeams   CeedScalar   *W;
283a2968d6SJeremy L Thompson   Points_Hip    points;
297d8d0e25Snbeams } CeedOperator_Hip_gen;
307d8d0e25Snbeams 
317d8d0e25Snbeams typedef struct {
3209095acaSJeremy L Thompson   const char *qfunction_name;
337d8d0e25Snbeams   void       *d_c;
347d8d0e25Snbeams } CeedQFunction_Hip_gen;
357d8d0e25Snbeams 
367d8d0e25Snbeams CEED_INTERN int CeedQFunctionCreate_Hip_gen(CeedQFunction qf);
377d8d0e25Snbeams 
387d8d0e25Snbeams CEED_INTERN int CeedOperatorCreate_Hip_gen(CeedOperator op);
39