23 #ifndef HIP_INCLUDE_HIP_HIP_EXT_H
24 #define HIP_INCLUDE_HIP_HIP_EXT_H
25 #include "hip/hip_runtime.h"
31 class accelerator_view;
61 #endif // #ifdef __HCC__
94 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
95 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
96 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
97 hipStream_t hStream,
void** kernelParams,
void** extra,
103 hipError_t hipHccModuleLaunchKernel(
hipFunction_t f, uint32_t globalWorkSizeX,
104 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
105 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
106 uint32_t localWorkSizeZ,
size_t sharedMemBytes,
107 hipStream_t hStream,
void** kernelParams,
void** extra,
113 #if defined(__HIP_PLATFORM_HCC__) && GENERIC_GRID_LAUNCH == 1 && defined(__HCC__)
118 __attribute__((visibility(
"hidden")))
119 void hipExtLaunchKernelGGLImpl(
120 std::uintptr_t function_address,
121 const
dim3& numBlocks,
122 const
dim3& dimBlocks,
123 std::uint32_t sharedMemBytes,
130 const auto& kd = hip_impl::get_program_state()
131 .kernel_descriptor(function_address, target_agent(stream));
134 numBlocks.y * dimBlocks.y,
135 numBlocks.z * dimBlocks.z,
136 dimBlocks.x, dimBlocks.y, dimBlocks.z,
137 sharedMemBytes, stream,
nullptr, kernarg,
138 startEvent, stopEvent, flags);
142 template <
typename... Args,
typename F = void (*)(Args...)>
144 void hipExtLaunchKernelGGL(F kernel,
const dim3& numBlocks,
145 const dim3& dimBlocks, std::uint32_t sharedMemBytes,
149 hip_impl::hip_init();
151 hip_impl::make_kernarg(kernel, std::tuple<Args...>{std::move(args)...});
152 std::size_t kernarg_size = kernarg.size();
155 HIP_LAUNCH_PARAM_BUFFER_POINTER,
157 HIP_LAUNCH_PARAM_BUFFER_SIZE,
159 HIP_LAUNCH_PARAM_END};
161 hip_impl::hipExtLaunchKernelGGLImpl(reinterpret_cast<std::uintptr_t>(kernel),
162 numBlocks, dimBlocks, sharedMemBytes,
163 stream, startEvent, stopEvent, flags,
166 #endif // !__HIP_ROCclr__ && defined(__cplusplus)
172 #endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H