1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_UTILITY_SOURCE_HPP
12 #define BOOST_COMPUTE_UTILITY_SOURCE_HPP
14 /// Stringizes OpenCL source code.
16 /// For example, to create a simple kernel which squares each input value:
18 /// const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE(
19 /// __kernel void square(const float *input, float *output)
21 /// const uint i = get_global_id(0);
22 /// const float x = input[i];
23 /// output[i] = x * x;
27 /// // create and build square program
28 /// program square_program = program::build_with_source(source, context);
30 /// // create square kernel
31 /// kernel square_kernel(square_program, "square");
33 #ifdef BOOST_COMPUTE_DOXYGEN_INVOKED
34 #define BOOST_COMPUTE_STRINGIZE_SOURCE(source)
36 #define BOOST_COMPUTE_STRINGIZE_SOURCE(...) #__VA_ARGS__
39 #endif // BOOST_COMPUTE_UTILITY_SOURCE_HPP