Intel® Inspector Help

Asynchronous Buffer

Occurs when operations between a program executed on host and a kernel are not synchronized.

Problem type: Uninitialized memory access

ID

Code Location

Description

1

Allocation site

Represents a source location of passing data from a host program to a buffer without synchronization.

2

Read

Represents a source location of copying data from a buffer to host program, when kernel execution is not yet complete.

If the operations of passing data to a buffer and copying the calculated data from this buffer back to the host are not synchronized, the program copies data from the buffer before the kernel completes execution. This results in getting initially passed data from the device kernel.

DPC++ Example

queue.submit([&](cl::sycl::handler &cgh) 

{ 

   cgh.parallel_for<class my_task>(cl::sycl::range<1> { N }, [=](cl::sycl::id<1> idx) 

   { 

    // We compute squares 

   deviceData[idx] *= deviceData[idx]; 

   }); 

}); 

// queue.wait(); 


for(int i=0; i<n; i++)   std::cout << deviceData[i] << “ “; 

Possible Correction Strategies

To copy the correct data to the buffer after a kernel execution, do the following: