usnistgov / hiperc

High Performance Computing Strategies for Boundary Value Problems
https://pages.nist.gov/hiperc/en/latest/index.html
41 stars 8 forks source link

OpenCL memory specifiers #102

Closed tkphd closed 7 years ago

tkphd commented 7 years ago

Learn how to use __constant memory for cached BC and mask arrays. Current usage is a fail.

tkphd commented 7 years ago

In a kernel function, __constant is a qualifier that can be applied to any buffer: the host (CPU) handles allocation and initialization of the buffer (scalar or array) using clCreateBuffer, without any special handling, then passes the buffer in to the kernel. This is actually easier in OpenCL than in CUDA.