VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
front Namespace Reference

Namespaces

namespace  garbage
 ROLLCALL BOSS.
 

Classes

class  bonqueue
 
struct  CriticalHole
 
struct  DeallocatorVk
 
class  debug_allocator
 
class  debug_allocator< void, Allocator >
 
struct  heapQ
 
struct  hq_elem
 
class  Lbd
 
class  Lbd< Out(In...)>
 
struct  ListnerVk
 
class  local_counting_allocator
 
struct  oSyncoTank
 
struct  Schedule
 
union  SemaPhore
 
struct  Synco
 
class  SyncoTank
 

Typedefs

typedef local_counting_allocator< debug_allocator< std::pair< const int, int >, std::allocator > > tbbTAllocator
 
typedef tbb::concurrent_unordered_map< int, int, std::hash< int >, std::equal_to< int >, tbbTAllocatortbbMap
 typedef tbb::concurrent_unordered_map<int, int, tbb::tbb_hash<int>, std::equal_to<int>, tbbTAllocator> tbbMap; More...
 
typedef tbb::concurrent_unordered_map< std::string, vkmm::Allocation, std::hash< std::string >, std::equal_to< std::string >, tbbTAllocatortbbALMap
 

Functions

void g123 (int, char, const std::string &)
 
template<typename T , typename do_check_element_state >
void test_basic_common (const char *str, do_check_element_state)
 
template<typename T1 , template< typename X1 > class B1, typename T2 , template< typename X2 > class B2>
bool operator== (const debug_allocator< T1, B1 > &a, const debug_allocator< T2, B2 > &b)
 
template<typename T1 , template< typename X1 > class B1, typename T2 , template< typename X2 > class B2>
bool operator!= (const debug_allocator< T1, B1 > &a, const debug_allocator< T2, B2 > &b)
 
template<class T >
char atomicType (T type)
 
template<class T >
void duplicate (_Inout_opt_ T *&ptr, uintptr_t shn)
 
template<class T >
void asignable (T &dst, const T &src)
 
template<class T >
void movable (uintptr_t &dst, T &&src)
 

Typedef Documentation

◆ tbbALMap

typedef tbb::concurrent_unordered_map<std::string, vkmm::Allocation, std::hash<std::string>, std::equal_to<std::string>, tbbTAllocator> front::tbbALMap

Definition at line 1457 of file AllocatorVk.h.

◆ tbbMap

typedef tbb::concurrent_unordered_map<int, int, std::hash<int>, std::equal_to<int>, tbbTAllocator> front::tbbMap

typedef tbb::concurrent_unordered_map<int, int, tbb::tbb_hash<int>, std::equal_to<int>, tbbTAllocator> tbbMap;

Definition at line 1455 of file AllocatorVk.h.

◆ tbbTAllocator

Definition at line 405 of file AllocatorVk.h.

Function Documentation

◆ asignable()

template<class T >
void front::asignable ( T &  dst,
const T &  src 
)

Definition at line 1599 of file AllocatorVk.h.

1600 {
1601 memcpy(&dst, &src, sizeof(T));
1602 }

◆ atomicType()

template<class T >
char front::atomicType ( type)

Definition at line 1460 of file AllocatorVk.h.

1460 {
1461#define atomicType_init Ctx = 47, Win = 47, Desc = 47, Img = 47, Ovr = 47, Obj = 47, Vobj = 47, Uobj = 47, Atta = 47, Pipe = 47;
1462
1463 static char atomicType_init
1464#define inc(i) char(int(i)+1)
1465 switch (type) {
1466 case CONTEXTVK: { Ctx = inc(Ctx); return Ctx; };
1467 case WINDOWVK: { Win = inc(Win); return Win; };
1468 case DESCRIPTORVK: { Desc = inc(Desc); return Desc; };
1469 case IMAGESVK: { Img= inc(Img); return Img; };
1470 case OVRVK: {Ovr = inc(Ovr); return Ovr; };
1471 case OBJECTSVK: {Obj = inc(Obj); return Obj; };
1472 case VISIBLEOBJECTSVK: {Vobj = inc(Vobj); return Vobj; };
1473 case ATTACHMENTSVK: {Atta = inc(Atta); return Atta; };
1474 case PIPELINEVK: {Pipe = inc(Pipe); return Pipe; };
1475 case FLUSH_TYPE: {
1477 return 0;
1478 }
1479 }
1480 log_bad("Synco Name not found.");
1481 return 0;
1482 };
#define inc(i)
#define atomicType_init
#define log_bad(...)
Definition: log.hpp:37
#define IMAGESVK
DescriptorVk.
#define PIPELINEVK
#define WINDOWVK
Context1Vk.
#define OVRVK
#define OBJECTSVK
#define CONTEXTVK
Exculsive Class Definition.
#define VISIBLEOBJECTSVK
#define ATTACHMENTSVK
#define FLUSH_TYPE
#define DESCRIPTORVK
WindowVk.

◆ duplicate()

template<class T >
void front::duplicate ( _Inout_opt_ T *&  ptr,
uintptr_t  shn 
)

Definition at line 1487 of file AllocatorVk.h.

1487 {
1488 if (ptr != nullptr) {
1489 log_bad("take out box should be empty.");
1490 };
1491
1492 ptr = (T*)(shn);
1493
1494
1495 };

◆ g123()

void front::g123 ( int  ,
char  ,
const std::string &   
)

Definition at line 2086 of file AllocatorVk.cpp.

2086{}

◆ movable()

template<class T >
void front::movable ( uintptr_t &  dst,
T &&  src 
)

Definition at line 1604 of file AllocatorVk.h.

1605 {
1606 T* d = (T*)dst;
1607 d = &src;
1608
1609 }

◆ operator!=()

template<typename T1 , template< typename X1 > class B1, typename T2 , template< typename X2 > class B2>
bool front::operator!= ( const debug_allocator< T1, B1 > &  a,
const debug_allocator< T2, B2 > &  b 
)
inline

Definition at line 401 of file AllocatorVk.h.

401 {
402 return static_cast<B1<T1>>(a) != static_cast<B2<T2>>(b);
403 }

◆ operator==()

template<typename T1 , template< typename X1 > class B1, typename T2 , template< typename X2 > class B2>
bool front::operator== ( const debug_allocator< T1, B1 > &  a,
const debug_allocator< T2, B2 > &  b 
)
inline

Definition at line 397 of file AllocatorVk.h.

397 {
398 return static_cast<B1<T1>>(a) == static_cast<B2<T2>>(b);
399 }

◆ test_basic_common()

template<typename T , typename do_check_element_state >
void front::test_basic_common ( const char *  str,
do_check_element_state   
)

Definition at line 44 of file AllocatorVk.h.

45 {
46 T cont;
47 const T& ccont(cont);
48 CheckEmptyContainerAllocatorE(cont, 1, 0); // one dummy is always allocated
49 // bool empty() const;
50 ASSERT(ccont.empty(), "Concurrent container is not empty after construction");
51
52 // size_type size() const;
53 ASSERT(ccont.size() == 0, "Concurrent container is not empty after construction");
54
55 // size_type max_size() const;
56 ASSERT(ccont.max_size() > 0, "Concurrent container max size is invalid");
57
58 //iterator begin();
59 //iterator end();
60 ASSERT(cont.begin() == cont.end(), "Concurrent container iterators are invalid after construction");
61 ASSERT(ccont.begin() == ccont.end(), "Concurrent container iterators are invalid after construction");
62 ASSERT(cont.cbegin() == cont.cend(), "Concurrent container iterators are invalid after construction");
63
64 //std::pair<iterator, bool> insert(const value_type& obj);
65 std::pair<typename T::iterator, bool> ins = cont.insert(Value<T>::make(1));
66 ASSERT(ins.second == true && Value<T>::get(*(ins.first)) == 1, "Element 1 has not been inserted properly");
67
68#if __TBB_CPP11_RVALUE_REF_PRESENT
69 test_rvalue_insert<T, do_check_element_state>(1, 2);
70#if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT
71 test_emplace_insert<T, do_check_element_state>(1, 2);
72#endif // __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT
73#endif // __TBB_CPP11_RVALUE_REF_PRESENT
74
75 // bool empty() const;
76 ASSERT(!ccont.empty(), "Concurrent container is empty after adding an element");
77
78 // size_type size() const;
79 ASSERT(ccont.size() == 1, "Concurrent container size is incorrect");
80
81 std::pair<typename T::iterator, bool> ins2 = cont.insert(Value<T>::make(1));
82
83 if (T::allow_multimapping)
84 {
85 // std::pair<iterator, bool> insert(const value_type& obj);
86 ASSERT(ins2.second == true && Value<T>::get(*(ins2.first)) == 1, "Element 1 has not been inserted properly");
87
88 // size_type size() const;
89 ASSERT(ccont.size() == 2, "Concurrent container size is incorrect");
90
91 // size_type count(const key_type& k) const;
92 ASSERT(ccont.count(1) == 2, "Concurrent container count(1) is incorrect");
93 // std::pair<iterator, iterator> equal_range(const key_type& k);
94 std::pair<typename T::iterator, typename T::iterator> range = cont.equal_range(1);
95 typename T::iterator it = range.first;
96 ASSERT(it != cont.end() && Value<T>::get(*it) == 1, "Element 1 has not been found properly");
97 unsigned int count = 0;
98 for (; it != range.second; it++)
99 {
100 count++;
101 ASSERT(Value<T>::get(*it) == 1, "Element 1 has not been found properly");
102 }
103
104 ASSERT(count == 2, "Range doesn't have the right number of elements");
105 }
106 else
107 {
108 // std::pair<iterator, bool> insert(const value_type& obj);
109 ASSERT(ins2.second == false && ins2.first == ins.first, "Element 1 should not be re-inserted");
110
111 // size_type size() const;
112 ASSERT(ccont.size() == 1, "Concurrent container size is incorrect");
113
114 // size_type count(const key_type& k) const;
115 ASSERT(ccont.count(1) == 1, "Concurrent container count(1) is incorrect");
116
117 // std::pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
118 // std::pair<iterator, iterator> equal_range(const key_type& k);
119 std::pair<typename T::iterator, typename T::iterator> range = cont.equal_range(1);
120 typename T::iterator it = range.first;
121 ASSERT(it != cont.end() && Value<T>::get(*it) == 1, "Element 1 has not been found properly");
122 ASSERT(++it == range.second, "Range doesn't have the right number of elements");
123 }
124
125 // const_iterator find(const key_type& k) const;
126 // iterator find(const key_type& k);
127 typename T::iterator it = cont.find(1);
128 ASSERT(it != cont.end() && Value<T>::get(*(it)) == 1, "Element 1 has not been found properly");
129 ASSERT(ccont.find(1) == it, "Element 1 has not been found properly");
130
131 // Will be implemented in unordered containers later
132#if !__TBB_UNORDERED_TEST
133 //bool contains(const key_type&k) const
134 ASSERT(cont.contains(1), "contains() cannot detect existing element");
135 ASSERT(!cont.contains(0), "contains() detect not existing element");
136#endif /*__TBB_UNORDERED_TEST*/
137
138 // iterator insert(const_iterator hint, const value_type& obj);
139 typename T::iterator it2 = cont.insert(ins.first, Value<T>::make(2));
140 ASSERT(Value<T>::get(*it2) == 2, "Element 2 has not been inserted properly");
141
142 // T(const T& _Umap)
143 T newcont = ccont;
144 ASSERT(T::allow_multimapping ? (newcont.size() == 3) : (newcont.size() == 2), "Copy construction has not copied the elements properly");
145
146 // this functionality not implemented yet
147 // size_type unsafe_erase(const key_type& k);
148 typename T::size_type size = cont.unsafe_erase(1);
149 ASSERT(T::allow_multimapping ? (size == 2) : (size == 1), "Erase has not removed the right number of elements");
150
151 // iterator unsafe_erase(iterator position);
152 typename T::iterator it4 = cont.unsafe_erase(cont.find(2));
153 ASSERT(it4 == cont.end() && cont.size() == 0, "Erase has not removed the last element properly");
154
155 // iterator unsafe_erase(const_iterator position);
156 cont.insert(Value<T>::make(3));
157 typename T::iterator it5 = cont.unsafe_erase(cont.cbegin());
158 ASSERT(it5 == cont.end() && cont.size() == 0, "Erase has not removed the last element properly");
159
160 // template<class InputIterator> void insert(InputIterator first, InputIterator last);
161 cont.insert(newcont.begin(), newcont.end());
162 ASSERT(T::allow_multimapping ? (cont.size() == 3) : (cont.size() == 2), "Range insert has not copied the elements properly");
163
164 // this functionality not implemented yet
165 // iterator unsafe_erase(const_iterator first, const_iterator last);
166 std::pair<typename T::iterator, typename T::iterator> range2 = newcont.equal_range(1);
167 newcont.unsafe_erase(range2.first, range2.second);
168 ASSERT(newcont.size() == 1, "Range erase has not erased the elements properly");
169
170 // void clear();
171 newcont.clear();
172 ASSERT(newcont.begin() == newcont.end() && newcont.size() == 0, "Clear has not cleared the container");
173
174#if __TBB_INITIALIZER_LISTS_PRESENT
175#if __TBB_CPP11_INIT_LIST_TEMP_OBJS_LIFETIME_BROKEN
176 REPORT("Known issue: the test for insert with initializer_list is skipped.\n");
177#else
178 // void insert(const std::initializer_list<value_type> &il);
179 newcont.insert({ Value<T>::make(1), Value<T>::make(2), Value<T>::make(1) });
180 if (T::allow_multimapping) {
181 ASSERT(newcont.size() == 3, "Concurrent container size is incorrect");
182 ASSERT(newcont.count(1) == 2, "Concurrent container count(1) is incorrect");
183 ASSERT(newcont.count(2) == 1, "Concurrent container count(2) is incorrect");
184 std::pair<typename T::iterator, typename T::iterator> range = cont.equal_range(1);
185 it = range.first;
186 ASSERT(it != newcont.end() && Value<T>::get(*it) == 1, "Element 1 has not been found properly");
187 unsigned int count = 0;
188 for (; it != range.second; it++) {
189 count++;
190 ASSERT(Value<T>::get(*it) == 1, "Element 1 has not been found properly");
191 }
192 ASSERT(count == 2, "Range doesn't have the right number of elements");
193 range = newcont.equal_range(2); it = range.first;
194 ASSERT(it != newcont.end() && Value<T>::get(*it) == 2, "Element 2 has not been found properly");
195 count = 0;
196 for (; it != range.second; it++) {
197 count++;
198 ASSERT(Value<T>::get(*it) == 2, "Element 2 has not been found properly");
199 }
200 ASSERT(count == 1, "Range doesn't have the right number of elements");
201 }
202 else {
203 ASSERT(newcont.size() == 2, "Concurrent container size is incorrect");
204 ASSERT(newcont.count(1) == 1, "Concurrent container count(1) is incorrect");
205 ASSERT(newcont.count(2) == 1, "Concurrent container count(2) is incorrect");
206 std::pair<typename T::iterator, typename T::iterator> range = newcont.equal_range(1);
207 it = range.first;
208 ASSERT(it != newcont.end() && Value<T>::get(*it) == 1, "Element 1 has not been found properly");
209 ASSERT(++it == range.second, "Range doesn't have the right number of elements");
210 range = newcont.equal_range(2); it = range.first;
211 ASSERT(it != newcont.end() && Value<T>::get(*it) == 2, "Element 2 has not been found properly");
212 ASSERT(++it == range.second, "Range doesn't have the right number of elements");
213 }
214#endif /* __TBB_CPP11_INIT_LIST_TEMP_OBJS_COMPILATION_BROKEN */
215#endif /* __TBB_INITIALIZER_LISTS_PRESENT */
216
217 // T& operator=(const T& _Umap)
218 newcont = ccont;
219 ASSERT(T::allow_multimapping ? (newcont.size() == 3) : (newcont.size() == 2), "Assignment operator has not copied the elements properly");
220
221 REMARK("passed -- basic %s tests\n", str);
222
223#if defined (VERBOSE)
224 REMARK("container dump debug:\n");
225 cont._Dump();
226 REMARK("container dump release:\n");
227 cont.dump();
228 REMARK("\n");
229#endif
230
231 cont.clear();
232 CheckEmptyContainerAllocatorA(cont, 1, 0); // one dummy is always allocated
233 for (int i = 0; i < 256; i++)
234 {
235 std::pair<typename T::iterator, bool> ins3 = cont.insert(Value<T>::make(i));
236 ASSERT(ins3.second == true && Value<T>::get(*(ins3.first)) == i, "Element 1 has not been inserted properly");
237 }
238 ASSERT(cont.size() == 256, "Wrong number of elements have been inserted");
239 ASSERT((256 == CheckRecursiveRange<T, typename T::iterator>(cont.range()).first), NULL);
240 ASSERT((256 == CheckRecursiveRange<T, typename T::const_iterator>(ccont.range()).first), NULL);
241
242 // void swap(T&);
243 cont.swap(newcont);
244 ASSERT(newcont.size() == 256, "Wrong number of elements after swap");
245 ASSERT(newcont.count(200) == 1, "Element with key 200 is not present after swap");
246 ASSERT(newcont.count(16) == 1, "Element with key 16 is not present after swap");
247 ASSERT(newcont.count(99) == 1, "Element with key 99 is not present after swap");
248 ASSERT(T::allow_multimapping ? (cont.size() == 3) : (cont.size() == 2), "Assignment operator has not copied the elements properly");
249
250 // Need to be enabled
251 SpecialTests<T>::Test(str);
252 }
#define ASSERT(p, message)
Definition: harness_defs.h:225
#define REPORT
printf style reporting macro
Definition: harness_defs.h:401
#define REMARK
printf style remark macro
Definition: harness_defs.h:392