The Tutorial and API Reference of VEDA  3.3.0
VERA API

To use VERA API functions, include "vera.h" header. More...

Functions

const char * veraGetErrorName (veraError_t error)
 Returns the string representation of an error code enum name. More...
 
const char * veraGetErrorString (veraError_t error)
 Returns the description string for an error code. More...
 
veraError_t veraDeviceGetAttribute (int *value, veraDeviceAttr attr, int device)
 Returns information about the VEDA device. More...
 
veraError_t veraDeviceGetPower (float *temp, int device)
 Returns a VE device power corresponding to VEDA Device. More...
 
veraError_t veraDeviceGetTemp (float *temp, const int coreIdx, int device)
 Retrieve the core temperature of the VEDA device in Celsius. More...
 
veraError_t veraDeviceSynchronize (void)
 Block for a context's tasks to complete. More...
 
veraError_t veraDriverGetVersion (const char **driverVersion)
 Return the latest AVEO version supported by VEDA. More...
 
veraError_t veraFree (void *devPtr)
 Frees device memory. More...
 
veraError_t veraFreeAsync (void *devPtr, veraStream_t stream=0)
 Frees device memory with stream ordered semantics. More...
 
veraError_t veraFreeHost (void *ptr)
 Frees host memory. More...
 
veraError_t veraGetDevice (int *device)
 Returns the device ID for the current context. More...
 
veraError_t veraGetDeviceCount (int *count)
 Retrieve the number of initializaed VEDA device. More...
 
veraError_t veraHostAlloc (void **pHost, size_t size, unsigned int flags)
 Allocates host memory. More...
 
veraError_t veraLaunchHostFunc (veraStream_t stream, veraHostFn_t fn, void *userData)
 Enqueues a host function call in a stream. More...
 
veraError_t veraLaunchHostFuncEx (veraStream_t stream, veraHostFn_t fn, void *userData, uint64_t *result)
 Enqueues a host function call in a stream. More...
 
veraError_t veraMalloc (void **devPtr, size_t size)
 Allocates VEDA device memory. More...
 
veraError_t veraMallocAsync (void **devPtr, size_t size, veraStream_t stream=0)
 Allocates memory with stream ordered semantics. More...
 
veraError_t veraMallocHost (void **ptr, size_t size)
 Allocates host memory. More...
 
veraError_t veraMallocPitch (void **devPtr, size_t *pitch, size_t width, size_t height)
 Allocates pitched device memory. More...
 
veraError_t veraMemGetInfo (size_t *free, size_t *total)
 Gets free and total memory. More...
 
veraError_t veraMemset (void *devPtr, int value, size_t count)
 Initializes device memory. More...
 
veraError_t veraMemsetAsync (void *devPtr, int value, size_t count, veraStream_t stream=0)
 Initializes device memory. More...
 
veraError_t veraModuleGetFunction (veraFunction_t *func, veraModule_t mod, const char *name)
 Return the VE address of the VEDA device function located in VEDA module. More...
 
veraError_t veraModuleUnload (veraModule_t mod)
 To unload/remove the VE device code from the VE memory. More...
 
veraError_t veraModuleLoad (veraModule_t *mod, const char *name)
 To load the VE device code into the VE memory. More...
 
veraError_t veraRuntimeGetVersion (const char **runtimeVersion)
 Return the latest AVEO version supported by VEDA. More...
 
veraError_t veraStreamCnt (int *cnt)
 Gets the VEDA SM count. More...
 
veraError_t veraStreamQuery (veraStream_t stream)
 Determine status of a compute stream. More...
 
veraError_t veraStreamSynchronize (veraStream_t stream)
 Wait until a stream's tasks are completed. More...
 
veraExtent make_veraExtent (size_t w, size_t h, size_t d)
 Returns a veraExtent based on input parameters. More...
 
veraPitchedPtr make_veraPitchedPtr (void *d, size_t p, size_t xsz, size_t ysz)
 Returns a veraPitchedPtr based on input parameters. More...
 
veraError_t veraInit (void)
 Initialize the VEDA driver API library. More...
 
veraError_t veraGetDeviceProperties (veraDeviceProp *prop, int device)
 Returns information about the VEDA device. More...
 
veraError_t veraStreamAddCallback (veraStream_t stream, veraStreamCallback_t callback, void *userData, unsigned int flags)
 Add a callback to a compute stream. More...
 
veraError_t veraMemcpy (void *dst, const void *src, size_t count, veraMemcpyKind kind)
 Copies Memory from source to destination as per kind value. More...
 
veraError_t veraMemcpyAsync (void *dst, const void *src, size_t count, veraMemcpyKind kind, veraStream_t stream)
 Copies Memory asynchronously from source to destination as per kind value. More...
 
veraError_t veraDeviceReset (void)
 This function is not yet implemented. More...
 
veraError_t veraMalloc3D (veraPitchedPtr *pitchedDevPtr, veraExtent extent)
 This function is not yet implemented. More...
 
veraError_t veraMemcpy2D (void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, veraMemcpyKind kind)
 This function is not yet implemented. More...
 
veraError_t veraMemcpy2DAsync (void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, veraMemcpyKind kind, veraStream_t stream)
 This function is not yet implemented. More...
 
veraError_t veraMemset2D (void *devPtr, size_t pitch, int value, size_t width, size_t height)
 This function is not yet implemented. More...
 
veraError_t veraMemset2DAsync (void *devPtr, size_t pitch, int value, size_t width, size_t height, veraStream_t stream)
 This function is not yet implemented. More...
 
veraError_t veraMemset3D (veraPitchedPtr pitchedDevPtr, int value, veraExtent extent)
 This function is not yet implemented. More...
 
veraError_t veraMemset3DAsync (veraPitchedPtr pitchedDevPtr, int value, veraExtent extent, veraStream_t stream)
 This function is not yet implemented. More...
 
veraError_t veraSetValidDevices (int *device_arr, int len)
 This function is not yet implemented. More...
 
veraError_t veraPointerGetAttributes (veraPointerAttributes *attributes, const void *ptr)
 Returns attributes about a specified pointer. More...
 
veraError_t veraSetDevice (int device)
 Set device to be used for device executions. More...
 

Detailed Description

To use VERA API functions, include "vera.h" header.

Function Documentation

const char* veraGetErrorName ( veraError_t  error)
inline

Returns the string representation of an error code enum name.

Parameters
errorError code to convert to string
Returns
Returns the string representation of an error code enum name.

Returns a string containing the name of an error code in the enum. If the error code is not recognized, "unrecognized error code" is returned.

const char* veraGetErrorString ( veraError_t  error)
inline

Returns the description string for an error code.

Parameters
errorError code to convert to string
Returns
Returns the description string for an error code.

Returns the description string for an error code. If the error code is not recognized, "unrecognized error code" is returned.

veraError_t veraDeviceGetAttribute ( int *  value,
veraDeviceAttr  attr,
int  device 
)
inline

Returns information about the VEDA device.

Parameters
valueReturned VEDA device attribute value.
attrVEDA Device attribute to query.
deviceVEDA device handle.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.

Returns in *pi the integer value of the attribute attrib on device dev. The supported attributes are:
VEDA_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO: VEDA precision ratio.
VEDA_DEVICE_ATTRIBUTE_CLOCK_RATE: Clock chip clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_CLOCK_BASE: Clock Base clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT: Number of VE cores corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE: Clock memory clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_L1D_CACHE_SIZE: Size of the L1 cache of the device of VEDA device.
VEDA_DEVICE_ATTRIBUTE_L1I_CACHE_SIZE: Size of L1 instruction cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_L2_CACHE_SIZE: Size of L2 data cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_LLC_CACHE_SIZE: Size of last level cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_MODEL: VE device model corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_ABI_VERSION: VE device ABI version corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_FIREWARE_VERSION: VE device firmware version corresponding to VEDA device.

veraError_t veraDeviceGetPower ( float *  temp,
int  device 
)
inline

Returns a VE device power corresponding to VEDA Device.

Parameters
temppointer to hold the VE device power.
deviceVEDA device handle.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.

Calculated VE device power includes both the PCIe edge power as well as the VE device AUX power with added 5W.

veraError_t veraDeviceGetTemp ( float *  temp,
const int  coreIdx,
int  device 
)
inline

Retrieve the core temperature of the VEDA device in Celsius.

Parameters
temppointer to hold the core temperature.
coreIdxCore index of the VEDA device.
deviceVEDA device ID.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
veraError_t veraDeviceSynchronize ( void  )
inline

Block for a context's tasks to complete.

Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Blocks until the device has completed all preceding requested tasks.
vedaCtxSynchronize() returns an error if one of the preceding tasks failed.

veraError_t veraDriverGetVersion ( const char **  driverVersion)
inline

Return the latest AVEO version supported by VEDA.

Parameters
driverVersionPointer to hold the AVEO version.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
veraError_t veraFree ( void *  devPtr)
inline

Frees device memory.

Parameters
devPtrPointer to memory to free.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Frees the memory space pointed to by dptr, which must have been returned by a previous call to vedaMemAlloc() or vedaMemAllocPitch().

veraError_t veraFreeAsync ( void *  devPtr,
veraStream_t  stream = 0 
)
inline

Frees device memory with stream ordered semantics.

Parameters
devPtrPointer to memory to free.
streamThe stream establishing the stream ordering contract.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Inserts a free operation into stream. The allocation must not be accessed after stream execution reaches the free. After this API returns, accessing the memory from any subsequent work launched on the VEDA device or querying its pointer attributes results in undefined behavior.

veraError_t veraFreeHost ( void *  ptr)
inline

Frees host memory.

Parameters
ptrPointer to memory to free.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Frees the memory space pointed to by dptr, which must have been returned by a previous call to vedaMemAllocHost().

veraError_t veraGetDevice ( int *  device)
inline

Returns the device ID for the current context.

Parameters
deviceReturned device ID for the current context.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Returns in *device the ordinal of the current context's device.

veraError_t veraGetDeviceCount ( int *  count)
inline

Retrieve the number of initializaed VEDA device.

Parameters
countpointer to hold the count of the VEDA device.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
veraError_t veraHostAlloc ( void **  pHost,
size_t  size,
unsigned int  flags 
)
inline

Allocates host memory.

Parameters
pHostReturned host pointer
sizeRequested allocation size in bytes.
flags
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.
VEDA_ERROR_OUT_OF_MEMORYHost memory exausted.
veraError_t veraLaunchHostFunc ( veraStream_t  stream,
veraHostFn_t  fn,
void *  userData 
)
inline

Enqueues a host function call in a stream.

Parameters
streamStream Identifier.
fnThe function to call once preceding stream operations are complete.
userDataUser-specified data to be passed to the function.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work added after it.

veraError_t veraLaunchHostFuncEx ( veraStream_t  stream,
veraHostFn_t  fn,
void *  userData,
uint64_t *  result 
)
inline

Enqueues a host function call in a stream.

Parameters
streamStream Identifier.
fnThe function to call once preceding stream operations are complete.
userDataUser-specified data to be passed to the function.
resultreturn-value future
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work added after it.

veraError_t veraMalloc ( void **  devPtr,
size_t  size 
)
inline

Allocates VEDA device memory.

Parameters
devPtrReturned VEDA device pointer
sizeRequested allocation size in bytes.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.
VEDA_ERROR_OUT_OF_MEMORYVEDA device memory exausted.

Allocates size bytes of linear memory on the VEDA device and returns in *ptr a pointer to the allocated memory.

veraError_t veraMallocAsync ( void **  devPtr,
size_t  size,
veraStream_t  stream = 0 
)
inline

Allocates memory with stream ordered semantics.

Parameters
devPtrReturned VEDA device pointer
sizeRequested allocation size in bytes.
streamThe stream establishing the stream ordering contract and the memory pool to allocate from
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.
VEDA_ERROR_OUT_OF_MEMORYVEDA device memory exausted.

Inserts an allocation operation into stream. A pointer to the allocated memory is returned immediately in *ptr. The allocation must not be accessed until the the allocation operation completes.

veraError_t veraMallocHost ( void **  ptr,
size_t  size 
)
inline

Allocates host memory.

Parameters
ptrReturned host pointer
sizeRequested allocation size in bytes.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.
VEDA_ERROR_OUT_OF_MEMORYHost memory exausted.
veraError_t veraMallocPitch ( void **  devPtr,
size_t *  pitch,
size_t  width,
size_t  height 
)
inline

Allocates pitched device memory.

Parameters
devPtrReturned device pointer
pitchReturned pitch of allocation in bytes.
widthRequested allocation width in bytes
heightRequested allocation height in rows
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.
VEDA_ERROR_OUT_OF_MEMORYHost memory exausted.

Allocates at least WidthInBytes * Height bytes of linear memory on the device and returns in *dptr a pointer to the allocated memory. The pitch returned in *pPitch by vedaMemAllocPitch() is the width in bytes of the allocation.

veraError_t veraMemGetInfo ( size_t *  free,
size_t *  total 
)
inline

Gets free and total memory.

Parameters
freeReturned free memory in bytes.
totalReturned total memory in bytes.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Returns in *total the total amount of memory available to the the current context. Returns in *free the amount of memory on the VEDA device that is free.

veraError_t veraMemset ( void *  devPtr,
int  value,
size_t  count 
)
inline

Initializes device memory.

Parameters
devPtrDestination device pointer.
valueValue to set.
countNumber of Elements.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Sets the memory range of N 32-bit values to the specified value us.

veraError_t veraMemsetAsync ( void *  devPtr,
int  value,
size_t  count,
veraStream_t  stream = 0 
)
inline

Initializes device memory.

Parameters
devPtrDestination device pointer.
valueValue to set.
countNumber of Elements.
streamThe stream establishing the stream ordering contract.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Sets the memory range of N 32-bit values to the specified value us.

veraError_t veraModuleGetFunction ( veraFunction_t *  func,
veraModule_t  mod,
const char *  name 
)
inline

Return the VE address of the VEDA device function located in VEDA module.

Parameters
funcBuffer to hold the VE address of the VEDA device function.
modhandle to the VEDA module corresponding to the VE device code.
nameName of the VEDA device function for which the VE address is required.
Returns
VEDA_SUCCESS on Success
VEDA_ERROR_NOT_INITIALIZED If VEDA device is not initialized.
VEDA_ERROR_INVALID_VALUE In case the name of the VEDA device function is passed as NULL.
VEDA_ERROR_FUNCTION_NOT_FOUND Internal error from the AVEO library
veraError_t veraModuleUnload ( veraModule_t  mod)
inline

To unload/remove the VE device code from the VE memory.

Parameters
modPointer to the VEDA module corresponding to the VE device code..
Returns
VEDA_SUCCESS on Success
VEDA_ERROR_NOT_INITIALIZED If VEDA device is not initialized.
VEDA_ERROR_UNKOWN_CONTEXT If VEDA context is not initialized.
veraError_t veraModuleLoad ( veraModule_t *  mod,
const char *  name 
)
inline

To load the VE device code into the VE memory.

Parameters
modPointer to hold the reference of the VEDA module.
nameLibrary name of the file name containing VE device code.
Returns
VEDA_SUCCESS on Success
VEDA_ERROR_NOT_INITIALIZED If VEDA device is not initialized.
VEDA_ERROR_INVALID_VALUE If the provided VE library name is not valid.
VEDA_ERROR_MODULE_NOT_FOUND Internal error from the AVEO library
veraError_t veraRuntimeGetVersion ( const char **  runtimeVersion)
inline

Return the latest AVEO version supported by VEDA.

Parameters
runtimeVersionPointer to hold the AVEO version.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
veraError_t veraStreamCnt ( int *  cnt)
inline

Gets the VEDA SM count.

Parameters
cntpointer to hold the VEDA SM count.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Returns the VEDA SM count of the VEDA context bound to the calling CPU thread.

veraError_t veraStreamQuery ( veraStream_t  stream)
inline

Determine status of a compute stream.

Parameters
streamDetermine status of a compute stream.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Returns CUDA_SUCCESS if all operations in the stream specified by hStream have completed

veraError_t veraStreamSynchronize ( veraStream_t  stream)
inline

Wait until a stream's tasks are completed.

Parameters
streamDetermine status of a compute stream.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Waits until the device has completed all operations in the stream specified by hStream.

veraExtent make_veraExtent ( size_t  w,
size_t  h,
size_t  d 
)
inline

Returns a veraExtent based on input parameters.

Parameters
wWidth in elements when referring to array memory, in bytes when referring to linear memory
hHeight in elements
dDepth in elements
Returns
Returns a veraExtent based on input parameters.

Returns a veraExtent based on the specified input parameters w, h, and d.

veraPitchedPtr make_veraPitchedPtr ( void *  d,
size_t  p,
size_t  xsz,
size_t  ysz 
)
inline

Returns a veraPitchedPtr based on input parameters.

Parameters
dPointer to allocated memory
pPitch of allocated memory in bytes
xszLogical width of allocation in elements
yszLogical height of allocation in elements
Returns
Returns a veraPitchedPtr based on input parameters

Returns a veraPitchedPtr based on the specified input parameters d, p, xsz, and ysz.

veraError_t veraInit ( void  )

Initialize the VEDA driver API library.

Return values
VEDA_SUCCESSon Success

Initializes the driver API and it is optional to call when you are using other VERA APIs because it is being called at the begining of other vera APIs, calling multiple times don't make any effect.

veraError_t veraGetDeviceProperties ( veraDeviceProp *  prop,
int  device 
)

Returns information about the VEDA device.

Parameters
propReturned VEDA device attribute value.
deviceVEDA device handle.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.

Returns in *pi the integer value of the attribute attrib on device dev. The supported attributes are: VEDA_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO: VEDA precision ratio.
VEDA_DEVICE_ATTRIBUTE_CLOCK_RATE: Clock chip clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_CLOCK_BASE: Clock Base clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT: Number of VE cores corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE: Clock memory clock frequency of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_L1D_CACHE_SIZE: Size of the L1 cache of the device of VEDA device.
VEDA_DEVICE_ATTRIBUTE_L1I_CACHE_SIZE: Size of L1 instruction cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_L2_CACHE_SIZE: Size of L2 data cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_LLC_CACHE_SIZE: Size of last level cache of the VEDA device.
VEDA_DEVICE_ATTRIBUTE_MODEL: VE device model corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_ABI_VERSION: VE device ABI version corresponding to VEDA device.
VEDA_DEVICE_ATTRIBUTE_FIREWARE_VERSION: VE device firmware version corresponding to VEDA device.

veraError_t veraStreamAddCallback ( veraStream_t  stream,
veraStreamCallback_t  callback,
void *  userData,
unsigned int  flags 
)

Add a callback to a compute stream.

Parameters
streamDetermine status of a compute stream.
callbackThe function to call once preceding stream operations are complete.
userDataUser specified data to be passed to the callback function.
flagsReserved for future use, must be 0.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Adds a callback to be called on the host after all currently enqueued items in the stream have completed.

veraError_t veraMemcpy ( void *  dst,
const void *  src,
size_t  count,
veraMemcpyKind  kind 
)

Copies Memory from source to destination as per kind value.

Parameters
dstDestination virtual address pointer.
srcSource virtual address pointer.
countSize of memory copy in bytes.
kindvalue can be veraMemcpyHostToHost, veraMemcpyHostToDevice, veraMemcpyDeviceToHost, veraMemcpyDeviceToDevice.
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Copies from source memory to destination memory. dst and src are the base pointers of the destination and source, respectively. count specifies the number of bytes to copy.

veraError_t veraMemcpyAsync ( void *  dst,
const void *  src,
size_t  count,
veraMemcpyKind  kind,
veraStream_t  stream 
)

Copies Memory asynchronously from source to destination as per kind value.

Parameters
dstDestination virtual address pointer.
srcSource virtual address pointer.
countSize of memory copy in bytes.
kindvalue can be veraMemcpyHostToHost, veraMemcpyHostToDevice, veraMemcpyDeviceToHost, veraMemcpyDeviceToDevice.
streamStream identifier
Return values
VEDA_SUCCESSon Success
VEDA_ERROR_NOT_INITIALIZEDVEDA library not initialized
VEDA_ERROR_INVALID_DEVICEVEDA device id is not valid.
VEDA_ERROR_UNKNOWN_CONTEXTVEDA context is not set for the calling thread.
VEDA_ERROR_CONTEXT_IS_DESTROYEDVEDA current context is already destroyed.

Copies from source memory to destination memory. dst and src are the base pointers of the destination and source, respectively. count specifies the number of bytes to copy.

veraError_t veraDeviceReset ( void  )

This function is not yet implemented.

Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMalloc3D ( veraPitchedPtr *  pitchedDevPtr,
veraExtent  extent 
)

This function is not yet implemented.

Parameters
pitchedDevPtr
extent
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemcpy2D ( void *  dst,
size_t  dpitch,
const void *  src,
size_t  spitch,
size_t  width,
size_t  height,
veraMemcpyKind  kind 
)

This function is not yet implemented.

Parameters
dst
dpitch
src
spitch
width
height
kind
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemcpy2DAsync ( void *  dst,
size_t  dpitch,
const void *  src,
size_t  spitch,
size_t  width,
size_t  height,
veraMemcpyKind  kind,
veraStream_t  stream 
)

This function is not yet implemented.

Parameters
dst
dpitch
src
spitch
width
height
kind
stream
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemset2D ( void *  devPtr,
size_t  pitch,
int  value,
size_t  width,
size_t  height 
)

This function is not yet implemented.

Parameters
devPtr
pitch
value
width
height
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemset2DAsync ( void *  devPtr,
size_t  pitch,
int  value,
size_t  width,
size_t  height,
veraStream_t  stream 
)

This function is not yet implemented.

Parameters
devPtr
pitch
value
width
height
stream
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemset3D ( veraPitchedPtr  pitchedDevPtr,
int  value,
veraExtent  extent 
)

This function is not yet implemented.

Parameters
pitchedDevPtr
value
extent
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraMemset3DAsync ( veraPitchedPtr  pitchedDevPtr,
int  value,
veraExtent  extent,
veraStream_t  stream 
)

This function is not yet implemented.

Parameters
pitchedDevPtr
value
extent
stream
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraSetValidDevices ( int *  device_arr,
int  len 
)

This function is not yet implemented.

Parameters
device_arr
len
Returns
VEDA_ERROR_NOT_IMPLEMENTED
veraError_t veraPointerGetAttributes ( veraPointerAttributes *  attributes,
const void *  ptr 
)

Returns attributes about a specified pointer.

Parameters
attributesAttributes for the specified pointer
ptrPointer to get attributes for
Returns
VEDA_SUCCESS on Success
VEDA_ERROR_INVALID_DEVICE If the provided VEDA device id is not valid.
VEDA_ERROR_INVALID_VALUE If the provided ptr is invalid.
veraError_t veraSetDevice ( int  device)

Set device to be used for device executions.

Parameters
deviceDevice on which the active host thread should execute the device code.
Returns
VEDA_SUCCESS on Success
VEDA_ERROR_INVALID_DEVICE If the provided VEDA device id is not valid.
VEDA_ERROR_NOT_INITIALIZED If VEDA device is not initialized.

Sets device as the current device for the calling host thread.