@@ -1371,13 +1371,14 @@ static int CeedSingleOperatorAssembleSetup_Hip(CeedOperator op) {
1371
1371
CeedOperatorField * input_fields ;
1372
1372
CeedOperatorField * output_fields ;
1373
1373
ierr = CeedOperatorGetFields (op , & num_input_fields , & input_fields ,
1374
- & num_output_fields , & output_fields ); CeedChk (ierr );
1374
+ & num_output_fields , & output_fields ); CeedChkBackend (ierr );
1375
1375
1376
1376
// Determine active input basis eval mode
1377
1377
CeedQFunction qf ;
1378
- ierr = CeedOperatorGetQFunction (op , & qf ); CeedChk (ierr );
1378
+ ierr = CeedOperatorGetQFunction (op , & qf ); CeedChkBackend (ierr );
1379
1379
CeedQFunctionField * qf_fields ;
1380
- ierr = CeedQFunctionGetFields (qf , NULL , & qf_fields , NULL , NULL ); CeedChk (ierr );
1380
+ ierr = CeedQFunctionGetFields (qf , NULL , & qf_fields , NULL , NULL );
1381
+ CeedChkBackend (ierr );
1381
1382
// Note that the kernel will treat each dimension of a gradient action separately;
1382
1383
// i.e., when an active input has a CEED_EVAL_GRAD mode, num_emode_in will increment
1383
1384
// by dim. However, for the purposes of loading the B matrices, it will be treated
@@ -1386,24 +1387,25 @@ static int CeedSingleOperatorAssembleSetup_Hip(CeedOperator op) {
1386
1387
CeedInt num_emode_in = 0 , dim = 1 , num_B_in_mats_to_load = 0 , size_B_in = 0 ;
1387
1388
CeedEvalMode * eval_mode_in = NULL ; //will be of size num_B_in_mats_load
1388
1389
CeedBasis basis_in = NULL ;
1389
- CeedInt nqpts , esize ;
1390
+ CeedInt nqpts = 0 , esize = 0 ;
1390
1391
CeedElemRestriction rstr_in = NULL ;
1391
1392
for (CeedInt i = 0 ; i < num_input_fields ; i ++ ) {
1392
1393
CeedVector vec ;
1393
- ierr = CeedOperatorFieldGetVector (input_fields [i ], & vec ); CeedChk (ierr );
1394
+ ierr = CeedOperatorFieldGetVector (input_fields [i ], & vec ); CeedChkBackend (ierr );
1394
1395
if (vec == CEED_VECTOR_ACTIVE ) {
1395
1396
ierr = CeedOperatorFieldGetBasis (input_fields [i ], & basis_in );
1396
- CeedChk (ierr );
1397
- ierr = CeedBasisGetDimension (basis_in , & dim ); CeedChk (ierr );
1398
- ierr = CeedBasisGetNumQuadraturePoints (basis_in , & nqpts ); CeedChk (ierr );
1397
+ CeedChkBackend (ierr );
1398
+ ierr = CeedBasisGetDimension (basis_in , & dim ); CeedChkBackend (ierr );
1399
+ ierr = CeedBasisGetNumQuadraturePoints (basis_in , & nqpts ); CeedChkBackend (ierr );
1399
1400
ierr = CeedOperatorFieldGetElemRestriction (input_fields [i ], & rstr_in );
1400
- ierr = CeedElemRestrictionGetElementSize ( rstr_in , & esize ); CeedChk (ierr );
1401
- CeedChk (ierr );
1401
+ CeedChkBackend (ierr );
1402
+ ierr = CeedElemRestrictionGetElementSize ( rstr_in , & esize ); CeedChkBackend (ierr );
1402
1403
CeedEvalMode eval_mode ;
1403
1404
ierr = CeedQFunctionFieldGetEvalMode (qf_fields [i ], & eval_mode );
1404
- CeedChk (ierr );
1405
+ CeedChkBackend (ierr );
1405
1406
if (eval_mode != CEED_EVAL_NONE ) {
1406
- ierr = CeedRealloc (num_B_in_mats_to_load + 1 , & eval_mode_in ); CeedChk (ierr );
1407
+ ierr = CeedRealloc (num_B_in_mats_to_load + 1 , & eval_mode_in );
1408
+ CeedChkBackend (ierr );
1407
1409
eval_mode_in [num_B_in_mats_to_load ] = eval_mode ;
1408
1410
num_B_in_mats_to_load += 1 ;
1409
1411
if (eval_mode == CEED_EVAL_GRAD ) {
@@ -1418,29 +1420,31 @@ static int CeedSingleOperatorAssembleSetup_Hip(CeedOperator op) {
1418
1420
}
1419
1421
1420
1422
// Determine active output basis; basis_out and rstr_out only used if same as input, TODO
1421
- ierr = CeedQFunctionGetFields (qf , NULL , NULL , NULL , & qf_fields ); CeedChk (ierr );
1423
+ ierr = CeedQFunctionGetFields (qf , NULL , NULL , NULL , & qf_fields );
1424
+ CeedChkBackend (ierr );
1422
1425
CeedInt num_emode_out = 0 , num_B_out_mats_to_load = 0 , size_B_out = 0 ;
1423
1426
CeedEvalMode * eval_mode_out = NULL ;
1424
1427
CeedBasis basis_out = NULL ;
1425
1428
CeedElemRestriction rstr_out = NULL ;
1426
1429
for (CeedInt i = 0 ; i < num_output_fields ; i ++ ) {
1427
1430
CeedVector vec ;
1428
- ierr = CeedOperatorFieldGetVector (output_fields [i ], & vec ); CeedChk (ierr );
1431
+ ierr = CeedOperatorFieldGetVector (output_fields [i ], & vec ); CeedChkBackend (ierr );
1429
1432
if (vec == CEED_VECTOR_ACTIVE ) {
1430
1433
ierr = CeedOperatorFieldGetBasis (output_fields [i ], & basis_out );
1431
- CeedChk (ierr );
1434
+ CeedChkBackend (ierr );
1432
1435
ierr = CeedOperatorFieldGetElemRestriction (output_fields [i ], & rstr_out );
1433
- CeedChk (ierr );
1436
+ CeedChkBackend (ierr );
1434
1437
if (rstr_out && rstr_out != rstr_in )
1435
1438
// LCOV_EXCL_START
1436
1439
return CeedError (ceed , CEED_ERROR_BACKEND ,
1437
1440
"Multi-field non-composite operator assembly not supported" );
1438
1441
// LCOV_EXCL_STOP
1439
1442
CeedEvalMode eval_mode ;
1440
1443
ierr = CeedQFunctionFieldGetEvalMode (qf_fields [i ], & eval_mode );
1441
- CeedChk (ierr );
1444
+ CeedChkBackend (ierr );
1442
1445
if (eval_mode != CEED_EVAL_NONE ) {
1443
- ierr = CeedRealloc (num_B_out_mats_to_load + 1 , & eval_mode_out ); CeedChk (ierr );
1446
+ ierr = CeedRealloc (num_B_out_mats_to_load + 1 , & eval_mode_out );
1447
+ CeedChkBackend (ierr );
1444
1448
eval_mode_out [num_B_out_mats_to_load ] = eval_mode ;
1445
1449
num_B_out_mats_to_load += 1 ;
1446
1450
if (eval_mode == CEED_EVAL_GRAD ) {
@@ -1461,8 +1465,9 @@ static int CeedSingleOperatorAssembleSetup_Hip(CeedOperator op) {
1461
1465
// LCOV_EXCL_STOP
1462
1466
1463
1467
CeedInt nelem , ncomp ;
1464
- ierr = CeedElemRestrictionGetNumElements (rstr_in , & nelem ); CeedChk (ierr );
1465
- ierr = CeedElemRestrictionGetNumComponents (rstr_in , & ncomp ); CeedChk (ierr );
1468
+ ierr = CeedElemRestrictionGetNumElements (rstr_in , & nelem ); CeedChkBackend (ierr );
1469
+ ierr = CeedElemRestrictionGetNumComponents (rstr_in , & ncomp );
1470
+ CeedChkBackend (ierr );
1466
1471
1467
1472
ierr = CeedCalloc (1 , & impl -> asmb ); CeedChkBackend (ierr );
1468
1473
CeedOperatorAssemble_Hip * asmb = impl -> asmb ;
@@ -1573,13 +1578,14 @@ static int CeedSingleOperatorAssemble_Hip(CeedOperator op, CeedInt offset,
1573
1578
if (!impl -> asmb ) {
1574
1579
ierr = CeedSingleOperatorAssembleSetup_Hip (op );
1575
1580
CeedChkBackend (ierr );
1581
+ assert (impl -> asmb != NULL );
1576
1582
}
1577
1583
1578
1584
// Assemble QFunction
1579
1585
CeedVector assembled_qf ;
1580
1586
CeedElemRestriction rstr_q ;
1581
1587
ierr = CeedOperatorLinearAssembleQFunctionBuildOrUpdate (
1582
- op , & assembled_qf , & rstr_q , CEED_REQUEST_IMMEDIATE ); CeedChk (ierr );
1588
+ op , & assembled_qf , & rstr_q , CEED_REQUEST_IMMEDIATE ); CeedChkBackend (ierr );
1583
1589
ierr = CeedElemRestrictionDestroy (& rstr_q ); CeedChkBackend (ierr );
1584
1590
CeedScalar * values_array ;
1585
1591
ierr = CeedVectorGetArrayWrite (values , CEED_MEM_DEVICE , & values_array );
@@ -1590,7 +1596,7 @@ static int CeedSingleOperatorAssemble_Hip(CeedOperator op, CeedInt offset,
1590
1596
CeedChkBackend (ierr );
1591
1597
1592
1598
// Compute B^T D B
1593
- const CeedInt nelem = impl -> asmb -> nelem ;
1599
+ const CeedInt nelem = impl -> asmb -> nelem ; // to satisfy clang-tidy
1594
1600
const CeedInt elemsPerBlock = impl -> asmb -> elemsPerBlock ;
1595
1601
const CeedInt grid = nelem /elemsPerBlock + ((
1596
1602
nelem /elemsPerBlock * elemsPerBlock < nelem )?1 :0 );
@@ -1629,29 +1635,31 @@ int CeedOperatorLinearAssemble_Hip(CeedOperator op, CeedVector values) {
1629
1635
// for composite operators, or call single operator assembly otherwise
1630
1636
bool is_composite ;
1631
1637
CeedInt ierr ;
1632
- ierr = CeedOperatorIsComposite (op , & is_composite ); CeedChk (ierr );
1638
+ ierr = CeedOperatorIsComposite (op , & is_composite ); CeedChkBackend (ierr );
1633
1639
1634
1640
CeedElemRestriction rstr ;
1635
1641
CeedInt num_elem , elem_size , num_comp ;
1636
1642
1637
1643
CeedInt offset = 0 ;
1638
1644
if (is_composite ) {
1639
1645
CeedInt num_suboperators ;
1640
- ierr = CeedOperatorGetNumSub (op , & num_suboperators ); CeedChk (ierr );
1646
+ ierr = CeedOperatorGetNumSub (op , & num_suboperators ); CeedChkBackend (ierr );
1641
1647
CeedOperator * sub_operators ;
1642
- ierr = CeedOperatorGetSubList (op , & sub_operators ); CeedChk (ierr );
1648
+ ierr = CeedOperatorGetSubList (op , & sub_operators ); CeedChkBackend (ierr );
1643
1649
for (int k = 0 ; k < num_suboperators ; ++ k ) {
1644
1650
ierr = CeedSingleOperatorAssemble_Hip (sub_operators [k ], offset , values );
1645
- CeedChk (ierr );
1651
+ CeedChkBackend (ierr );
1646
1652
ierr = CeedOperatorGetActiveElemRestriction (sub_operators [k ], & rstr );
1647
- CeedChk (ierr );
1648
- ierr = CeedElemRestrictionGetNumElements (rstr , & num_elem ); CeedChk (ierr );
1649
- ierr = CeedElemRestrictionGetElementSize (rstr , & elem_size ); CeedChk (ierr );
1650
- ierr = CeedElemRestrictionGetNumComponents (rstr , & num_comp ); CeedChk (ierr );
1653
+ CeedChkBackend (ierr );
1654
+ ierr = CeedElemRestrictionGetNumElements (rstr , & num_elem ); CeedChkBackend (ierr );
1655
+ ierr = CeedElemRestrictionGetElementSize (rstr , & elem_size );
1656
+ CeedChkBackend (ierr );
1657
+ ierr = CeedElemRestrictionGetNumComponents (rstr , & num_comp );
1658
+ CeedChkBackend (ierr );
1651
1659
offset += elem_size * num_comp * elem_size * num_comp * num_elem ;
1652
1660
}
1653
1661
} else {
1654
- ierr = CeedSingleOperatorAssemble_Hip (op , offset , values ); CeedChk (ierr );
1662
+ ierr = CeedSingleOperatorAssemble_Hip (op , offset , values ); CeedChkBackend (ierr );
1655
1663
}
1656
1664
1657
1665
return CEED_ERROR_SUCCESS ;
0 commit comments