User Guide

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

Host Pointer Used on Device

Occurs when a pointer from a program executed on host is used to pass data directly to a device kernel.
Problem type: Memory leak
ID
Code Location
Description
1
Allocation site
Represents a source location of a host pointer used to pass data directly to a device kernel.
DPC++ Example
int* inputPtr = new int[N]; //host pointer q.submit([&](cl::sycl::handler &cgh) { cgh.parallel_for<class kernel1>(range, [=](cl::sycl::item<1> itemID) { size_t i = itemID.get_id(0); inputPtr[i] = i + 1; }); }).wait();

Possible Correction Strategies

Consider using buffers, shared memory pointers, or device pointers to avoid passing data using host pointers.

Product and Performance Information

1

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