/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-6.3.0/include/hip/hip_ext.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-6.3.0/include/hip/hip_ext.h Source File#

HIP Runtime API Reference: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-6.3.0/include/hip/hip_ext.h Source File
hip_ext.h
Go to the documentation of this file.
1/*
2Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22
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)
27#include <tuple>
28#include <type_traits>
29#endif
71 extern "C" hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
72 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
73 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
74 uint32_t localWorkSizeZ, size_t sharedMemBytes,
75 hipStream_t hStream, void** kernelParams, void** extra,
76 hipEvent_t startEvent __dparm(NULL),
77 hipEvent_t stopEvent __dparm(NULL),
78 uint32_t flags __dparm(0));
83HIP_DEPRECATED("use hipExtModuleLaunchKernel instead")
85extern "C" hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
86 uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
87 uint32_t localWorkSizeX, uint32_t localWorkSizeY,
88 uint32_t localWorkSizeZ, size_t sharedMemBytes,
89 hipStream_t hStream, void** kernelParams, void** extra,
90 hipEvent_t startEvent __dparm(NULL),
91 hipEvent_t stopEvent __dparm(NULL));
92
93#if defined(__cplusplus)
94
115extern "C" hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks,
116 dim3 dimBlocks, void** args, size_t sharedMemBytes,
117 hipStream_t stream, hipEvent_t startEvent,
118 hipEvent_t stopEvent, int flags);
119
139template <typename... Args, typename F = void (*)(Args...)>
140inline void hipExtLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& dimBlocks,
141 std::uint32_t sharedMemBytes, hipStream_t stream,
142 hipEvent_t startEvent, hipEvent_t stopEvent, std::uint32_t flags,
143 Args... args) {
144 constexpr size_t count = sizeof...(Args);
145 auto tup_ = std::tuple<Args...>{args...};
146 auto tup = validateArgsCountType(kernel, tup_);
147 void* _Args[count];
148 pArgs<0>(tup, _Args);
149
150 auto k = reinterpret_cast<void*>(kernel);
151 hipExtLaunchKernel(k, numBlocks, dimBlocks, _Args, sharedMemBytes, stream, startEvent,
152 stopEvent, (int)flags);
153}
154
155#endif // defined(__cplusplus)
156
157// doxygen end AMD-specific features
161#endif // #iidef HIP_INCLUDE_HIP_HIP_EXT_H
#define __dparm(x)
Definition hip_runtime_api.h:587
struct ihipStream_t * hipStream_t
Definition hip_runtime_api.h:615
struct ihipEvent_t * hipEvent_t
Definition hip_runtime_api.h:643
enum __HIP_NODISCARD hipError_t hipError_t
Definition hip_runtime_api.h:287
struct ihipModuleSymbol_t * hipFunction_t
Definition hip_runtime_api.h:625
#define HIP_DEPRECATED(msg)
Definition hip_runtime_api.h:580
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:140
#define HIP_PUBLIC_API
Definition hip_common.h:61
Definition hip_runtime_api.h:1055