 static int writeMatrix = 1;
 // this must be enabled for this option to work though, slightly hurts performance
 //#define WRITE_OPTION 
+
+// System page size (used for rounding size passed to cudaHostRegister)
+static long page_size = sysconf(_SC_PAGE_SIZE);
 
 typedef struct XGPUInternalContextStruct {
   //memory pointers on the device

    // Register caller-allocated host memory with CUDA.
    // This requires that the caller allocated the memory properly vis-a-vis
    // the requirements of cudaHostRegister!
    cudaHostRegister(context->array_h, compiletime_info.vecLength*sizeof(ComplexInput), 0);
    internal->unregister_array_h = context->array_h;
    internal->free_array_h = NULL;
  } else {
    // allocate host memory
    cudaMallocHost(&(context->array_h), compiletime_info.vecLength*sizeof(ComplexInput));

  }
  context->internal = internal;

  long long unsigned int vecLengthPipe = compiletime_info.vecLengthPipe;
  long long unsigned int matLength = compiletime_info.matLength;

