MemoryType
enum class MemoryType : std::int64_t { /* * call aclrtMalloc with aclrtMemMallocPolicy::ACL_MEM_MALLOC_HUGE_FIRST, * ACL_MEM_MALLOC_HUGE_ONLY, ACL_MEM_MALLOC_NORMAL_ONLY */ MEMORY_TYPE_DEFAULT, /* * call aclrtMalloc with aclrtMemMallocPolicy::ACL_MEM_MALLOC_HUGE_FIRST_P2P, * ACL_MEM_MALLOC_HUGE_ONLY_P2P, ACL_MEM_MALLOC_NORMAL_ONLY_P2P */ MEMORY_TYPE_P2P };
各枚举项说明如下:
- MEMORY_TYPE_DEFAULT:默认device内存类型,可以通过调用aclrtMalloc接口申请得到,申请内存时传入aclrtMemMallocPolicy中的3种枚举值之一,ACL_MEM_MALLOC_HUGE_FIRST、ACL_MEM_MALLOC_HUGE_ONLY、 ACL_MEM_MALLOC_NORMAL_ONLY
- MEMORY_TYPE_P2P:仅Device之间内存复制场景下的内存类型,可以通过调用aclrtMalloc接口申请得到,申请内存时传入aclrtMemMallocPolicy中的3种枚举值之一,ACL_MEM_MALLOC_HUGE_FIRST_P2P,、ACL_MEM_MALLOC_HUGE_ONLY_P2P、ACL_MEM_MALLOC_NORMAL_ONLY_P2P
父主题: 数据类型