5 #ifndef FML_GPU_ARCH_HIP_GPUPRIMS_H
6 #define FML_GPU_ARCH_HIP_GPUPRIMS_H
11 #include <rocsolver.h>
19 inline hipError_t gpu_set_device(
int device)
21 return hipSetDevice(device);
24 inline hipError_t gpu_synch()
26 return hipDeviceSynchronize();
29 inline hipError_t gpu_device_reset()
31 return hipDeviceReset();
37 inline hipError_t gpu_malloc(
void **x,
size_t size)
39 return hipMalloc(x, size);
42 inline hipError_t gpu_memset(
void *x,
int value,
size_t count)
44 return hipMemset(x, value, count);
47 inline hipError_t gpu_free(
void *x)
52 inline hipError_t gpu_memcpy(
void *dst,
const void *src,
size_t count, hipMemcpyKind kind)
54 return hipMemcpy(dst, src, count, kind);
60 inline std::string gpu_error_string(hipError_t code)
62 return hipGetErrorString(code);
65 inline hipError_t gpu_last_error()
67 return hipGetLastError();
73 inline rocblas_status gpu_blas_init(rocblas_handle *handle)
75 return rocblas_create_handle(handle);
78 inline rocblas_status gpu_blas_free(rocblas_handle handle)
80 return rocblas_destroy_handle(handle);
83 inline rocsolver_status gpu_lapack_init(rocsolver_handle *handle)
85 return rocsolver_create_handle(handle);
88 inline rocsolver_status gpu_lapack_free(rocsolver_handle handle)
90 return rocsolver_destroy_handle(handle);