/*! \brief Builds a string with build options for the OpenCL kernels * * \throws std::bad_alloc if out of memory. */ static std::string makePreprocessorOptions(const std::string &kernelRootPath, const std::string &includeRootPath, size_t warpSize, ocl_vendor_id_t deviceVendorId, const std::string &extraDefines) { std::string preprocessorOptions; /* Compose the complete build options */ preprocessorOptions = formatString("-DWARP_SIZE_TEST=%d", static_cast<int>(warpSize)); preprocessorOptions += ' '; preprocessorOptions += makeVendorFlavorChoice(deviceVendorId); preprocessorOptions += ' '; preprocessorOptions += extraDefines; preprocessorOptions += ' '; preprocessorOptions += selectCompilerOptions(deviceVendorId); preprocessorOptions += ' '; preprocessorOptions += makeKernelIncludePathOption(kernelRootPath); preprocessorOptions += ' '; preprocessorOptions += makeKernelIncludePathOption(includeRootPath); // Mac OS (and maybe some other implementations) does not accept double spaces in options removeExtraSpaces(&preprocessorOptions); return preprocessorOptions; }
int main() { char *s = "I live on earth"; // printf("\n %s\n", removeExtraSpaces(s)); removeExtraSpaces(s); return 0; }