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,
112 #if !__HIP_VDI__ && defined(__cplusplus) 116 __attribute__((visibility(
"hidden")))
117 void hipExtLaunchKernelGGLImpl(
118 std::uintptr_t function_address,
119 const
dim3& numBlocks,
120 const
dim3& dimBlocks,
121 std::uint32_t sharedMemBytes,
128 const auto& kd = hip_impl::get_program_state()
129 .kernel_descriptor(function_address, target_agent(stream));
132 numBlocks.y * dimBlocks.y,
133 numBlocks.z * dimBlocks.z,
134 dimBlocks.x, dimBlocks.y, dimBlocks.z,
135 sharedMemBytes, stream,
nullptr, kernarg,
136 startEvent, stopEvent, flags);
140 template <
typename... Args,
typename F = void (*)(Args...)>
142 void hipExtLaunchKernelGGL(F kernel,
const dim3& numBlocks,
143 const dim3& dimBlocks, std::uint32_t sharedMemBytes,
147 hip_impl::hip_init();
149 hip_impl::make_kernarg(kernel, std::tuple<Args...>{std::move(args)...});
150 std::size_t kernarg_size = kernarg.size();
153 HIP_LAUNCH_PARAM_BUFFER_POINTER,
155 HIP_LAUNCH_PARAM_BUFFER_SIZE,
157 HIP_LAUNCH_PARAM_END};
159 hip_impl::hipExtLaunchKernelGGLImpl(reinterpret_cast<std::uintptr_t>(kernel),
160 numBlocks, dimBlocks, sharedMemBytes,
161 stream, startEvent, stopEvent, flags,
164 #endif // !__HIP_VDI__ && defined(__cplusplus) 170 #endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H
Definition: hip_module.cpp:107
HIP_PUBLIC_API 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=nullptr, hipEvent_t stopEvent=nullptr, uint32_t flags=0)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
Definition: hip_module.cpp:288
Definition: hip_runtime_api.h:269
Definition: hip_runtime.h:202
HIP_PUBLIC_API hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **av)
Return hc::accelerator_view associated with the specified stream.
Definition: hip_hcc.cpp:2493
Definition: hip_hcc_internal.h:720
Definition: hip_hcc_internal.h:544
HIP_PUBLIC_API hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc)
Return hc::accelerator associated with the specified deviceId.
Definition: hip_hcc.cpp:2477