xref: /libCEED/backends/opt/ceed-opt.h (revision d275d636ccaa61e594421fac80252590e7a77ccf)
1 // Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 #pragma once
8 
9 #include <ceed.h>
10 #include <ceed/backend.h>
11 #include <stdbool.h>
12 #include <stdint.h>
13 
14 typedef struct {
15   CeedInt block_size;
16 } Ceed_Opt;
17 
18 typedef struct {
19   CeedScalar *colo_grad_1d;
20 } CeedBasis_Opt;
21 
22 typedef struct {
23   bool                 is_identity_qf, is_identity_rstr_op;
24   bool                *skip_rstr_in, *skip_rstr_out, *apply_add_basis_out;
25   CeedElemRestriction *block_rstr;   /* Blocked versions of restrictions */
26   CeedVector          *e_vecs_full;  /* Full E-vectors, inputs followed by outputs */
27   uint64_t            *input_states; /* State counter of inputs */
28   CeedVector          *e_vecs_in;    /* Element block input E-vectors  */
29   CeedVector          *e_vecs_out;   /* Element block output E-vectors */
30   CeedVector          *q_vecs_in;    /* Element block input Q-vectors  */
31   CeedVector          *q_vecs_out;   /* Element block output Q-vectors */
32   CeedInt              num_inputs, num_outputs;
33   CeedInt              qf_size_in, qf_size_out;
34   CeedVector           qf_l_vec;
35   CeedElemRestriction  qf_block_rstr;
36 } CeedOperator_Opt;
37 
38 CEED_INTERN int CeedTensorContractCreate_Opt(CeedTensorContract contract);
39 
40 CEED_INTERN int CeedOperatorCreate_Opt(CeedOperator op);
41