27
27
namespace cldnn {
28
28
namespace ocl {
29
29
30
- static inline void check_boundaries (const std::string& func_str,
31
- size_t src_size,
30
+ static inline void check_boundaries (size_t src_size,
32
31
size_t src_offset,
33
32
size_t dst_size,
34
33
size_t dst_offset,
35
- size_t copy_size) {
34
+ size_t copy_size,
35
+ const std::string& func_str = " " ) {
36
36
OPENVINO_ASSERT (src_offset + copy_size <= src_size && dst_offset + copy_size <= dst_size,
37
37
" [GPU] Incorrect buffer sizes for " ,
38
38
func_str,
@@ -156,7 +156,7 @@ event::ptr gpu_buffer::copy_from(stream& stream, const void* data_ptr, size_t sr
156
156
if (size == 0 )
157
157
return result_event;
158
158
159
- check_boundaries (" gpu_buffer::copy_from(void*) " , SIZE_MAX, src_offset, _bytes_count, dst_offset, size);
159
+ check_boundaries (SIZE_MAX, src_offset, _bytes_count, dst_offset, size, " gpu_buffer::copy_from(void*) " );
160
160
161
161
auto cl_stream = downcast<ocl_stream>(&stream);
162
162
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get ())->get ();
@@ -172,7 +172,7 @@ event::ptr gpu_buffer::copy_from(stream& stream, const memory& src_mem, size_t s
172
172
if (size == 0 )
173
173
return result_event;
174
174
175
- check_boundaries (" gpu_buffer::copy_from(memory&) " , src_mem.size (), src_offset, _bytes_count, dst_offset, size);
175
+ check_boundaries (src_mem.size (), src_offset, _bytes_count, dst_offset, size, " gpu_buffer::copy_from(memory&) " );
176
176
177
177
switch (src_mem.get_allocation_type ()) {
178
178
case allocation_type::usm_host:
@@ -208,7 +208,7 @@ event::ptr gpu_buffer::copy_to(stream& stream, void* data_ptr, size_t src_offset
208
208
if (size == 0 )
209
209
return result_event;
210
210
211
- check_boundaries (" gpu_buffer::copy_to(void*) " , _bytes_count, src_offset, SIZE_MAX, dst_offset, size);
211
+ check_boundaries (_bytes_count, src_offset, SIZE_MAX, dst_offset, size, " gpu_buffer::copy_to(void*) " );
212
212
213
213
auto cl_stream = downcast<ocl_stream>(&stream);
214
214
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get ())->get ();
@@ -570,7 +570,7 @@ event::ptr gpu_usm::copy_from(stream& stream, const void* data_ptr, size_t src_o
570
570
if (size == 0 )
571
571
return result_event;
572
572
573
- check_boundaries (" gpu_usm::copy_from(void*) " , SIZE_MAX, src_offset, _bytes_count, dst_offset, size);
573
+ check_boundaries (SIZE_MAX, src_offset, _bytes_count, dst_offset, size, " gpu_usm::copy_from(void*) " );
574
574
575
575
auto cl_stream = downcast<ocl_stream>(&stream);
576
576
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get ())->get ();
@@ -587,7 +587,7 @@ event::ptr gpu_usm::copy_from(stream& stream, const memory& src_mem, size_t src_
587
587
if (size == 0 )
588
588
return result_event;
589
589
590
- check_boundaries (" gpu_usm::copy_from(memory&) " , src_mem.size (), src_offset, _bytes_count, dst_offset, size);
590
+ check_boundaries (src_mem.size (), src_offset, _bytes_count, dst_offset, size, " gpu_usm::copy_from(memory&) " );
591
591
592
592
auto cl_stream = downcast<ocl_stream>(&stream);
593
593
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get ())->get ();
@@ -620,7 +620,7 @@ event::ptr gpu_usm::copy_to(stream& stream, void* data_ptr, size_t src_offset, s
620
620
if (size == 0 )
621
621
return result_event;
622
622
623
- check_boundaries (" gpu_usm::copy_to(void*) " , _bytes_count, src_offset, SIZE_MAX, dst_offset, size);
623
+ check_boundaries (_bytes_count, src_offset, SIZE_MAX, dst_offset, size, " gpu_usm::copy_to(void*) " );
624
624
625
625
auto cl_stream = downcast<ocl_stream>(&stream);
626
626
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get ())->get ();
0 commit comments