23 #ifndef HIP_INCLUDE_HIP_HIP_EXT_H
24 #define HIP_INCLUDE_HIP_HIP_EXT_H
25 #include "hip/hip_runtime.h"
26 #if defined(__cplusplus)
28 #include <type_traits>
67 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
68 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
69 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
70 hipStream_t hStream,
void** kernelParams,
void** extra,
71 hipEvent_t startEvent =
nullptr,
72 hipEvent_t stopEvent =
nullptr,
76 hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
77 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
78 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
79 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
80 hipStream_t hStream,
void** kernelParams,
void** extra,
81 hipEvent_t startEvent =
nullptr,
82 hipEvent_t stopEvent =
nullptr)
85 #if defined(__cplusplus)
87 extern "C" hipError_t hipExtLaunchKernel(
const void* function_address,
dim3 numBlocks,
88 dim3 dimBlocks,
void** args,
size_t sharedMemBytes,
89 hipStream_t stream, hipEvent_t startEvent,
90 hipEvent_t stopEvent,
int flags);
92 template <
typename... Args,
typename F = void (*)(Args...)>
93 inline void hipExtLaunchKernelGGL(F kernel,
const dim3& numBlocks,
const dim3& dimBlocks,
94 std::uint32_t sharedMemBytes, hipStream_t stream,
95 hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags,
97 constexpr
size_t count =
sizeof...(Args);
98 auto tup_ = std::tuple<Args...>{args...};
99 auto tup = validateArgsCountType(kernel, tup_);
101 pArgs<0>(tup, _Args);
103 auto k =
reinterpret_cast<void*
>(kernel);
104 hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent,
105 stopEvent, (
int)flags);
108 #endif // defined(__cplusplus)
114 #endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H