From 2495adffebc90c92441d83a0a76c3fea050c7970 Mon Sep 17 00:00:00 2001 From: Jeremy L Thompson Date: Wed, 4 Sep 2024 12:20:20 -0600 Subject: [PATCH] atpoints - copy when *not* the same Co-authored-by: Zach Atkins --- backends/cuda-ref/ceed-cuda-ref-basis.c | 2 +- backends/cuda-shared/ceed-cuda-shared-basis.c | 2 +- backends/hip-ref/ceed-hip-ref-basis.c | 2 +- backends/hip-shared/ceed-hip-shared-basis.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/cuda-ref/ceed-cuda-ref-basis.c b/backends/cuda-ref/ceed-cuda-ref-basis.c index 738d0c4834..c245a51489 100644 --- a/backends/cuda-ref/ceed-cuda-ref-basis.c +++ b/backends/cuda-ref/ceed-cuda-ref-basis.c @@ -150,7 +150,7 @@ static int CeedBasisApplyAtPointsCore_Cuda(CeedBasis basis, bool apply_add, cons CeedCallBackend(CeedFree(&data->h_points_per_elem)); CeedCallBackend(CeedCalloc(num_elem, &data->h_points_per_elem)); } - if (!memcmp(data->h_points_per_elem, num_points, num_bytes)) { + if (memcmp(data->h_points_per_elem, num_points, num_bytes)) { memcpy(data->h_points_per_elem, num_points, num_bytes); CeedCallCuda(ceed, cudaMemcpy(data->d_points_per_elem, num_points, num_bytes, cudaMemcpyHostToDevice)); } diff --git a/backends/cuda-shared/ceed-cuda-shared-basis.c b/backends/cuda-shared/ceed-cuda-shared-basis.c index 664694b859..8924ff52f4 100644 --- a/backends/cuda-shared/ceed-cuda-shared-basis.c +++ b/backends/cuda-shared/ceed-cuda-shared-basis.c @@ -256,7 +256,7 @@ static int CeedBasisApplyAtPointsCore_Cuda_shared(CeedBasis basis, bool apply_ad CeedCallBackend(CeedFree(&data->h_points_per_elem)); CeedCallBackend(CeedCalloc(num_elem, &data->h_points_per_elem)); } - if (!memcmp(data->h_points_per_elem, num_points, num_bytes)) { + if (memcmp(data->h_points_per_elem, num_points, num_bytes)) { memcpy(data->h_points_per_elem, num_points, num_bytes); CeedCallCuda(ceed, cudaMemcpy(data->d_points_per_elem, num_points, num_bytes, cudaMemcpyHostToDevice)); } diff --git a/backends/hip-ref/ceed-hip-ref-basis.c b/backends/hip-ref/ceed-hip-ref-basis.c index acd5ae41bc..604baa2c92 100644 --- a/backends/hip-ref/ceed-hip-ref-basis.c +++ b/backends/hip-ref/ceed-hip-ref-basis.c @@ -147,7 +147,7 @@ static int CeedBasisApplyAtPointsCore_Hip(CeedBasis basis, bool apply_add, const CeedCallBackend(CeedFree(&data->h_points_per_elem)); CeedCallBackend(CeedCalloc(num_elem, &data->h_points_per_elem)); } - if (!memcmp(data->h_points_per_elem, num_points, num_bytes)) { + if (memcmp(data->h_points_per_elem, num_points, num_bytes)) { memcpy(data->h_points_per_elem, num_points, num_bytes); CeedCallHip(ceed, hipMemcpy(data->d_points_per_elem, num_points, num_bytes, hipMemcpyHostToDevice)); } diff --git a/backends/hip-shared/ceed-hip-shared-basis.c b/backends/hip-shared/ceed-hip-shared-basis.c index 01d2251163..32e23ba070 100644 --- a/backends/hip-shared/ceed-hip-shared-basis.c +++ b/backends/hip-shared/ceed-hip-shared-basis.c @@ -314,7 +314,7 @@ static int CeedBasisApplyAtPointsCore_Hip_shared(CeedBasis basis, bool apply_add CeedCallBackend(CeedFree(&data->h_points_per_elem)); CeedCallBackend(CeedCalloc(num_elem, &data->h_points_per_elem)); } - if (!memcmp(data->h_points_per_elem, num_points, num_bytes)) { + if (memcmp(data->h_points_per_elem, num_points, num_bytes)) { memcpy(data->h_points_per_elem, num_points, num_bytes); CeedCallHip(ceed, hipMemcpy(data->d_points_per_elem, num_points, num_bytes, hipMemcpyHostToDevice)); }