13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 330f4f45fSnbeams // 43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 530f4f45fSnbeams // 63d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 73d576824SJeremy L Thompson 830f4f45fSnbeams #ifndef _ceed_hip_compile_h 930f4f45fSnbeams #define _ceed_hip_compile_h 1030f4f45fSnbeams 11*2b730f8bSJeremy L Thompson #include <ceed/backend.h> 12ec3da8bcSJed Brown #include <ceed/ceed.h> 1330f4f45fSnbeams #include <hip/hip_runtime.h> 1430f4f45fSnbeams 15*2b730f8bSJeremy L Thompson static inline CeedInt CeedDivUpInt(CeedInt numerator, CeedInt denominator) { return (numerator + denominator - 1) / denominator; } 160d0321e0SJeremy L Thompson 17*2b730f8bSJeremy L Thompson CEED_INTERN int CeedCompileHip(Ceed ceed, const char *source, hipModule_t *module, const CeedInt num_defines, ...); 1830f4f45fSnbeams 19*2b730f8bSJeremy L Thompson CEED_INTERN int CeedGetKernelHip(Ceed ceed, hipModule_t module, const char *name, hipFunction_t *kernel); 2030f4f45fSnbeams 21*2b730f8bSJeremy L Thompson CEED_INTERN int CeedRunKernelHip(Ceed ceed, hipFunction_t kernel, const int grid_size, const int block_size, void **args); 2230f4f45fSnbeams 23*2b730f8bSJeremy L Thompson CEED_INTERN int CeedRunKernelDimHip(Ceed ceed, hipFunction_t kernel, const int grid_size, const int block_size_x, const int block_size_y, 240d0321e0SJeremy L Thompson const int block_size_z, void **args); 2530f4f45fSnbeams 26*2b730f8bSJeremy L Thompson CEED_INTERN int CeedRunKernelDimSharedHip(Ceed ceed, hipFunction_t kernel, const int grid_size, const int block_size_x, const int block_size_y, 270d0321e0SJeremy L Thompson const int block_size_z, const int shared_mem_size, void **args); 2830f4f45fSnbeams 293d576824SJeremy L Thompson #endif // _ceed_hip_compile_h 30