@@ -16,19 +16,8 @@ template <typename T>
16
16
class aligned_allocator ;
17
17
18
18
class SYCLMemObjAllocator {
19
- /* class holder_base {
20
- public:
21
- virtual ~holder_base() = default;
22
- virtual void *allocate(std::size_t) = 0;
23
- virtual void deallocate(void *, std::size_t) = 0;
24
- virtual void setAlignment(std::size_t) = 0;
25
- virtual void *getAllocator() = 0;
26
- virtual std::size_t getValueSize() const = 0;
27
- };
28
- */
29
19
30
20
protected:
31
- // virtual void setAlignmentImpl(std::size_t) = 0;
32
21
virtual void * getAllocatorImpl () = 0;
33
22
public:
34
23
virtual ~SYCLMemObjAllocator () = default ;
@@ -39,34 +28,6 @@ class SYCLMemObjAllocator {
39
28
template <typename AllocatorT> AllocatorT getAllocator () {
40
29
return *reinterpret_cast <AllocatorT *>(getAllocatorImpl ());
41
30
}
42
- /* template <typename AllocatorT>
43
- SYCLMemObjAllocator(AllocatorT Allocator)
44
- : MAllocator(std::unique_ptr<holder_base>(
45
- new holder<AllocatorT>(Allocator))){}
46
-
47
- template <typename AllocatorT>
48
- SYCLMemObjAllocator()
49
- : MAllocator(std::unique_ptr<holder_base>(
50
- new holder<AllocatorT>(AllocatorT()))){}
51
-
52
- void *allocate(std::size_t Count) { return MAllocator->allocate(Count); }
53
-
54
- void deallocate(void *Ptr, std::size_t Count) {
55
- MAllocator->deallocate(Ptr, Count);
56
- }
57
-
58
- void setAlignment(std::size_t RequiredAlignment) {
59
- MAllocator->setAlignment(RequiredAlignment);
60
- }
61
-
62
- template <typename AllocatorT> AllocatorT getAllocator() {
63
- return *reinterpret_cast<AllocatorT *>(MAllocator->getAllocator());
64
- }
65
-
66
- std::size_t getValueSize() const { return MAllocator->getValueSize(); }
67
-
68
- private:
69
- std::unique_ptr<holder_base> MAllocator;*/
70
31
};
71
32
72
33
template <typename AllocatorT> class SYCLMemObjAllocatorHolder
0 commit comments