Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:38

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 
0011 #ifndef BOOST_COMPUTE_UTILITY_SOURCE_HPP
0012 #define BOOST_COMPUTE_UTILITY_SOURCE_HPP
0013 
0014 /// Stringizes OpenCL source code.
0015 ///
0016 /// For example, to create a simple kernel which squares each input value:
0017 /// \code
0018 /// const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE(
0019 ///     __kernel void square(const float *input, float *output)
0020 ///     {
0021 ///         const uint i = get_global_id(0);
0022 ///         const float x = input[i];
0023 ///         output[i] = x * x;
0024 ///     }
0025 /// );
0026 ///
0027 /// // create and build square program
0028 /// program square_program = program::build_with_source(source, context);
0029 ///
0030 /// // create square kernel
0031 /// kernel square_kernel(square_program, "square");
0032 /// \endcode
0033 #ifdef BOOST_COMPUTE_DOXYGEN_INVOKED
0034 #define BOOST_COMPUTE_STRINGIZE_SOURCE(source)
0035 #else
0036 #define BOOST_COMPUTE_STRINGIZE_SOURCE(...) #__VA_ARGS__
0037 #endif
0038 
0039 #endif // BOOST_COMPUTE_UTILITY_SOURCE_HPP