xref: /libCEED/rust/libceed-sys/c-src/backends/opt/ceed-opt.h (revision edb2538e3dd6743c029967fc4e89c6fcafedb8c2)
13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, 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.
389c6efa4Sjeremylt //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
589c6efa4Sjeremylt //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
789c6efa4Sjeremylt 
894b7b29bSJeremy L Thompson #ifndef CEED_OPT_H
994b7b29bSJeremy L Thompson #define CEED_OPT_H
103d576824SJeremy L Thompson 
1149aac155SJeremy L Thompson #include <ceed.h>
12ec3da8bcSJed Brown #include <ceed/backend.h>
133d576824SJeremy L Thompson #include <stdbool.h>
143d576824SJeremy L Thompson #include <stdint.h>
1589c6efa4Sjeremylt 
1689c6efa4Sjeremylt typedef struct {
17ad70ee2cSJeremy L Thompson   CeedInt block_size;
1889c6efa4Sjeremylt } Ceed_Opt;
1989c6efa4Sjeremylt 
2089c6efa4Sjeremylt typedef struct {
21d1d35e2fSjeremylt   CeedScalar *colo_grad_1d;
2289c6efa4Sjeremylt } CeedBasis_Opt;
2389c6efa4Sjeremylt 
2489c6efa4Sjeremylt typedef struct {
25*edb2538eSJeremy L Thompson   bool                 is_identity_qf, is_identity_rstr_op;
26*edb2538eSJeremy L Thompson   CeedElemRestriction *block_rstr;   /* Blocked versions of restrictions */
274fc1f125SJeremy L Thompson   CeedVector          *e_vecs_full;  /* Full E-vectors, inputs followed by outputs */
284fc1f125SJeremy L Thompson   uint64_t            *input_states; /* State counter of inputs */
294fc1f125SJeremy L Thompson   CeedVector          *e_vecs_in;    /* Element block input E-vectors  */
304fc1f125SJeremy L Thompson   CeedVector          *e_vecs_out;   /* Element block output E-vectors */
314fc1f125SJeremy L Thompson   CeedVector          *q_vecs_in;    /* Element block input Q-vectors  */
324fc1f125SJeremy L Thompson   CeedVector          *q_vecs_out;   /* Element block output Q-vectors */
334fc1f125SJeremy L Thompson   CeedInt              num_inputs, num_outputs;
344fc1f125SJeremy L Thompson   CeedInt              num_active_in, num_active_out;
35bb219a0fSJeremy L Thompson   CeedVector          *qf_active_in;
364fc1f125SJeremy L Thompson   CeedVector           qf_l_vec;
37ad70ee2cSJeremy L Thompson   CeedElemRestriction  qf_block_rstr;
3889c6efa4Sjeremylt } CeedOperator_Opt;
3989c6efa4Sjeremylt 
402b730f8bSJeremy L Thompson CEED_INTERN int CeedTensorContractCreate_Opt(CeedBasis basis, CeedTensorContract contract);
414548da4eSSebastian Grimberg 
4289c6efa4Sjeremylt CEED_INTERN int CeedOperatorCreate_Opt(CeedOperator op);
433d576824SJeremy L Thompson 
4494b7b29bSJeremy L Thompson #endif  // CEED_OPT_H
45