FLANG
kernel.h
1//===-- include/flang/Runtime/CUDA/kernel.h ---------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef FORTRAN_RUNTIME_CUDA_KERNEL_H_
10#define FORTRAN_RUNTIME_CUDA_KERNEL_H_
11
12#include "flang/Runtime/entry-names.h"
13#include <cstddef>
14#include <stdint.h>
15
16extern "C" {
17
18// These functions use intptr_t instead of CUDA's unsigned int to match
19// the type of MLIR's index type. This avoids the need for casts in the
20// generated MLIR code.
21
22void RTDEF(CUFLaunchKernel)(const void *kernelName, intptr_t gridX,
23 intptr_t gridY, intptr_t gridZ, intptr_t blockX, intptr_t blockY,
24 intptr_t blockZ, int32_t smem, void **params, void **extra);
25
26void RTDEF(CUFLaunchClusterKernel)(const void *kernelName, intptr_t clusterX,
27 intptr_t clusterY, intptr_t clusterZ, intptr_t gridX, intptr_t gridY,
28 intptr_t gridZ, intptr_t blockX, intptr_t blockY, intptr_t blockZ,
29 int32_t smem, void **params, void **extra);
30
31} // extern "C"
32
33#endif // FORTRAN_RUNTIME_CUDA_KERNEL_H_