24 #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H 25 #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H 34 #ifndef GENERIC_GRID_LAUNCH 35 #define GENERIC_GRID_LAUNCH 1 39 #include <hip/hip_runtime_api.h> 40 #include <hip/hcc_detail/driver_types.h> 44 #define DEPRECATED(msg) __attribute__ ((deprecated(msg))) 45 #define DEPRECATED_MSG "This API is marked as deprecated and may not be supported in future releases.For more details please refer https://github.com/ROCm-Developer-Tools/HIP/tree/master/docs/markdown/hip_deprecated_api_list" 47 #if defined(__HCC__) && (__hcc_workweek__ < 16155) 48 #error("This version of HIP requires a newer version of HCC."); 51 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01) 52 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02) 53 #define HIP_LAUNCH_PARAM_END ((void*)0x03) 72 typedef int hipDevice_t;
78 #define hipIpcMemLazyEnablePeerAccess 0 80 #define HIP_IPC_HANDLE_SIZE 64 83 char reserved[HIP_IPC_HANDLE_SIZE];
87 struct ihipIpcEventHandle_t;
88 typedef struct ihipIpcEventHandle_t* hipIpcEventHandle_t;
100 size_t constSizeBytes;
101 size_t localSizeBytes;
102 int maxDynamicSharedSizeBytes;
103 int maxThreadsPerBlock;
105 int preferredShmemCarveout;
107 size_t sharedSizeBytes;
113 hipLimitMallocHeapSize = 0x02,
120 #define hipStreamDefault \ 123 #define hipStreamNonBlocking 0x01 127 #define hipEventDefault 0x0 128 #define hipEventBlockingSync \ 130 #define hipEventDisableTiming \ 132 #define hipEventInterprocess 0x4 133 #define hipEventReleaseToDevice \ 135 #define hipEventReleaseToSystem \ 144 #define hipHostMallocDefault 0x0 145 #define hipHostMallocPortable 0x1 146 #define hipHostMallocMapped \ 148 #define hipHostMallocWriteCombined 0x4 150 #define hipHostMallocCoherent \ 152 #define hipHostMallocNonCoherent \ 159 #define hipHostRegisterDefault 0x0 160 #define hipHostRegisterPortable 0x1 161 #define hipHostRegisterMapped \ 163 #define hipHostRegisterIoMemory 0x4 167 #define hipDeviceScheduleAuto 0x0 168 #define hipDeviceScheduleSpin \ 170 #define hipDeviceScheduleYield \ 173 #define hipDeviceScheduleBlockingSync 0x4 175 #define hipDeviceScheduleMask 0x7 177 #define hipDeviceMapHost 0x8 178 #define hipDeviceLmemResizeToMax 0x16 180 #define hipArrayDefault 0x00 181 #define hipArrayLayered 0x01 182 #define hipArraySurfaceLoadStore 0x02 183 #define hipArrayCubemap 0x04 184 #define hipArrayTextureGather 0x08 191 typedef enum hipJitOption {
192 hipJitOptionMaxRegisters = 0,
193 hipJitOptionThreadsPerBlock,
194 hipJitOptionWallTime,
195 hipJitOptionInfoLogBuffer,
196 hipJitOptionInfoLogBufferSizeBytes,
197 hipJitOptionErrorLogBuffer,
198 hipJitOptionErrorLogBufferSizeBytes,
199 hipJitOptionOptimizationLevel,
200 hipJitOptionTargetFromContext,
202 hipJitOptionFallbackStrategy,
203 hipJitOptionGenerateDebugInfo,
204 hipJitOptionLogVerbose,
205 hipJitOptionGenerateLineInfo,
206 hipJitOptionCacheMode,
208 hipJitOptionFastCompile,
209 hipJitOptionNumOptions
245 dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
717 hipError_t
hipStreamWaitEvent(hipStream_t stream, hipEvent_t event,
unsigned int flags);
841 hipError_t
hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
980 hipError_t
hipMalloc(
void** ptr,
size_t size);
995 __attribute__((deprecated(
"use hipHostMalloc instead")));
1010 hipError_t
hipHostMalloc(
void** ptr,
size_t size,
unsigned int flags);
1025 hipError_t
hipHostAlloc(
void** ptr,
size_t size,
unsigned int flags)
1026 __attribute__((deprecated(
"use hipHostMalloc instead")));
1088 hipError_t
hipHostRegister(
void* hostPtr,
size_t sizeBytes,
unsigned int flags);
1119 hipError_t
hipMallocPitch(
void** ptr,
size_t* pitch,
size_t width,
size_t height);
1134 hipError_t
hipFree(
void* ptr);
1146 hipError_t
hipFreeHost(
void* ptr) __attribute__((deprecated(
"use hipHostFree instead")));
1190 hipError_t
hipMemcpy(
void* dst,
const void* src,
size_t sizeBytes, hipMemcpyKind kind);
1209 hipError_t
hipMemcpyHtoD(hipDeviceptr_t dst,
void* src,
size_t sizeBytes);
1228 hipError_t
hipMemcpyDtoH(
void* dst, hipDeviceptr_t src,
size_t sizeBytes);
1247 hipError_t
hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src,
size_t sizeBytes);
1266 hipError_t
hipMemcpyHtoDAsync(hipDeviceptr_t dst,
void* src,
size_t sizeBytes, hipStream_t stream);
1285 hipError_t
hipMemcpyDtoHAsync(
void* dst, hipDeviceptr_t src,
size_t sizeBytes, hipStream_t stream);
1304 hipError_t
hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src,
size_t sizeBytes,
1305 hipStream_t stream);
1331 hipError_t
hipMemcpyToSymbol(
const void* symbolName,
const void* src,
size_t sizeBytes,
1332 size_t offset __dparm(0), hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1361 size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1363 hipError_t hipMemcpyFromSymbol(
void* dst,
const void* symbolName,
size_t sizeBytes,
1364 size_t offset __dparm(0), hipMemcpyKind kind __dparm( hipMemcpyDeviceToHost ));
1366 hipError_t hipMemcpyFromSymbolAsync(
void* dst,
const void* symbolName,
size_t sizeBytes,
1367 size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1397 hipError_t
hipMemcpyAsync(
void* dst,
const void* src,
size_t sizeBytes, hipMemcpyKind kind,
1398 hipStream_t stream __dparm(0));
1409 hipError_t
hipMemset(
void* dst,
int value,
size_t sizeBytes);
1420 hipError_t
hipMemsetD8(hipDeviceptr_t dest,
unsigned char value,
size_t sizeBytes);
1437 hipError_t
hipMemsetAsync(
void* dst,
int value,
size_t sizeBytes, hipStream_t stream __dparm(0));
1450 hipError_t
hipMemset2D(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height);
1464 hipError_t
hipMemset2DAsync(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height,hipStream_t stream __dparm(0));
1499 hipError_t hipMemPtrGetInfo(
void* ptr,
size_t* size);
1515 size_t height __dparm(0),
unsigned int flags __dparm(
hipArrayDefault));
1545 struct hipExtent extent,
unsigned int flags);
1562 hipError_t
hipMemcpy2D(
void* dst,
size_t dpitch,
const void* src,
size_t spitch,
size_t width,
1563 size_t height, hipMemcpyKind kind);
1564 hipError_t hipMemcpyParam2D(
const hip_Memcpy2D* pCopy);
1583 hipError_t
hipMemcpy2DAsync(
void* dst,
size_t dpitch,
const void* src,
size_t spitch,
size_t width,
1584 size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1603 size_t spitch,
size_t width,
size_t height, hipMemcpyKind kind);
1622 size_t count, hipMemcpyKind kind);
1640 size_t count, hipMemcpyKind kind);
1765 #ifndef USE_PEER_NON_UNIFIED 1766 #define USE_PEER_NON_UNIFIED 1 1769 #if USE_PEER_NON_UNIFIED == 1 1781 hipError_t
hipMemcpyPeer(
void* dst,
int dstDeviceId,
const void* src,
int srcDeviceId,
1796 hipError_t
hipMemcpyPeerAsync(
void* dst,
int dstDeviceId,
const void* src,
int srcDevice,
1797 size_t sizeBytes, hipStream_t stream __dparm(0));
1821 hipError_t
hipInit(
unsigned int flags);
1843 hipError_t
hipCtxCreate(hipCtx_t* ctx,
unsigned int flags, hipDevice_t device)DEPRECATED(DEPRECATED_MSG);
1855 hipError_t
hipCtxDestroy(hipCtx_t ctx) DEPRECATED(DEPRECATED_MSG);
1916 hipError_t
hipCtxGetDevice(hipDevice_t* device) DEPRECATED(DEPRECATED_MSG);
2020 hipError_t
hipCtxGetFlags(
unsigned int* flags) DEPRECATED(DEPRECATED_MSG);
2139 hipError_t
hipDeviceGet(hipDevice_t* device,
int ordinal);
2233 hipError_t
hipModuleLoad(hipModule_t* module, const
char* fname);
2257 hipError_t
hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const
char* kname);
2284 hipError_t hipModuleGetTexRef(
textureReference** texRef, hipModule_t hmod, const
char* name);
2308 hipError_t
hipModuleLoadDataEx(hipModule_t* module, const
void* image,
unsigned int numOptions,
2309 hipJitOption* options,
void** optionValues);
2336 unsigned int gridDimZ,
unsigned int blockDimX,
2337 unsigned int blockDimY,
unsigned int blockDimZ,
2338 unsigned int sharedMemBytes, hipStream_t stream,
2339 void** kernelParams,
void** extra);
2533 hipError_t hipBindTexture(
size_t* offset,
textureReference* tex,
const void* devPtr,
2536 hipError_t ihipBindTextureImpl(
int dim,
enum hipTextureReadMode readMode,
size_t* offset,
2555 template <
class T,
int dim, enum hipTextureReadMode readMode>
2556 hipError_t hipBindTexture(
size_t* offset,
struct texture<T, dim, readMode>& tex,
const void* devPtr,
2558 return ihipBindTextureImpl(dim, readMode, offset, devPtr, &desc, size, &tex);
2575 template <
class T,
int dim, enum hipTextureReadMode readMode>
2576 hipError_t hipBindTexture(
size_t* offset,
struct texture<T, dim, readMode>& tex,
const void* devPtr,
2577 size_t size = UINT_MAX) {
2578 return ihipBindTextureImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
2582 hipError_t hipBindTexture2D(
size_t* offset,
textureReference* tex,
const void* devPtr,
2586 hipError_t ihipBindTexture2DImpl(
int dim,
enum hipTextureReadMode readMode,
size_t* offset,
2590 template <
class T,
int dim, enum hipTextureReadMode readMode>
2591 hipError_t hipBindTexture2D(
size_t* offset,
struct texture<T, dim, readMode>& tex,
2592 const void* devPtr,
size_t width,
size_t height,
size_t pitch) {
2593 return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
2597 template <
class T,
int dim, enum hipTextureReadMode readMode>
2598 hipError_t hipBindTexture2D(
size_t* offset,
struct texture<T, dim, readMode>& tex,
2600 size_t width,
size_t height,
size_t pitch) {
2601 return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
2608 hipError_t ihipBindTextureToArrayImpl(
int dim,
enum hipTextureReadMode readMode,
2613 template <
class T,
int dim, enum hipTextureReadMode readMode>
2614 hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode>& tex,
hipArray_const_t array) {
2615 return ihipBindTextureToArrayImpl(dim, readMode, array, tex.channelDesc, &tex);
2618 template <
class T,
int dim, enum hipTextureReadMode readMode>
2619 hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode>& tex,
hipArray_const_t array,
2621 return ihipBindTextureToArrayImpl(dim, readMode, array, desc, &tex);
2624 template <
class T,
int dim, enum hipTextureReadMode readMode>
2625 inline static hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode> *tex,
2628 return ihipBindTextureToArrayImpl(dim, readMode, array, *desc, tex);
2636 template <
class T,
int dim, enum hipTextureReadMode readMode>
2637 hipError_t hipBindTextureToMipmappedArray(
const texture<T, dim, readMode>& tex,
2642 template <
class T,
int dim, enum hipTextureReadMode readMode>
2643 hipError_t hipBindTextureToMipmappedArray(
const texture<T, dim, readMode>& tex,
2658 extern hipError_t ihipUnbindTextureImpl(
const hipTextureObject_t& textureObject);
2660 template <
class T,
int dim, enum hipTextureReadMode readMode>
2661 hipError_t hipUnbindTexture(
struct texture<T, dim, readMode>& tex) {
2662 return ihipUnbindTextureImpl(tex.textureObject);
2666 hipError_t hipGetTextureAlignmentOffset(
size_t* offset,
const textureReference* texref);
2667 hipError_t hipGetTextureReference(
const textureReference** texref,
const void* symbol);
2669 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject,
const hipResourceDesc* pResDesc,
2673 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
2676 hipTextureObject_t textureObject);
2678 hipTextureObject_t textureObject);
2679 hipError_t hipGetTextureObjectTextureDesc(
hipTextureDesc* pTexDesc,
2680 hipTextureObject_t textureObject);
2683 hipError_t hipTexRefSetAddressMode(
textureReference* tex,
int dim, hipTextureAddressMode am);
2685 hipError_t hipTexRefSetFilterMode(
textureReference* tex, hipTextureFilterMode fm);
2689 hipError_t hipTexRefSetFormat(
textureReference* tex, hipArray_Format fmt,
int NumPackedComponents);
2691 hipError_t hipTexRefSetAddress(
size_t* offset,
textureReference* tex, hipDeviceptr_t devPtr,
2695 hipDeviceptr_t devPtr,
size_t pitch);
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
Definition: hip_memory.cpp:1923
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config) DEPRECATED(DEPRECATED_MSG)
Set Shared memory bank configuration.
Definition: hip_context.cpp:236
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:219
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
Definition: hip_module.cpp:457
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value...
Definition: hip_memory.cpp:1796
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:84
hipError_t hipCtxGetDevice(hipDevice_t *device) DEPRECATED(DEPRECATED_MSG)
Get the handle of the device associated with current/default context.
Definition: hip_context.cpp:194
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
Definition: hip_context.cpp:88
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
Definition: hip_error.cpp:41
hipError_t hipCtxGetCurrent(hipCtx_t *ctx) DEPRECATED(DEPRECATED_MSG)
Get the handle of the current/ default context.
Definition: hip_context.cpp:170
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_context.cpp:324
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
Definition: hip_context.cpp:299
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
Definition: hip_device.cpp:369
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Definition: hip_device.cpp:427
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx) DEPRECATED(DEPRECATED_MSG)
Disable direct access from current context's virtual address space to memory allocations physically l...
Definition: hip_peer.cpp:218
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
Definition: hip_memory.cpp:1986
hipError_t hipMemcpyToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1315
unsigned long long hipSurfaceObject_t
Definition: hip_surface_types.h:36
hipError_t hipCtxSetCurrent(hipCtx_t ctx) DEPRECATED(DEPRECATED_MSG)
Set the passed context as current/default.
Definition: hip_context.cpp:181
hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues)
builds module from code object which resides in host memory. Image is pointer to that location...
Definition: hip_module.cpp:574
Definition: driver_types.h:232
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
Definition: hip_memory.cpp:397
hipError_t hipMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipError_t hipMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1656
hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *userData, unsigned int flags)
Adds a callback to be called on the host after all currently enqueued items in the stream have comple...
Definition: hip_stream.cpp:195
hipError_t hipMemcpyFromArray(void *dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, size_t count, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1334
uint32_t x
x
Definition: hip_runtime_api.h:241
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1371
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device's virtual address space to memory allocations physically loc...
Definition: hip_peer.cpp:191
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
Definition: hip_error.cpp:54
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
Definition: hip_device.cpp:125
Definition: hip_runtime_api.h:137
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags) DEPRECATED(DEPRECATED_MSG)
Enables direct access to memory allocations in a peer context.
Definition: hip_peer.cpp:212
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:220
hipError_t hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
Definition: hip_memory.cpp:1958
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig) DEPRECATED(DEPRECATED_MSG)
Set Cache configuration for a specific function.
Definition: hip_context.cpp:220
hipError_t hipMemsetAsync(void *dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value val...
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
Definition: hip_event.cpp:167
Definition: driver_types.h:173
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1160
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
Definition: hip_module.cpp:98
Definition: hip_module.cpp:74
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
Definition: hip_event.cpp:257
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion) DEPRECATED(DEPRECATED_MSG)
Returns the approximate HIP api version.
Definition: hip_context.cpp:210
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
Definition: hip_peer.cpp:184
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:180
hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault))
Allocate an array on the device.
hipError_t hipMallocHost(void **ptr, size_t size) __attribute__((deprecated("use hipHostMalloc instead")))
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:332
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2007
Definition: hip_runtime_api.h:97
hipError_t hipMemset2DAsync(void *dst, size_t pitch, int value, size_t width, size_t height, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by dst with the constant value.
Definition: driver_types.h:107
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:265
Definition: hip_hcc_internal.h:880
Definition: texture_types.h:73
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
Definition: hip_device.cpp:96
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device) DEPRECATED(DEPRECATED_MSG)
Create a context and set it as current/ default context.
Definition: hip_context.cpp:55
hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location...
Definition: hip_module.cpp:555
Definition: driver_types.h:70
hipDeviceAttribute_t
Definition: hip_runtime_api.h:259
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
Definition: hip_event.cpp:155
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
Definition: hip_stream.cpp:73
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
Definition: hip_device.cpp:453
hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hipStream_t stream, void **kernelParams, void **extra)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
Definition: hip_runtime_api.h:240
uint32_t y
y
Definition: hip_runtime_api.h:242
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:738
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:560
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
Definition: hip_context.cpp:311
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
Definition: hip_event.cpp:97
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
Definition: hip_event.cpp:200
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_device.cpp:76
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
Definition: hip_peer.cpp:177
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:71
hipError_t hipMemset(void *dst, int value, size_t sizeBytes)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
Definition: hip_memory.cpp:1728
Definition: driver_types.h:245
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
Definition: hip_stream.cpp:152
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
Definition: hip_memory.cpp:878
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:141
hipError_t hipIpcOpenMemHandle(void **devPtr, hipIpcMemHandle_t handle, unsigned int flags)
Opens an interprocess memory handle exported from another process and returns a device pointer usable...
Definition: hip_memory.cpp:2043
hipError_t hipMemcpyToSymbol(const void *symbolName, const void *src, size_t sizeBytes, size_t offset __dparm(0), hipMemcpyKind kind __dparm(hipMemcpyHostToDevice))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: hip_memory.cpp:1198
hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by pitchedDevPtr with the constant value...
Definition: hip_runtime_api.h:229
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:217
hipError_t hipCtxPushCurrent(hipCtx_t ctx) DEPRECATED(DEPRECATED_MSG)
Push the context to be set as current/ default context.
Definition: hip_context.cpp:157
hipError_t hipCtxSynchronize(void) DEPRECATED(DEPRECATED_MSG)
Blocks until the default context has completed all preceding requested tasks.
Definition: hip_context.cpp:252
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
Definition: hip_memory.cpp:773
hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
Definition: hip_memory.cpp:1256
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
Definition: hip_device.cpp:144
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
Definition: hip_memory.cpp:1179
Defines the different newt vector types for HIP runtime.
hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copy data from src to dst asynchronously.
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
Definition: hip_device.cpp:381
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:316
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
Definition: hip_memory.cpp:906
Definition: driver_types.h:61
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:236
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
Definition: hip_error.cpp:48
hipError_t hipMemset2D(void *dst, size_t pitch, int value, size_t width, size_t height)
Fills the memory area pointed to by dst with the constant value.
Definition: hip_memory.cpp:1744
Definition: driver_types.h:225
hipFuncCache_t
Definition: hip_runtime_api.h:216
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to #hipSucces...
Definition: hip_error.cpp:32
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
Make the specified compute stream wait for an event.
Definition: hip_stream.cpp:87
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
Definition: hip_stream.cpp:180
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags) __attribute__((deprecated("use hipHostMalloc instead")))
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_memory.cpp:336
Defines surface types for HIP runtime.
hipError_t hipCtxPopCurrent(hipCtx_t *ctx) DEPRECATED(DEPRECATED_MSG)
Pop the current/default context and return the popped context.
Definition: hip_context.cpp:136
hipError_t hipMemGetInfo(size_t *free, size_t *total)
Query memory info. Return snapshot of free memory, and total allocatable memory on the device...
Definition: hip_memory.cpp:1832
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
Definition: hip_context.cpp:288
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
Definition: hip_memory.cpp:1891
uint32_t z
z
Definition: hip_runtime_api.h:243
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
Definition: hip_device.cpp:149
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
Definition: hip_context.cpp:42
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1390
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
Definition: hip_context.cpp:100
hipError_t hipFuncGetAttributes(hipFuncAttributes *attr, const void *func)
Definition: hip_module.cpp:507
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1353
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:176
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
Definition: hip_memory.cpp:1248
Definition: hip_runtime_api.h:83
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
Definition: hip_device.cpp:133
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
Definition: hip_context.cpp:73
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
Definition: hip_device.cpp:415
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:109
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:228
hipError_t hipMemcpyPeerAsync(void *dst, int dstDeviceId, const void *src, int srcDevice, size_t sizeBytes, hipStream_t stream __dparm(0))
Copies memory from one device to memory on another device.
hipSharedMemConfig
Definition: hip_runtime_api.h:227
Definition: hip_hcc_internal.h:700
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:289
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
Definition: hip_memory.cpp:1241
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig) DEPRECATED(DEPRECATED_MSG)
Set L1/Shared cache partition.
Definition: hip_context.cpp:228
hipError_t hipCtxGetFlags(unsigned int *flags) DEPRECATED(DEPRECATED_MSG)
Return flags used for creating default context.
Definition: hip_context.cpp:257
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:963
Definition: hip_hcc_internal.h:518
hipError_t hipMemcpyPeer(void *dst, int dstDeviceId, const void *src, int srcDeviceId, size_t sizeBytes)
Copies memory from one device to memory on another device.
Definition: hip_peer.cpp:198
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
Definition: hip_stream.cpp:80
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
Definition: hip_memory.cpp:1133
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:103
Definition: driver_types.h:82
Definition: hip_runtime_api.h:82
hipError_t hipFreeHost(void *ptr) __attribute__((deprecated("use hipHostFree instead")))
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:1956
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
Definition: hip_context.cpp:266
Definition: driver_types.h:201
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
Definition: hip_device.cpp:117
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
Definition: hip_device.cpp:32
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
Definition: hip_event.cpp:110
hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *name)
returns device memory pointer and size of the kernel present in the module with symbol name ...
Definition: hip_module.cpp:462
Definition: hip_hcc_internal.h:367
hipError_t hipDeviceGetPCIBusId(char *pciBusId, int len, int device)
Returns a PCI Bus Id string for the device, overloaded to take int device ID.
Definition: hip_device.cpp:395
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:218
hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1263
hipError_t hipStreamQuery(hipStream_t stream)
Return #hipSuccess if all of the operations in the specified stream have completed, or #hipErrorNotReady if not.
Definition: hip_stream.cpp:118
Definition: hip_runtime_api.h:231
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2073
hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
Definition: hip_memory.cpp:1780
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig) DEPRECATED(DEPRECATED_MSG)
Get Shared memory bank configuration.
Definition: hip_context.cpp:244
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
Definition: hip_memory.cpp:158
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem, hipStream_t stream)
Configure a kernel launch.
Definition: hip_clang.cpp:163
hipError_t hipMemcpyToSymbolAsync(const void *symbolName, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
hipError_t hipCtxDestroy(hipCtx_t ctx) DEPRECATED(DEPRECATED_MSG)
Destroy a HIP context.
Definition: hip_context.cpp:112
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2409
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2399
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:193
Definition: texture_types.h:93