Skip to content

Commit

Permalink
minor - reduce LCOV_EXCL markers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Jan 30, 2024
1 parent cce69b9 commit ec27d2c
Show file tree
Hide file tree
Showing 30 changed files with 108 additions and 198 deletions.
1 change: 1 addition & 0 deletions backends/blocked/ceed-blocked-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ static inline int CeedOperatorOutputBasis_Blocked(CeedInt e, CeedInt Q, CeedQFun
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
// LCOV_EXCL_STOP
Expand Down
25 changes: 17 additions & 8 deletions backends/cuda-gen/ceed-cuda-gen-operator-build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,14 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
}
code << "\n // -- Element loop --\n";
Expand Down Expand Up @@ -654,15 +658,20 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
// TODO put in a function
// Restriction
Expand Down
7 changes: 1 addition & 6 deletions backends/cuda-ref/ceed-cuda-ref-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@ int CeedBasisApply_Cuda(CeedBasis basis, const CeedInt num_elem, CeedTransposeMo
CeedCallBackend(CeedRunKernelDim_Cuda(ceed, data->Weight, num_elem, block_size_x, block_size_y, 1, weight_args));
} break;
// LCOV_EXCL_START
// Evaluate the divergence to/from the quadrature points
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
// Evaluate the curl to/from the quadrature points
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
// Take no action, BasisApply should not have been called
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down Expand Up @@ -168,7 +164,6 @@ int CeedBasisApplyNonTensor_Cuda(CeedBasis basis, const CeedInt num_elem, CeedTr
CeedCallBackend(CeedRunKernelDim_Cuda(ceed, data->Weight, grid, num_qpts, 1, elems_per_block, weight_args));
} break;
// LCOV_EXCL_START
// Take no action, BasisApply should not have been called
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down
6 changes: 1 addition & 5 deletions backends/cuda-shared/ceed-cuda-shared-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,9 @@ int CeedBasisApplyTensor_Cuda_shared(CeedBasis basis, const CeedInt num_elem, Ce
}
} break;
// LCOV_EXCL_START
// Evaluate the divergence to/from the quadrature points
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
// Evaluate the curl to/from the quadrature points
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
// Take no action, BasisApply should not have been called
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down
25 changes: 17 additions & 8 deletions backends/hip-gen/ceed-hip-gen-operator-build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,20 @@ extern "C" int CeedOperatorBuildKernel_Hip_gen(CeedOperator op) {
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
}
code << "\n // -- Element loop --\n";
Expand Down Expand Up @@ -668,10 +673,14 @@ extern "C" int CeedOperatorBuildKernel_Hip_gen(CeedOperator op) {
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
// TODO put in a function
// Restriction
Expand Down
7 changes: 1 addition & 6 deletions backends/hip-ref/ceed-hip-ref-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ int CeedBasisApply_Hip(CeedBasis basis, const CeedInt num_elem, CeedTransposeMod
CeedCallBackend(CeedRunKernelDim_Hip(ceed, data->Weight, num_elem, block_size_x, block_size_y, 1, weight_args));
} break;
// LCOV_EXCL_START
// Evaluate the divergence to/from the quadrature points
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
// Evaluate the curl to/from the quadrature points
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
// Take no action, BasisApply should not have been called
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down Expand Up @@ -167,7 +163,6 @@ int CeedBasisApplyNonTensor_Hip(CeedBasis basis, const CeedInt num_elem, CeedTra
CeedCallBackend(CeedRunKernelDim_Hip(ceed, data->Weight, grid, num_qpts, 1, elems_per_block, weight_args));
} break;
// LCOV_EXCL_START
// Take no action, BasisApply should not have been called
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down
6 changes: 1 addition & 5 deletions backends/hip-shared/ceed-hip-shared-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,9 @@ int CeedBasisApplyTensor_Hip_shared(CeedBasis basis, const CeedInt num_elem, Cee
}
} break;
// LCOV_EXCL_START
// Evaluate the divergence to/from the quadrature points
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
// Evaluate the curl to/from the quadrature points
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
// Take no action, BasisApply should not have been called
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down
6 changes: 2 additions & 4 deletions backends/magma/ceed-magma-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ static int CeedBasisApply_Magma(CeedBasis basis, CeedInt num_elem, CeedTranspose
} break;
// LCOV_EXCL_START
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[e_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down Expand Up @@ -365,9 +364,8 @@ static int CeedBasisApplyNonTensor_Magma(CeedBasis basis, CeedInt num_elem, Ceed
break;
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT does not make sense in this context");
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
return CeedError(ceed, CEED_ERROR_BACKEND, "%s does not make sense in this context", CeedEvalModes[e_mode]);
// LCOV_EXCL_STOP
}
CeedCallBackend(CeedBasisGetNumQuadratureComponents(basis, e_mode, &q_comp));
Expand Down
13 changes: 2 additions & 11 deletions backends/memcheck/ceed-memcheck-qfunctioncontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,8 @@ static int CeedQFunctionContextHasBorrowedDataOfType_Memcheck(CeedQFunctionConte

CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, (void *)&impl));
CeedCallBackend(CeedQFunctionContextGetCeed(ctx, &ceed));

switch (mem_type) {
case CEED_MEM_HOST:
*has_borrowed_data_of_type = impl->data_borrowed;
break;
// LCOV_EXCL_START
default:
return CeedError(ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
// LCOV_EXCL_STOP
break;
}
CeedCheck(mem_type == CEED_MEM_HOST, ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
*has_borrowed_data_of_type = impl->data_borrowed;
return CEED_ERROR_SUCCESS;
}

Expand Down
13 changes: 2 additions & 11 deletions backends/memcheck/ceed-memcheck-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,8 @@ static inline int CeedVectorHasBorrowedArrayOfType_Memcheck(const CeedVector vec

CeedCallBackend(CeedVectorGetData(vec, &impl));
CeedCallBackend(CeedVectorGetCeed(vec, &ceed));

switch (mem_type) {
case CEED_MEM_HOST:
*has_borrowed_array_of_type = impl->array_borrowed;
break;
// LCOV_EXCL_START
default:
return CeedError(ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
// LCOV_EXCL_STOP
break;
}
CeedCheck(mem_type == CEED_MEM_HOST, ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
*has_borrowed_array_of_type = impl->array_borrowed;
return CEED_ERROR_SUCCESS;
}

Expand Down
1 change: 1 addition & 0 deletions backends/opt/ceed-opt-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ static inline int CeedOperatorOutputBasis_Opt(CeedInt e, CeedInt Q, CeedQFunctio
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
// LCOV_EXCL_STOP
Expand Down
7 changes: 1 addition & 6 deletions backends/ref/ceed-ref-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,9 @@ static int CeedBasisApply_Ref(CeedBasis basis, CeedInt num_elem, CeedTransposeMo
}
} break;
// LCOV_EXCL_START
// Evaluate the divergence to/from the quadrature points
case CEED_EVAL_DIV:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_DIV not supported");
// Evaluate the curl to/from the quadrature points
case CEED_EVAL_CURL:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_CURL not supported");
// Take no action, BasisApply should not have been called
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down Expand Up @@ -241,7 +237,6 @@ static int CeedBasisApply_Ref(CeedBasis basis, CeedInt num_elem, CeedTransposeMo
}
} break;
// LCOV_EXCL_START
// Take no action, BasisApply should not have been called
case CEED_EVAL_NONE:
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_NONE does not make sense in this context");
// LCOV_EXCL_STOP
Expand Down
1 change: 1 addition & 0 deletions backends/ref/ceed-ref-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ static inline int CeedOperatorOutputBasisAtPoints_Ref(CeedInt e, CeedInt num_poi
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
// LCOV_EXCL_STOP
Expand Down
12 changes: 2 additions & 10 deletions backends/ref/ceed-ref-qfunctioncontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,8 @@ static int CeedQFunctionContextHasBorrowedDataOfType_Ref(CeedQFunctionContext ct

CeedCallBackend(CeedQFunctionContextGetBackendData(ctx, (void *)&impl));
CeedCallBackend(CeedQFunctionContextGetCeed(ctx, &ceed));
switch (mem_type) {
case CEED_MEM_HOST:
*has_borrowed_data_of_type = impl->data_borrowed;
break;
// LCOV_EXCL_START
default:
return CeedError(ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
// LCOV_EXCL_STOP
break;
}
CeedCheck(mem_type == CEED_MEM_HOST, ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
*has_borrowed_data_of_type = impl->data_borrowed;
return CEED_ERROR_SUCCESS;
}

Expand Down
13 changes: 2 additions & 11 deletions backends/ref/ceed-ref-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,8 @@ static inline int CeedVectorHasBorrowedArrayOfType_Ref(const CeedVector vec, Cee

CeedCallBackend(CeedVectorGetData(vec, &impl));
CeedCallBackend(CeedVectorGetCeed(vec, &ceed));

switch (mem_type) {
case CEED_MEM_HOST:
*has_borrowed_array_of_type = impl->array_borrowed;
break;
// LCOV_EXCL_START
default:
return CeedError(ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
// LCOV_EXCL_STOP
break;
}
CeedCheck(mem_type == CEED_MEM_HOST, ceed, CEED_ERROR_BACKEND, "Can only set HOST memory for this backend");
*has_borrowed_array_of_type = impl->array_borrowed;
return CEED_ERROR_SUCCESS;
}

Expand Down
33 changes: 20 additions & 13 deletions backends/sycl-gen/ceed-sycl-gen-operator-build.sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,8 @@ extern "C" int CeedOperatorBuildKernel_Sycl_gen(CeedOperator op) {

CeedCallBackend(CeedQFunctionFieldGetEvalMode(qf_input_fields[0], &eval_mode_in));
CeedCallBackend(CeedQFunctionFieldGetEvalMode(qf_output_fields[0], &eval_mode_out));
if (eval_mode_in == CEED_EVAL_NONE && eval_mode_out == CEED_EVAL_NONE) {
// LCOV_EXCL_START
return CeedError(ceed, CEED_ERROR_BACKEND, "Backend does not implement restriction only identity operators");
// LCOV_EXCL_STOP
}
CeedCheck(eval_mode_in != CEED_EVAL_NONE || eval_mode_out != CEED_EVAL_NONE, ceed, CEED_ERROR_BACKEND,
"Backend does not implement restriction only identity operators");
}

std::ostringstream code;
Expand Down Expand Up @@ -374,15 +371,20 @@ extern "C" int CeedOperatorBuildKernel_Sycl_gen(CeedOperator op) {
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
}
code << "\n // -- Element loop --\n";
Expand Down Expand Up @@ -697,15 +699,20 @@ extern "C" int CeedOperatorBuildKernel_Sycl_gen(CeedOperator op) {
// LCOV_EXCL_START
case CEED_EVAL_WEIGHT: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "CEED_EVAL_WEIGHT cannot be an output evaluation mode");
break; // Should not occur
}
case CEED_EVAL_DIV:
break; // TODO: Not implemented
case CEED_EVAL_CURL:
break; // TODO: Not implemented
// LCOV_EXCL_STOP
case CEED_EVAL_CURL: {
Ceed ceed;

CeedCallBackend(CeedOperatorGetCeed(op, &ceed));
return CeedError(ceed, CEED_ERROR_BACKEND, "%s not supported", CeedEvalModes[eval_mode]);
break; // Should not occur
}
// LCOV_EXCL_STOP
}
// Restriction
bool is_strided;
Expand Down
6 changes: 1 addition & 5 deletions backends/sycl-gen/ceed-sycl-gen-qfunction.sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ int CeedQFunctionCreate_Sycl_gen(CeedQFunction qf) {
CeedDebug256(ceed, 2, "----- Loading QFunction User Source -----\n");
CeedCallBackend(CeedQFunctionLoadSourceToBuffer(qf, &impl->q_function_source));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source Complete! -----\n");
if (!impl->q_function_source) {
// LCOV_EXCL_START
return CeedError(ceed, CEED_ERROR_UNSUPPORTED, "/gpu/sycl/gen backend requires QFunction source code file");
// LCOV_EXCL_STOP
}
CeedCheck(impl->q_function_source, ceed, CEED_ERROR_UNSUPPORTED, "/gpu/sycl/gen backend requires QFunction source code file");

CeedCallBackend(CeedSetBackendFunctionCpp(ceed, "QFunction", qf, "Apply", CeedQFunctionApply_Sycl_gen));
CeedCallBackend(CeedSetBackendFunctionCpp(ceed, "QFunction", qf, "Destroy", CeedQFunctionDestroy_Sycl_gen));
Expand Down
Loading

0 comments on commit ec27d2c

Please sign in to comment.