1 //---------------------------------------------------------------------------// 2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com> 3 // 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 7 // 8 // See http://boostorg.github.com/compute for more information. 9 //---------------------------------------------------------------------------// 10 11 #ifndef BOOST_COMPUTE_UTILITY_SOURCE_HPP 12 #define BOOST_COMPUTE_UTILITY_SOURCE_HPP 13 14 /// Stringizes OpenCL source code. 15 /// 16 /// For example, to create a simple kernel which squares each input value: 17 /// \code 18 /// const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE( 19 /// __kernel void square(const float *input, float *output) 20 /// { 21 /// const uint i = get_global_id(0); 22 /// const float x = input[i]; 23 /// output[i] = x * x; 24 /// } 25 /// ); 26 /// 27 /// // create and build square program 28 /// program square_program = program::build_with_source(source, context); 29 /// 30 /// // create square kernel 31 /// kernel square_kernel(square_program, "square"); 32 /// \endcode 33 #ifdef BOOST_COMPUTE_DOXYGEN_INVOKED 34 #define BOOST_COMPUTE_STRINGIZE_SOURCE(source) 35 #else 36 #define BOOST_COMPUTE_STRINGIZE_SOURCE(...) #__VA_ARGS__ 37 #endif 38 39 #endif // BOOST_COMPUTE_UTILITY_SOURCE_HPP 40