From be77d12b08aed0d9f0fce359f0279a21d6405b4e Mon Sep 17 00:00:00 2001 From: James Wright Date: Wed, 11 Sep 2024 17:26:41 +0000 Subject: [PATCH] sycl - Misc fixes --- backends/sycl-gen/ceed-sycl-gen-operator.sycl.cpp | 4 ++-- backends/sycl-ref/ceed-sycl-ref-operator.sycl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/sycl-gen/ceed-sycl-gen-operator.sycl.cpp b/backends/sycl-gen/ceed-sycl-gen-operator.sycl.cpp index 650a52cf4d..0736446f4c 100644 --- a/backends/sycl-gen/ceed-sycl-gen-operator.sycl.cpp +++ b/backends/sycl-gen/ceed-sycl-gen-operator.sycl.cpp @@ -107,12 +107,12 @@ static int CeedOperatorApplyAdd_Sycl_gen(CeedOperator op, CeedVector input_vec, break; } } - if (!is_active) CeedCallBackend(CeedVectorDestroy(&vec)); if (index == -1) { CeedCallBackend(CeedVectorGetArray(vec, CEED_MEM_DEVICE, &impl->fields->outputs[i])); } else { impl->fields->outputs[i] = impl->fields->outputs[index]; } + if (!is_active) CeedCallBackend(CeedVectorDestroy(&vec)); } } @@ -189,10 +189,10 @@ static int CeedOperatorApplyAdd_Sycl_gen(CeedOperator op, CeedVector input_vec, break; } } - if (!is_active) CeedCallBackend(CeedVectorDestroy(&vec)); if (index == -1) { CeedCallBackend(CeedVectorRestoreArray(vec, &impl->fields->outputs[i])); } + if (!is_active) CeedCallBackend(CeedVectorDestroy(&vec)); } } diff --git a/backends/sycl-ref/ceed-sycl-ref-operator.sycl.cpp b/backends/sycl-ref/ceed-sycl-ref-operator.sycl.cpp index a046690420..69761c340e 100644 --- a/backends/sycl-ref/ceed-sycl-ref-operator.sycl.cpp +++ b/backends/sycl-ref/ceed-sycl-ref-operator.sycl.cpp @@ -1023,9 +1023,9 @@ static int CeedSingleOperatorAssembleSetup_Sycl(CeedOperator op) { CeedCallBackend(CeedOperatorFieldGetBasis(input_fields[i], &basis)); CeedCheck(!basis_in || basis_in == basis, ceed, CEED_ERROR_BACKEND, "Backend does not implement operator assembly with multiple active bases"); if (!basis_in) CeedCallBackend(CeedBasisReferenceCopy(basis, &basis_in)); + CeedCallBackend(CeedBasisGetDimension(basis, &dim)); + CeedCallBackend(CeedBasisGetNumQuadraturePoints(basis, &num_qpts)); CeedCallBackend(CeedBasisDestroy(&basis)); - CeedCallBackend(CeedBasisGetDimension(basis_in, &dim)); - CeedCallBackend(CeedBasisGetNumQuadraturePoints(basis_in, &num_qpts)); CeedCallBackend(CeedOperatorFieldGetElemRestriction(input_fields[i], &elem_rstr)); if (!rstr_in) CeedCallBackend(CeedElemRestrictionReferenceCopy(elem_rstr, &rstr_in)); CeedCallBackend(CeedElemRestrictionDestroy(&elem_rstr));