///original author: Erwin Coumans #include "btOpenCLUtils.h" #include "../parallel_primitives/host/btOpenCLArray.h" #include "../parallel_primitives/host/btLauncherCL.h" #include #define MSTRINGIFY(A) #A const char* kernelString= MSTRINGIFY( __kernel void ReduceGlobal(__global int* d_in, __global int* d_out, int numElements) { int myId = get_global_id(0); int tid = get_local_id(0); int ls = get_local_size(0); for (unsigned int s=ls/2;s>0;s>>=1) { if (myId a(ctx,queue); btOpenCLArray b(ctx,queue); btAlignedObjectArray hostA; btAlignedObjectArray hostB; for (int i=0;i