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 <stdint.h>
14
15extern "C" {
16
17// These functions use intptr_t instead of CUDA's unsigned int to match
18// the type of MLIR's index type. This avoids the need for casts in the
19// generated MLIR code.
20
21void RTDEF(CUFLaunchKernel)(const void *kernelName, intptr_t gridX,
22 intptr_t gridY, intptr_t gridZ, intptr_t blockX, intptr_t blockY,
23 intptr_t blockZ, int64_t *stream, int32_t smem, void **params,
24 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 int64_t *stream, int32_t smem, void **params, void **extra);
30
31void RTDEF(CUFLaunchCooperativeKernel)(const void *kernelName, intptr_t gridX,
32 intptr_t gridY, intptr_t gridZ, intptr_t blockX, intptr_t blockY,
33 intptr_t blockZ, int64_t *stream, int32_t smem, void **params,
34 void **extra);
35
36} // extern "C"
37
38#endif // FORTRAN_RUNTIME_CUDA_KERNEL_H_