fml  0.1-0
Fused Matrix Library
types.hh
1 // This file is part of fml which is released under the Boost Software
2 // License, Version 1.0. See accompanying file LICENSE or copy at
3 // https://www.boost.org/LICENSE_1_0.txt
4 
5 #ifndef FML_GPU_ARCH_HIP_TYPES_H
6 #define FML_GPU_ARCH_HIP_TYPES_H
7 #pragma once
8 
9 
10 #include <hip_runtime_api.h>
11 #include <rocblas.h>
12 #include <rocsolver.h>
13 
14 
15 // core
16 typedef hipError_t gpu_error_t;
17 #define GPU_SUCCESS hipSuccess
18 
19 #define GPU_MEMCPY_HOST_TO_DEVICE hipMemcpyHostToDevice
20 #define GPU_MEMCPY_DEVICE_TO_HOST hipMemcpyDeviceToHost
21 #define GPU_MEMCPY_DEVICE_TO_DEVICE hipMemcpyDeviceToDevice
22 
23 // blas
24 #define GPUBLAS_STATUS_SUCCESS rocblas_status_success
25 typedef rocblas_status gpublas_status_t;
26 typedef rocblas_handle gpublas_handle_t;
27 typedef rocblas_operation gpublas_operation_t;
28 typedef rocblas_fill gpublas_fillmode_t;
29 #define GPUBLAS_OP_T rocblas_operation_transpose
30 #define GPUBLAS_OP_N rocblas_operation_none
31 #define GPUBLAS_FILL_L rocblas_fill_lower
32 #define GPUBLAS_FILL_U rocblas_fill_upper
33 #define GPUBLAS_SIDE_LEFT rocblas_side_left
34 #define GPUBLAS_SIDE_RIGHT rocblas_side_right
35 
36 // lapack/"solver"
37 #define GPULAPACK_STATUS_SUCCESS CUSOLVER_STATUS_SUCCESS
38 typedef rocsolver_status gpulapack_status_t;
39 typedef rocsolver_handle gpulapack_handle_t;
40 
41 
42 #endif