include/hip/hip_ext.h Source File

include/hip/hip_ext.h Source File#

HIP Runtime API Reference: include/hip/hip_ext.h Source File
hip_ext.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef HIP_INCLUDE_HIP_HIP_EXT_H
8#define HIP_INCLUDE_HIP_HIP_EXT_H
9#include "hip/hip_runtime.h"
10#if defined(__cplusplus)
11#include <tuple>
12#include <type_traits>
13#endif
55extern "C" hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
56 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
57 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
58 uint32_t localWorkSizeZ, size_t sharedMemBytes,
59 hipStream_t hStream, void** kernelParams,
60 void** extra, hipEvent_t startEvent __dparm(NULL),
61 hipEvent_t stopEvent __dparm(NULL),
62 uint32_t flags __dparm(0));
67HIP_DEPRECATED("use hipExtModuleLaunchKernel instead")
69extern "C" hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
70 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
71 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
72 uint32_t localWorkSizeZ, size_t sharedMemBytes,
73 hipStream_t hStream, void** kernelParams,
74 void** extra, hipEvent_t startEvent __dparm(NULL),
75 hipEvent_t stopEvent __dparm(NULL));
76
77#if defined(__cplusplus)
78
99extern "C" hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks,
100 dim3 dimBlocks, void** args, size_t sharedMemBytes,
101 hipStream_t stream, hipEvent_t startEvent,
102 hipEvent_t stopEvent, int flags);
103
124template <typename... Args, typename F = void (*)(Args...)>
125inline void hipExtLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& dimBlocks,
126 std::uint32_t sharedMemBytes, hipStream_t stream,
127 hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags,
128 Args... args) {
129 constexpr size_t count = sizeof...(Args);
130 auto tup_ = std::tuple<Args...>{args...};
131 auto tup = validateArgsCountType(kernel, tup_);
132 void* _Args[count];
133 pArgs<0>(tup, _Args);
134
135 auto k = reinterpret_cast<void*>(kernel);
136 hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent, stopEvent,
137 (int)flags);
138}
139
140#endif // defined(__cplusplus)
141
142// doxygen end AMD-specific features
146#endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H
hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ, uint32_t localWorkSizeX, uint32_t localWorkSizeY, uint32_t localWorkSizeZ, size_t sharedMemBytes, hipStream_t hStream, void **kernelParams, void **extra, hipEvent_t startEvent, hipEvent_t stopEvent)
This HIP API is deprecated, please use hipExtModuleLaunchKernel() instead.
hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ, uint32_t localWorkSizeX, uint32_t localWorkSizeY, uint32_t localWorkSizeZ, size_t sharedMemBytes, hipStream_t hStream, void **kernelParams, void **extra, hipEvent_t startEvent, hipEvent_t stopEvent, uint32_t flags)
Launches kernel with parameters and shared memory on stream with arguments passed to kernel params or...
hipError_t hipExtLaunchKernel(const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes, hipStream_t stream, hipEvent_t startEvent, hipEvent_t stopEvent, int flags)
Launches kernel from the pointer address, with arguments and shared memory on stream.
void hipExtLaunchKernelGGL(F kernel, const dim3 &numBlocks, const dim3 &dimBlocks, std::uint32_t sharedMemBytes, hipStream_t stream, hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags, Args... args)
Launches kernel with dimention parameters and shared memory on stream with templated kernel and argum...
Definition hip_ext.h:125
#define __dparm(x)
Definition hip_runtime_api.h:653
struct ihipStream_t * hipStream_t
Definition hip_runtime_api.h:685
struct ihipEvent_t * hipEvent_t
Definition hip_runtime_api.h:716
enum __HIP_NODISCARD hipError_t hipError_t
Definition hip_runtime_api.h:289
struct ihipModuleSymbol_t * hipFunction_t
Definition hip_runtime_api.h:695
#define HIP_DEPRECATED(msg)
Definition hip_runtime_api.h:643
#define HIP_PUBLIC_API
Definition hip_common.h:45
Definition hip_runtime_api.h:1284