HIP: Heterogenous-computing Interface for Portability
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
hip_runtime_api.h File Reference

Contains C function APIs for HIP runtime. This file does not use any HCC builtin or special language extensions (-hc mode) ; those functions in hip_runtime.h. More...

#include <stdint.h>
#include <stddef.h>
#include <hcc_detail/host_defines.h>
#include <hc.hpp>

Go to the source code of this file.

Classes

struct  dim3
 
struct  hipEvent_t
 

Macros

#define hipStreamDefault   0x00
 Flags that can be used with hipStreamCreateWithFlags. More...
 
#define hipStreamNonBlocking   0x01
 Stream does not implicitly synchronize with null stream.
 
#define hipEventDefault   0x0
 Flags that can be used with hipEventCreateWithFlags: More...
 
#define hipEventBlockingSync   0x1
 Waiting will yield CPU. Power-friendly and usage-friendly but may increase latency.
 
#define hipEventDisableTiming   0x2
 Disable event's capability to record timing information. May improve performance.
 
#define hipEventInterprocess   0x4
 Event can support IPC. More...
 

Typedefs

typedef enum hipFuncCache hipFuncCache
 
typedef enum hipSharedMemConfig hipSharedMemConfig
 
typedef struct dim3 dim3
 
typedef struct ihipStream_thipStream_t
 
typedef struct hipEvent_t hipEvent_t
 

Enumerations

enum  hipFuncCache { hipFuncCachePreferNone, hipFuncCachePreferShared, hipFuncCachePreferL1, hipFuncCachePreferEqual }
 
enum  hipSharedMemConfig { hipSharedMemBankSizeDefault, hipSharedMemBankSizeFourByte, hipSharedMemBankSizeEightByte }
 
enum  hipMemcpyKind {
  hipMemcpyHostToHost = 0, hipMemcpyHostToDevice = 1, hipMemcpyDeviceToHost = 2, hipMemcpyDeviceToDevice =3,
  hipMemcpyDefault = 4
}
 

Functions

hipError_t hipDeviceSynchronize (void)
 Blocks until the default device has completed all preceding requested tasks. More...
 
hipError_t hipDeviceReset (void)
 Destroy all resources and reset all state on the default device in the current process. More...
 
hipError_t hipSetDevice (int device)
 Set default device to be used for subsequent hip API calls from this thread. More...
 
hipError_t hipGetDevice (int *device)
 Return the default device id for the calling host thread. More...
 
hipError_t hipGetDeviceCount (int *count)
 Return number of compute-capable devices. More...
 
hipError_t hipDeviceGetAttribute (int *pi, hipDeviceAttribute_t attr, int device)
 Query device attribute. More...
 
hipError_t hipDeviceGetProperties (hipDeviceProp_t *prop, int device)
 Returns device properties. More...
 
hipError_t hipDeviceSetCacheConfig (hipFuncCache cacheConfig)
 Set L1/Shared cache partition. More...
 
hipError_t hipDeviceGetCacheConfig (hipFuncCache *cacheConfig)
 Set Cache configuration for a specific function. More...
 
hipError_t hipFuncSetCacheConfig (hipFuncCache config)
 Set Cache configuration for a specific function. More...
 
hipError_t hipDeviceGetSharedMemConfig (hipSharedMemConfig *pConfig)
 Get Shared memory bank configuration. More...
 
hipError_t hipDeviceSetSharedMemConfig (hipSharedMemConfig config)
 Set Shared memory bank configuration. More...
 
hipError_t hipGetLastError (void)
 Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess. More...
 
hipError_t hipPeekAtLastError (void)
 Return last error returned by any HIP runtime API call. More...
 
const char * hipGetErrorName (hipError_t hip_error)
 Return name of the specified error code in text form. More...
 
const char * hipGetErrorString (hipError_t hip_error)
 Return handy text string message to explain the error which occurred. More...
 
hipError_t hipStreamCreateWithFlags (hipStream_t *stream, unsigned int flags)
 Create an asynchronous stream. More...
 
hipError_t hipStreamWaitEvent (hipStream_t stream, hipEvent_t event, unsigned int flags)
 Make the specified compute stream wait for an event. More...
 
hipError_t hipStreamSynchronize (hipStream_t stream)
 Wait for all commands in stream to complete. More...
 
hipError_t hipStreamDestroy (hipStream_t stream)
 Destroys the specified stream. More...
 
hipError_t hipStreamGetFlags (hipStream_t stream, unsigned int *flags)
 Return flags associated with this stream. More...
 
hipError_t hipEventCreateWithFlags (hipEvent_t *event, unsigned flags)
 Create an event with the specified flags. More...
 
hipError_t hipEventRecord (hipEvent_t event, hipStream_t stream=NULL)
 Record an event in the specified stream. More...
 
hipError_t hipEventDestroy (hipEvent_t event)
 Destroy the specified event. More...
 
hipError_t hipEventSynchronize (hipEvent_t event)
 : Wait for an event to complete. More...
 
hipError_t hipEventElapsedTime (float *ms, hipEvent_t start, hipEvent_t stop)
 Return the elapsed time between two events. More...
 
hipError_t hipEventQuery (hipEvent_t event)
 Query event status. More...
 
hipError_t hipMalloc (void **ptr, size_t size)
 Allocate memory on the default accelerator. More...
 
hipError_t hipMallocHost (void **ptr, size_t size)
 Allocate pinned host memory. More...
 
hipError_t hipFree (void *ptr)
 Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSynchronize() call. More...
 
hipError_t hipFreeHost (void *ptr)
 Free memory allocated by the hcc hip host memory allocation API. More...
 
hipError_t hipMemcpy (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
 Copy data from src to dst. More...
 
hipError_t hipMemcpyToSymbol (const char *symbolName, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind)
 Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset bytes from the start of symbol symbol. More...
 
hipError_t hipMemcpyAsync (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream=0)
 Copy data from src to dst asynchronously. More...
 
hipError_t hipMemset (void *dst, int value, size_t sizeBytes)
 Copy data from src to dst asynchronously. More...
 
hipError_t hipMemsetAsync (void *dst, int value, size_t sizeBytes, hipStream_t=0)
 Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value value. More...
 
hipError_t hipMemGetInfo (size_t *free, size_t *total)
 
hipError_t hipDeviceCanAccessPeer (int *canAccessPeer, int device, int peerDevice)
 Determine if a device can access a peer's memory. More...
 
hipError_t hipDeviceDisablePeerAccess (int peerDevice)
 Disables registering memory on peerDevice for direct access from the current device. More...
 
hipError_t hipDeviceEnablePeerAccess (int peerDevice, unsigned int flags)
 Enables registering memory on peerDevice for direct access from the current device. More...
 
hipError_t hipMemcpyPeer (void *dst, int dstDevice, const void *src, int srcDevice, size_t sizeBytes)
 Copies memory from one device to memory on another device. More...
 
hipError_t hipMemcpyPeerAsync (void *dst, int dstDevice, const void *src, int srcDevice, size_t sizeBytes, hipStream_t stream=0)
 Copies memory from one device to memory on another device. More...
 
hipError_t hipDriverGetVersion (int *driverVersion)
 Returns the approximate HIP driver version. More...
 
hipError_t hipHccGetAccelerator (int deviceId, hc::accelerator *acc)
 Return hc::accelerator associated with the specified deviceId. More...
 
hipError_t hipHccGetAcceleratorView (hipStream_t stream, hc::accelerator_view **av)
 Return hc::accelerator_view associated with the specified stream. More...
 

Detailed Description

Contains C function APIs for HIP runtime. This file does not use any HCC builtin or special language extensions (-hc mode) ; those functions in hip_runtime.h.