User Guide

  • 2021.2
  • 03/26/2021
  • Public Content
Contents

Non-Host Pointer

Occurs when a device pointer is used in classic C/C++ functions instead of a host-based pointer.
Problem type: Memory leak
ID
Code Location
Description
1
Allocation site
Represents a source location of a classic C/C++ function or call stack that is using a device pointer to access the allocated memory.
DPC++ Example
cl::sycl::queue queue_1(cl::sycl::cpu_selector{ } ); int* deviceData = (int*)sycl::malloc_device(sizeInBytes, queue_1.get_device(), queue_1.get_context()); memcpy(deviceData, hostData, sizeInBytes); //C++ memcpy function is applied to device pointer // it should be queue_1.memcpy(deviceData, hostData, sizeInBytes);

Possible Correction Strategies

Consider using host-based pointers.
If you use
memcpy
function, replace it with
queue.memcpy
to copy the pointer in the appropriate way.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.