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>
65 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
66 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
67 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
68 hipStream_t hStream,
void** kernelParams,
void** extra,
69 hipEvent_t startEvent =
nullptr,
70 hipEvent_t stopEvent =
nullptr,
74 hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
75 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
76 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
77 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
78 hipStream_t hStream,
void** kernelParams,
void** extra,
79 hipEvent_t startEvent =
nullptr,
80 hipEvent_t stopEvent =
nullptr)
83 #if defined(__cplusplus)
85 extern "C" hipError_t hipExtLaunchKernel(
const void* function_address,
dim3 numBlocks,
86 dim3 dimBlocks,
void** args,
size_t sharedMemBytes,
87 hipStream_t stream, hipEvent_t startEvent,
88 hipEvent_t stopEvent,
int flags);
90 template <
typename... Args,
typename F = void (*)(Args...)>
91 inline void hipExtLaunchKernelGGL(F kernel,
const dim3& numBlocks,
const dim3& dimBlocks,
92 std::uint32_t sharedMemBytes, hipStream_t stream,
93 hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags,
95 constexpr
size_t count =
sizeof...(Args);
96 auto tup_ = std::tuple<Args...>{args...};
97 auto tup = validateArgsCountType(kernel, tup_);
101 auto k =
reinterpret_cast<void*
>(kernel);
102 hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent,
103 stopEvent, (
int)flags);
106 #endif // defined(__cplusplus)
112 #endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H