Skip to content

Commit

Permalink
Ensure initialization for new L1 norm handling in GPU backends
Browse files Browse the repository at this point in the history
  • Loading branch information
nbeams committed Jun 30, 2023
1 parent 8cafab1 commit 76cf8ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions backends/cuda-ref/ceed-cuda-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ static int CeedVectorNorm_Cuda(CeedVector vec, CeedNormType type, CeedScalar *no
CeedCallBackend(CeedVectorGetArrayRead(vec, CEED_MEM_DEVICE, &d_array));
switch (type) {
case CEED_NORM_1: {
*norm = 0.0;
if (CEED_SCALAR_TYPE == CEED_SCALAR_FP32) {
#if CUDA_VERSION >= 12000 // We have CUDA 12, and can use 64-bit integers
CeedCallCublas(ceed, cublasSasum_64(handle, (int64_t)length, (float *)d_array, 1, (float *)norm));
Expand Down
1 change: 1 addition & 0 deletions backends/hip-ref/ceed-hip-ref-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ static int CeedVectorNorm_Hip(CeedVector vec, CeedNormType type, CeedScalar *nor
CeedCallBackend(CeedVectorGetArrayRead(vec, CEED_MEM_DEVICE, &d_array));
switch (type) {
case CEED_NORM_1: {
*norm = 0.0;
if (CEED_SCALAR_TYPE == CEED_SCALAR_FP32) {
float sub_norm = 0.0;
float *d_array_start;
Expand Down

0 comments on commit 76cf8ac

Please sign in to comment.