Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Commit 05e2b37

Browse files
RbiessyDuncanMcBain
authored andcommitted
Fix type shadowing (#152)
The type buffer_t is defined in the class PointerMapper and redefined to a different type in get_buffer which results in shadowing warnings. SYCLmalloc doesn't have this issue but the alias should probably be changed for consistency.
1 parent 7f5f2c8 commit 05e2b37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/vptr/virtual_ptr.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ class PointerMapper {
232232
template <typename buffer_data_type = buffer_data_type_t>
233233
cl::sycl::buffer<buffer_data_type, 1> get_buffer(
234234
const virtual_pointer_t ptr) {
235-
using buffer_t = cl::sycl::buffer<buffer_data_type, 1>;
235+
using sycl_buffer_t = cl::sycl::buffer<buffer_data_type, 1>;
236236

237237
// get_node() returns a `buffer_mem`, so we need to cast it to a `buffer<>`.
238238
// We can do this without the `buffer_mem` being a pointer, as we
239239
// only declare member variables in the base class (`buffer_mem`) and not in
240240
// the child class (`buffer<>).
241-
return *(static_cast<buffer_t*>(&get_node(ptr)->second.m_buffer));
241+
return *(static_cast<sycl_buffer_t*>(&get_node(ptr)->second.m_buffer));
242242
}
243243

244244
/**
@@ -505,8 +505,8 @@ inline void* SYCLmalloc(size_t size, PointerMapper& pMap) {
505505
return nullptr;
506506
}
507507
// Create a generic buffer of the given size
508-
using buffer_t = cl::sycl::buffer<buffer_data_type_t, 1>;
509-
auto thePointer = pMap.add_pointer(buffer_t(cl::sycl::range<1>{size}));
508+
using sycl_buffer_t = cl::sycl::buffer<buffer_data_type_t, 1>;
509+
auto thePointer = pMap.add_pointer(sycl_buffer_t(cl::sycl::range<1>{size}));
510510
// Store the buffer on the global list
511511
return static_cast<void*>(thePointer);
512512
}

0 commit comments

Comments
 (0)