Advanced Multi-Physics (AMP)
On-Line Documentation
Namespaces | Macros | Functions
Helper_Hip.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hip/hip_runtime.h>
#include "AMP/utils/UtilityMacros.h"
#include "StackTrace/source_location.h"
Include dependency graph for Helper_Hip.h:

Go to the source code of this file.

Namespaces

namespace  AMP
 
namespace  AMP::Utilities
 

Macros

#define deviceBind(...)   checkHipErrors( hipSetDevice( __VA_ARGS__ ) )
 
#define deviceFree(...)   checkHipErrors( hipFree( __VA_ARGS__ ) )
 
#define deviceGetCount(...)   checkHipErrors( hipGetDeviceCount( __VA_ARGS__ ) )
 
#define deviceId(...)   checkHipErrors( hipGetDevice( __VA_ARGS__ ) )
 
#define deviceInit(...)   checkHipErrors( hipInit( __VA_ARGS__ ) )
 
#define deviceMalloc(...)   checkHipErrors( hipMalloc( __VA_ARGS__ ) )
 
#define deviceMallocManaged(...)   checkHipErrors( hipMallocManaged( __VA_ARGS__ ) )
 
#define deviceMemAttachGlobal   hipMemAttachGlobal
 
#define deviceMemcpy(...)   checkHipErrors( hipMemcpy( __VA_ARGS__ ) )
 
#define deviceMemcpyDeviceToDevice   hipMemcpyDeviceToDevice
 
#define deviceMemcpyDeviceToHost   hipMemcpyDeviceToHost
 
#define deviceMemcpyHostToDevice   hipMemcpyHostToDevice
 
#define deviceMemPrefetchAsync(...)   checkHipErrors( hipMemPrefetchAsync( __VA_ARGS__ ) )
 
#define deviceMemset(...)   checkHipErrors( hipMemset( __VA_ARGS__ ) )
 
#define deviceSynchronize()   checkHipErrors( hipDeviceSynchronize() )
 
#define hostDeviceId   hipCpuDeviceId
 

Functions

template<typename T >
void checkHipErrors (T result, const StackTrace::source_location &source=SOURCE_LOCATION_CURRENT())
 
AMP::Utilities::MemoryType getHipMemoryType (const void *ptr)
 
void getLastDeviceError (const char *errorMessage, const StackTrace::source_location &source=SOURCE_LOCATION_CURRENT())
 
template<typename T >
const char * hipGetName (T result)
 
static void setKernelDims (size_t n, dim3 &BlockDim, dim3 &GridDim)
 

Macro Definition Documentation

◆ deviceBind

#define deviceBind (   ...)    checkHipErrors( hipSetDevice( __VA_ARGS__ ) )

Definition at line 23 of file Helper_Hip.h.

◆ deviceFree

#define deviceFree (   ...)    checkHipErrors( hipFree( __VA_ARGS__ ) )

Definition at line 30 of file Helper_Hip.h.

◆ deviceGetCount

#define deviceGetCount (   ...)    checkHipErrors( hipGetDeviceCount( __VA_ARGS__ ) )

Definition at line 22 of file Helper_Hip.h.

◆ deviceId

#define deviceId (   ...)    checkHipErrors( hipGetDevice( __VA_ARGS__ ) )

Definition at line 24 of file Helper_Hip.h.

◆ deviceInit

#define deviceInit (   ...)    checkHipErrors( hipInit( __VA_ARGS__ ) )

Definition at line 21 of file Helper_Hip.h.

◆ deviceMalloc

#define deviceMalloc (   ...)    checkHipErrors( hipMalloc( __VA_ARGS__ ) )

Definition at line 26 of file Helper_Hip.h.

◆ deviceMallocManaged

#define deviceMallocManaged (   ...)    checkHipErrors( hipMallocManaged( __VA_ARGS__ ) )

Definition at line 27 of file Helper_Hip.h.

◆ deviceMemAttachGlobal

#define deviceMemAttachGlobal   hipMemAttachGlobal

Definition at line 15 of file Helper_Hip.h.

◆ deviceMemcpy

#define deviceMemcpy (   ...)    checkHipErrors( hipMemcpy( __VA_ARGS__ ) )

Definition at line 28 of file Helper_Hip.h.

◆ deviceMemcpyDeviceToDevice

#define deviceMemcpyDeviceToDevice   hipMemcpyDeviceToDevice

Definition at line 19 of file Helper_Hip.h.

◆ deviceMemcpyDeviceToHost

#define deviceMemcpyDeviceToHost   hipMemcpyDeviceToHost

Definition at line 18 of file Helper_Hip.h.

◆ deviceMemcpyHostToDevice

#define deviceMemcpyHostToDevice   hipMemcpyHostToDevice

Definition at line 17 of file Helper_Hip.h.

◆ deviceMemPrefetchAsync

#define deviceMemPrefetchAsync (   ...)    checkHipErrors( hipMemPrefetchAsync( __VA_ARGS__ ) )

Definition at line 31 of file Helper_Hip.h.

◆ deviceMemset

#define deviceMemset (   ...)    checkHipErrors( hipMemset( __VA_ARGS__ ) )

Definition at line 29 of file Helper_Hip.h.

◆ deviceSynchronize

#define deviceSynchronize ( )    checkHipErrors( hipDeviceSynchronize() )

Definition at line 25 of file Helper_Hip.h.

◆ hostDeviceId

#define hostDeviceId   hipCpuDeviceId

Definition at line 13 of file Helper_Hip.h.

Function Documentation

◆ checkHipErrors()

template<typename T >
void checkHipErrors ( result,
const StackTrace::source_location &  source = SOURCE_LOCATION_CURRENT() 
)

◆ getHipMemoryType()

AMP::Utilities::MemoryType getHipMemoryType ( const void *  ptr)

◆ getLastDeviceError()

void getLastDeviceError ( const char *  errorMessage,
const StackTrace::source_location &  source = SOURCE_LOCATION_CURRENT() 
)

◆ hipGetName()

template<typename T >
const char * hipGetName ( result)

◆ setKernelDims()

static void setKernelDims ( size_t  n,
dim3 &  BlockDim,
dim3 &  GridDim 
)
inlinestatic

Definition at line 53 of file Helper_Hip.h.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page