From 2e88d319acd75658c85aee6ae8a14c6e519e582d Mon Sep 17 00:00:00 2001 From: Jeremy L Thompson Date: Tue, 3 Sep 2024 10:34:06 -0600 Subject: [PATCH] gpu - counting points correctly --- backends/cuda-ref/ceed-cuda-ref-restriction.c | 2 +- backends/hip-ref/ceed-hip-ref-restriction.c | 2 +- interface/ceed-basis.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backends/cuda-ref/ceed-cuda-ref-restriction.c b/backends/cuda-ref/ceed-cuda-ref-restriction.c index 0f20ceca7d..8ed9e0c60e 100644 --- a/backends/cuda-ref/ceed-cuda-ref-restriction.c +++ b/backends/cuda-ref/ceed-cuda-ref-restriction.c @@ -604,7 +604,7 @@ int CeedElemRestrictionCreate_Cuda(CeedMemType mem_type, CeedCopyMode copy_mode, // -- Use padded offsets for the rest of the setup offsets = (const CeedInt *)offsets_padded; copy_mode = CEED_OWN_POINTER; - CeedCallBackend(CeedElemRestrictionSetAtPointsEVectorSize(rstr, at_points_size * num_comp)); + CeedCallBackend(CeedElemRestrictionSetAtPointsEVectorSize(rstr, elem_size * num_elem * num_comp)); // -- Points per element CeedCallBackend(CeedSetHostCeedIntArray(points_per_elem, CEED_OWN_POINTER, num_elem, &impl->h_points_per_elem_owned, diff --git a/backends/hip-ref/ceed-hip-ref-restriction.c b/backends/hip-ref/ceed-hip-ref-restriction.c index 41bba37520..eff205a018 100644 --- a/backends/hip-ref/ceed-hip-ref-restriction.c +++ b/backends/hip-ref/ceed-hip-ref-restriction.c @@ -603,7 +603,7 @@ int CeedElemRestrictionCreate_Hip(CeedMemType mem_type, CeedCopyMode copy_mode, // -- Use padded offsets for the rest of the setup offsets = (const CeedInt *)offsets_padded; copy_mode = CEED_OWN_POINTER; - CeedCallBackend(CeedElemRestrictionSetAtPointsEVectorSize(rstr, at_points_size * num_comp)); + CeedCallBackend(CeedElemRestrictionSetAtPointsEVectorSize(rstr, elem_size * num_elem * num_comp)); // -- Points per element CeedCallBackend(CeedSetHostCeedIntArray(points_per_elem, CEED_OWN_POINTER, num_elem, &impl->h_points_per_elem_owned, diff --git a/interface/ceed-basis.c b/interface/ceed-basis.c index 6be4e3ddf7..132118cb5a 100644 --- a/interface/ceed-basis.c +++ b/interface/ceed-basis.c @@ -1640,14 +1640,16 @@ static int CeedBasisApplyAtPointsCheckDims(CeedBasis basis, CeedInt num_elem, co if (u != CEED_VECTOR_NONE) CeedCall(CeedVectorGetLength(u, &u_length)); // Check compatibility of topological and geometrical dimensions - for (CeedInt i = 0; i < num_elem; i++) total_num_points += num_points[i]; CeedCheck((t_mode == CEED_TRANSPOSE && v_length % num_nodes == 0) || (t_mode == CEED_NOTRANSPOSE && u_length % num_nodes == 0) || (eval_mode == CEED_EVAL_WEIGHT), ceed, CEED_ERROR_DIMENSION, "Length of input/output vectors incompatible with basis dimensions and number of points"); // Check compatibility coordinates vector + for (CeedInt i = 0; i < num_elem; i++) total_num_points += num_points[i]; CeedCheck((x_length >= total_num_points * dim) || (eval_mode == CEED_EVAL_WEIGHT), ceed, CEED_ERROR_DIMENSION, - "Length of reference coordinate vector incompatible with basis dimension and number of points"); + "Length of reference coordinate vector incompatible with basis dimension and number of points." + " Found reference coordinate vector of length %" CeedSize_FMT ", not of length %" CeedSize_FMT ".", + x_length, total_num_points * dim); // Check CEED_EVAL_WEIGHT only on CEED_NOTRANSPOSE CeedCheck(eval_mode != CEED_EVAL_WEIGHT || t_mode == CEED_NOTRANSPOSE, ceed, CEED_ERROR_UNSUPPORTED,