1*3d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2*3d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3af7ca75eSjeremylt // 4*3d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 5af7ca75eSjeremylt // 6*3d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 7af7ca75eSjeremylt 8e8a49f24SJeremy L Thompson #include <ceed/ceed.h> 9e8a49f24SJeremy L Thompson #include <ceed/backend.h> 10ec3da8bcSJed Brown #include <ceed/hip.h> 11e8a49f24SJeremy L Thompson #include <ceed-impl.h> 12af7ca75eSjeremylt 13af7ca75eSjeremylt /** 14af7ca75eSjeremylt @brief Set HIP function pointer to evaluate action at quadrature points 15af7ca75eSjeremylt 16af7ca75eSjeremylt @param qf CeedQFunction to set device pointer 17af7ca75eSjeremylt @param f Device function pointer to evaluate action at quadrature points 18af7ca75eSjeremylt 19af7ca75eSjeremylt @return An error code: 0 - success, otherwise - failure 20af7ca75eSjeremylt 21af7ca75eSjeremylt @ref User 22af7ca75eSjeremylt **/ 23af7ca75eSjeremylt int CeedQFunctionSetHIPUserFunction(CeedQFunction qf, hipFunction_t f) { 24af7ca75eSjeremylt int ierr; 25af7ca75eSjeremylt if (!qf->SetHIPUserFunction) { 26af7ca75eSjeremylt Ceed ceed; 27af7ca75eSjeremylt ierr = CeedQFunctionGetCeed(qf, &ceed); CeedChk(ierr); 283f21f6b1SJeremy L Thompson CeedDebug(ceed, 293f21f6b1SJeremy L Thompson "Backend does not support hipFunction_t pointers for QFunctions."); 30af7ca75eSjeremylt } else { 31af7ca75eSjeremylt ierr = qf->SetHIPUserFunction(qf, f); CeedChk(ierr); 32af7ca75eSjeremylt } 33e15f9bd0SJeremy L Thompson return CEED_ERROR_SUCCESS; 34af7ca75eSjeremylt } 35