• 2019 Update 4
  • 03/20/2019
  • Public Content

Aligning Pointers to Microsoft DirectX* Buffers Upon Mapping

If your application utilizes resource sharing with Microsoft DirectX* 10 or 11 by use of mapping, use the
flag. Also note that mapping is less efficient than using the
Consider the general interoperability flow:
  1. Map a resource to CPU
  2. Create a buffer wrapping the memory
  3. Use the buffer by use of the OpenCL™ regular commands
  4. Upon competition of the OpenCL commands, the resource can be safely unmapped.
Now use the
flag to directly operate on the mapped memory and avoid data copying upon OpenCL buffer creation. This method requires properly aligned memory. See the “Mapping Memory Objects” section for more information.
Aligning might result in unprocessed data between original and aligned pointer.
If it is acceptable for your application, and/or the copying overhead is of concern, consider aligning of the pointer returned by the DirectX map call to comply with the "Mapping Memory Objects" section.
Another potential workaround is to allocate larger DirectX resource than it is required, so that you have some room for a safe alignment. This approach requires some additional application logic.

Product and Performance Information


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