-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhamr_buffer_allocator.cxx
49 lines (45 loc) · 1.09 KB
/
hamr_buffer_allocator.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "hamr_buffer_allocator.h"
namespace hamr
{
// **************************************************************************
const char *get_allocator_name(buffer_allocator alloc)
{
if (alloc == buffer_allocator::cpp)
{
return "cpp";
}
else if (alloc == buffer_allocator::malloc)
{
return "malloc";
}
else if (alloc == buffer_allocator::cuda)
{
return "cuda_malloc_allocator";
}
else if (alloc == buffer_allocator::cuda_host)
{
return "cuda_malloc_host_allocator";
}
else if (alloc == buffer_allocator::cuda_async)
{
return "cuda_malloc_async_allocator";
}
else if (alloc == buffer_allocator::cuda_uva)
{
return "cuda_malloc_uva_allocator";
}
else if (alloc == buffer_allocator::hip)
{
return "hip_malloc_allocator";
}
else if (alloc == buffer_allocator::hip_uva)
{
return "hip_malloc_uva_allocator";
}
else if (alloc == buffer_allocator::openmp)
{
return "openmp_allocator";
}
return "the allocator name is not known";
}
}