Loading...
Searching...
No Matches
HIP Extensions

## Macros

#define | STARPU_USE_HIP
#define | STARPU_MAXHIPDEVS
#define | STARPU_HIPBLAS_REPORT_ERROR(status)
#define | STARPU_HIP_REPORT_ERROR(status)

## Functions

void | starpu_hipblas_report_error (const char *func, const char *file, int line, int status)
void | starpu_hip_report_error (const char *func, const char *file, int line, hipError_t status)
hipStream_t | starpu_hip_get_local_stream (void)
const struct hipDeviceProp_t * | starpu_hip_get_device_properties (unsigned workerid)
int | starpu_hip_copy_async_sync (void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t ssize, hipStream_t stream, hipMemcpyKind kind)
int | starpu_hip_copy2d_async_sync (void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t blocksize, size_t numblocks, size_t ld_src, size_t ld_dst, hipStream_t stream, hipMemcpyKind kind)
int | starpu_hip_copy3d_async_sync (void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t blocksize, size_t numblocks_1, size_t ld1_src, size_t ld1_dst, size_t numblocks_2, size_t ld2_src, size_t ld2_dst, hipStream_t stream, hipMemcpyKind kind)
void | starpu_hip_set_device (int devid)

## Detailed Description

## Macro Definition Documentation

## STARPU_USE_HIP

#define STARPU_USE_HIP

Defined when StarPU has been installed with HIP support. It should be used in your code to detect the availability of HIP.

## STARPU_MAXHIPDEVS

#define STARPU_MAXHIPDEVS

Define the maximum number of HIP devices that are supported by StarPU.

## STARPU_HIPBLAS_REPORT_ERROR

#define STARPU_HIPBLAS_REPORT_ERROR | ( |  | status | ) |

Call starpu_hipblas_report_error(), passing the current function, file and line position.

## STARPU_HIP_REPORT_ERROR

#define STARPU_HIP_REPORT_ERROR | ( |  | status | ) |

Call starpu_hip_report_error(), passing the current function, file and line position.

## Function Documentation

## starpu_hipblas_report_error()

void starpu_hipblas_report_error | ( | const char * | func,
|  | const char * | file,
|  | int | line,
|  | int | status
| ) |  |

Report a HIPBLAS error.

## starpu_hip_report_error()

void starpu_hip_report_error | ( | const char * | func,
|  | const char * | file,
|  | int | line,
|  | hipError_t | status
| ) |  |

Report a HIP error.

## starpu_hip_get_local_stream()

hipStream_t starpu_hip_get_local_stream | ( | void |  | ) |

Return the current worker’s HIP stream. StarPU provides a stream for every HIP device controlled by StarPU. This function is only provided for convenience so that programmers can easily use asynchronous operations within codelets without having to create a stream by hand. Note that the application is not forced to use the stream provided by starpu_hip_get_local_stream() and may also create its own streams. Synchronizing with `hipDeviceSynchronize()` is allowed, but will reduce the likelihood of having all transfers overlapped.

## starpu_hip_get_device_properties()

const struct hipDeviceProp_t * starpu_hip_get_device_properties | ( | unsigned | workerid | ) |

Return a pointer to device properties for worker `workerid` (assumed to be a HIP worker).

## starpu_hip_copy_async_sync()

int starpu_hip_copy_async_sync | ( | void * | src_ptr,
|  | unsigned | src_node,
|  | void * | dst_ptr,
|  | unsigned | dst_node,
|  | size_t | ssize,
|  | hipStream_t | stream,
|  | hipMemcpyKind | kind
| ) |  |

Copy `ssize` bytes from the pointer `src_ptr` on `src_node` to the pointer `dst_ptr` on `dst_node`. The function first tries to copy the data asynchronous (unless `stream` is `NULL`). If the asynchronous copy fails or if `stream` is `NULL`, it copies the data synchronously. The function returns `-EAGAIN` if the asynchronous launch was successful. It returns 0 if the synchronous copy was successful, or fails otherwise.

## starpu_hip_copy2d_async_sync()

int starpu_hip_copy2d_async_sync | ( | void * | src_ptr,
|  | unsigned | src_node,
|  | void * | dst_ptr,
|  | unsigned | dst_node,
|  | size_t | blocksize,
|  | size_t | numblocks,
|  | size_t | ld_src,
|  | size_t | ld_dst,
|  | hipStream_t | stream,
|  | hipMemcpyKind | kind
| ) |  |

Copy `numblocks` blocks of `blocksize` bytes from the pointer `src_ptr` on `src_node` to the pointer `dst_ptr` on `dst_node`.

The blocks start at addresses which are ld_src (resp. ld_dst) bytes apart in the source (resp. destination) interface.

The function first tries to copy the data asynchronous (unless `stream` is `NULL`). If the asynchronous copy fails or if `stream` is `NULL`, it copies the data synchronously. The function returns `-EAGAIN` if the asynchronous launch was successful. It returns 0 if the synchronous copy was successful, or fails otherwise.

## starpu_hip_copy3d_async_sync()

int starpu_hip_copy3d_async_sync | ( | void * | src_ptr,
|  | unsigned | src_node,
|  | void * | dst_ptr,
|  | unsigned | dst_node,
|  | size_t | blocksize,
|  | size_t | numblocks_1,
|  | size_t | ld1_src,
|  | size_t | ld1_dst,
|  | size_t | numblocks_2,
|  | size_t | ld2_src,
|  | size_t | ld2_dst,
|  | hipStream_t | stream,
|  | hipMemcpyKind | kind
| ) |  |

Copy `numblocks_1` * `numblocks_2` blocks of `blocksize` bytes from the pointer `src_ptr` on `src_node` to the pointer `dst_ptr` on `dst_node`.

The blocks are grouped by `numblocks_1` blocks whose start addresses are ld1_src (resp. ld1_dst) bytes apart in the source (resp. destination) interface.

The function first tries to copy the data asynchronous (unless `stream` is `NULL`). If the asynchronous copy fails or if `stream` is `NULL`, it copies the data synchronously. The function returns `-EAGAIN` if the asynchronous launch was successful. It returns 0 if the synchronous copy was successful, or fails otherwise.

## starpu_hip_set_device()

void starpu_hip_set_device | ( | int | devid | ) |

Call `hipSetDevice(`devid`)`.