1 /**
2  * Copyright (C) Mellanox Technologies Ltd. 2019.  ALL RIGHTS RESERVED.
3  *
4  * See file LICENSE for terms.
5  */
6 
7 
8 #ifndef UCS_MEMORY_TYPE_H_
9 #define UCS_MEMORY_TYPE_H_
10 
11 #include <ucs/sys/compiler_def.h>
12 
13 BEGIN_C_DECLS
14 
15 
16 /* Memory types accessible from CPU  */
17 #define UCS_MEMORY_TYPES_CPU_ACCESSIBLE \
18     (UCS_BIT(UCS_MEMORY_TYPE_HOST) | \
19      UCS_BIT(UCS_MEMORY_TYPE_CUDA_MANAGED) | \
20      UCS_BIT(UCS_MEMORY_TYPE_ROCM_MANAGED))
21 
22 
23 /*
24  * @ingroup UCS_RESOURCE
25  * Memory types
26  */
27 typedef enum ucs_memory_type {
28     UCS_MEMORY_TYPE_HOST,          /**< Default system memory */
29     UCS_MEMORY_TYPE_CUDA,          /**< NVIDIA CUDA memory */
30     UCS_MEMORY_TYPE_CUDA_MANAGED,  /**< NVIDIA CUDA managed (or unified) memory*/
31     UCS_MEMORY_TYPE_ROCM,          /**< AMD ROCM memory */
32     UCS_MEMORY_TYPE_ROCM_MANAGED,  /**< AMD ROCM managed system memory */
33     UCS_MEMORY_TYPE_LAST
34 } ucs_memory_type_t;
35 
36 
37 /**
38  * Array of string names for each memory type
39  */
40 extern const char *ucs_memory_type_names[];
41 
42 /**
43  * Array of string descriptions for each memory type
44  */
45 extern const char *ucs_memory_type_descs[];
46 
47 
48 END_C_DECLS
49 
50 #endif
51