SOP:
simple moveKernel
#include "interpolate.h"
float lerpConstant( constant float * in, int size, float pos); float3 getFloat3(global float * data, int i)
{
return (float3)(data[i*+], data[i*+], data[i*+]);
} void setFloat3(global float * dataout, int i, float3 datain)
{
dataout[i*+] = datain.s0;
dataout[i*+] = datain.s1;
dataout[i*+] = datain.s2;
} kernel void moveKernel(
float time,
int test_length,
global float * test )
{
int idx = get_global_id();
if (idx >= test_length)
return; float3 datain = getFloat3(test,idx);
datain.s1 += time;
setFloat3(test,idx, datain);
}
binding:
<2>