xref: /libCEED/rust/libceed-sys/c-src/backends/hip/ceed-hip-compile.h (revision 509d4af65d23546c690c9766d8b29e47dc3b3afb)
15aed82e4SJeremy L Thompson // Copyright (c) 2017-2024, 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
7*509d4af6SJeremy L Thompson #pragma once
830f4f45fSnbeams 
949aac155SJeremy L Thompson #include <ceed.h>
102b730f8bSJeremy L Thompson #include <ceed/backend.h>
1130f4f45fSnbeams #include <hip/hip_runtime.h>
1230f4f45fSnbeams 
132b730f8bSJeremy L Thompson static inline CeedInt CeedDivUpInt(CeedInt numerator, CeedInt denominator) { return (numerator + denominator - 1) / denominator; }
140d0321e0SJeremy L Thompson 
15eb7e6cafSJeremy L Thompson CEED_INTERN int CeedCompile_Hip(Ceed ceed, const char *source, hipModule_t *module, const CeedInt num_defines, ...);
1630f4f45fSnbeams 
17eb7e6cafSJeremy L Thompson CEED_INTERN int CeedGetKernel_Hip(Ceed ceed, hipModule_t module, const char *name, hipFunction_t *kernel);
1830f4f45fSnbeams 
19eb7e6cafSJeremy L Thompson CEED_INTERN int CeedRunKernel_Hip(Ceed ceed, hipFunction_t kernel, int grid_size, int block_size, void **args);
2030f4f45fSnbeams 
21eb7e6cafSJeremy L Thompson CEED_INTERN int CeedRunKernelDim_Hip(Ceed ceed, hipFunction_t kernel, int grid_size, int block_size_x, int block_size_y, int block_size_z,
2251475c7cSJeremy L Thompson                                      void **args);
2330f4f45fSnbeams 
24eb7e6cafSJeremy L Thompson CEED_INTERN int CeedRunKernelDimShared_Hip(Ceed ceed, hipFunction_t kernel, int grid_size, int block_size_x, int block_size_y, int block_size_z,
2551475c7cSJeremy L Thompson                                            int shared_mem_size, void **args);
26