Currently, I am working with ILGPU library. As I mentioned in the title briefly, I would like to go through the cameraSpacePoints and check whether the value is valid (if not infinity), if valid store the point in the Arrayview, as the code below.
However the kinect APIs (for e.g. new CameraSpacePoint[depthWidth * depthHeight] )can not be used in a kernel. So how can the below code actually work on GPU?
static void gpu_kernel(Index index,int depthWidth,int depthHeight, ArrayView<CameraSpacePoint> dataView)
{
CameraSpacePoint[] cameraSpacePoints
cameraSpacePoints = new CameraSpacePoint[depthWidth * depthHeight];
for (int i = 0; i < depthWidth*depthHeight; i++)
{
if (!(XMath.IsInfinity(cameraSpacePoints[i].X)))
{
dataView[i] = cameraSpacePoints[i];
}
}
}