Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
A structure for declaring where we want to access data. More...
#include <gpuarray.h>
Public Types | |
enum | Enum { host, device } |
An enumeration of possibilities. More... | |
A structure for declaring where we want to access data.
This file defines two helpful classes for working with data on both th CPU and GPU. GPUArray<T> is a templated array that carries around with it some data, as well as information about where that data was last modified and/or accessed. It can be dynamically resized, but does not have vector methods like push_back.
GPUArray<T> objects are manipulated by ArrayHandle<T> objects. So, if you have declared a GPUArray<int> cellIndex(numberOfCells) somewhere, you can access that data by on the spot creating an ArrayHandle: ArrayHandle<int> h_ci(cellPositions,access_location::host, access_mode::overwrite); The data can then be accessed like for (int c = 0; c < numberOfCells;++c) h_ci.data[c] = .....