mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Clean up enqueue_map_{buffer,image} tests a bit (#701)
- Introduce MTdataHolder - Use BufferOwningPtr to manage allocations (fixes a few leaks in error cases) - Introduce variable for common expressions - Remove image format support check as the format is required by OpenCL 1.0 Contributes to #700 Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -96,4 +96,30 @@ double genrand_res53( MTdata /*data*/ );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <cassert>
|
||||
|
||||
struct MTdataHolder {
|
||||
MTdataHolder(cl_uint seed) {
|
||||
m_mtdata = init_genrand(seed);
|
||||
assert(m_mtdata != nullptr);
|
||||
}
|
||||
|
||||
MTdataHolder(MTdata mtdata) : m_mtdata(mtdata) {}
|
||||
|
||||
~MTdataHolder() {
|
||||
free_mtdata(m_mtdata);
|
||||
}
|
||||
|
||||
operator MTdata () const {
|
||||
return m_mtdata;
|
||||
}
|
||||
|
||||
private:
|
||||
MTdata m_mtdata;
|
||||
};
|
||||
|
||||
#endif // #ifdef __cplusplus
|
||||
|
||||
#endif /* MT19937_H */
|
||||
|
||||
Reference in New Issue
Block a user