Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/vptr/virtual_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,13 @@ inline void PointerMapper::remove_pointer<false>(const virtual_pointer_t ptr) {
* \param size Size in bytes of the desired allocation
* \throw cl::sycl::exception if error while creating the buffer
*/
inline void* SYCLmalloc(size_t size, PointerMapper& pMap) {
inline void* SYCLmalloc(size_t size, PointerMapper& pMap, const property_list &pList = {}) {
if (size == 0) {
return nullptr;
}
// Create a generic buffer of the given size
using sycl_buffer_t = cl::sycl::buffer<buffer_data_type_t, 1>;
auto thePointer = pMap.add_pointer(sycl_buffer_t(cl::sycl::range<1>{size}));
auto thePointer = pMap.add_pointer(sycl_buffer_t(cl::sycl::range<1>{size}, pList));
// Store the buffer on the global list
return static_cast<void*>(thePointer);
}
Expand Down
25 changes: 0 additions & 25 deletions tests/vptr/accessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,3 @@ TEST(accessor, two_buffers) {
}
}

TEST(accessor, allocator) {
// an allocator type
using alloc_t = cl::sycl::buffer_allocator<uint8_t>;

PointerMapper pMap;
{
ASSERT_EQ(pMap.count(), 0u);

// add a pointer with the base allocator type
void* ptrA = SYCLmalloc(100 * sizeof(int), pMap);

// get the buffer with the base allocator type
auto bufA = pMap.get_buffer(ptrA);

ASSERT_EQ(pMap.count(), 1u);

// add a pointer with the allocator type
void* ptrB = SYCLmalloc<alloc_t>(100 * sizeof(int), pMap);

// get the buffer with the allocator type
cl::sycl::buffer<uint8_t, 1, alloc_t> bufB = pMap.get_buffer<alloc_t>(ptrB);

ASSERT_EQ(pMap.count(), 2u);
}
}