Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ---------------------------------------------------------------------------
# Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
#
# Distributed under the Boost Software License, Version 1.0
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
#
# ---------------------------------------------------------------------------

cmake_minimum_required(VERSION 2.8)

project(BoostCompute)
Expand Down
9 changes: 9 additions & 0 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ---------------------------------------------------------------------------
# Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
#
# Distributed under the Boost Software License, Version 1.0
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
#
# ---------------------------------------------------------------------------

import quickbook ;
import boostbook ;
import doxygen ;
Expand Down
8 changes: 8 additions & 0 deletions doc/advanced_topics.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section Advanced Topics]

The following topics show advanced features of the Boost Compute library.
Expand Down
8 changes: 8 additions & 0 deletions doc/compute.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[library Boost.Compute
[quickbook 1.5]
[authors [Lutz, Kyle]]
Expand Down
8 changes: 8 additions & 0 deletions doc/design.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:design Design]

[section Library Architecture]
Expand Down
8 changes: 8 additions & 0 deletions doc/faq.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:faq Frequently Asked Questions]

[h3 How do I report a bug, issue, or feature request?]
Expand Down
8 changes: 8 additions & 0 deletions doc/getting_started.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:getting_started Getting Started]

[section Downloading]
Expand Down
8 changes: 8 additions & 0 deletions doc/interop.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:interop Interoperability]

Boost.Compute provides a number of facilities to ease interoperability with
Expand Down
8 changes: 8 additions & 0 deletions doc/introduction.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:introduction Introduction]

The Boost Compute library provides a C++ interface to multi-core CPU and GPGPU
Expand Down
8 changes: 8 additions & 0 deletions doc/performance.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:performance Performance]

The following tests were run with an NVIDIA Tesla K40c GPU on a system
Expand Down
8 changes: 8 additions & 0 deletions doc/platforms_and_compilers.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:platforms_and_compilers Platforms and Compilers]

Boost.Compute has been tested on the following:
Expand Down
8 changes: 8 additions & 0 deletions doc/porting_guide.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section Porting Guide]

[section OpenCL API]
Expand Down
8 changes: 8 additions & 0 deletions doc/reference.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:reference Reference]

[section API Overview]
Expand Down
8 changes: 8 additions & 0 deletions doc/tutorial.qbk
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[/===========================================================================
Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>

Distributed under the Boost Software License, Version 1.0
See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt
=============================================================================/]

[section:tutorial Tutorial]

[section Hello World]
Expand Down
9 changes: 9 additions & 0 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ---------------------------------------------------------------------------
# Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
#
# Distributed under the Boost Software License, Version 1.0
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
#
# ---------------------------------------------------------------------------

include_directories(../include)

set(EXAMPLES
Expand Down
4 changes: 2 additions & 2 deletions example/opencv_convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE (
CLK_ADDRESS_CLAMP_TO_EDGE |
CLK_FILTER_NEAREST;

// Store each work-items unique row and column
// Store each work-item's unique row and column
int x = get_global_id(0);
int y = get_global_id(1);

Expand Down Expand Up @@ -158,7 +158,7 @@ int main(int argc, char *argv[])
{
std::cout<<"Build Error: "<<std::endl
<<filter_program.build_log();
return -1;
return -1;
}

// create fliter kernel and set arguments
Expand Down
4 changes: 2 additions & 2 deletions example/opencv_optical_flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE (
float4 previous_pixel = read_imagef(previous_image,
sampler,
coords);
int2 x1 = (int2)(offset, 0.f);
int2 y1 = (int2)(0.f, offset);
int2 x1 = (int2)(offset, 0.f);
int2 y1 = (int2)(0.f, offset);

//get the difference
float4 curdif = previous_pixel - current_pixel;
Expand Down
10 changes: 10 additions & 0 deletions example/qimage_blur.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2014 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//

#include <iostream>
#include <algorithm>

Expand Down
4 changes: 2 additions & 2 deletions example/simple_moving_average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ bool check_results(const std::vector<float>& values, const std::vector<float>& s
bool res = true;
for(int idx = 0 ; idx < size ; ++idx)
{
int start = std::max(idx - semiWidth,0);
int end = std::min(idx + semiWidth,size-1);
int start = (std::max)(idx - semiWidth,0);
int end = (std::min)(idx + semiWidth,size-1);
float res = 0;
for(int j = start ; j <= end ; ++j)
{
Expand Down
4 changes: 2 additions & 2 deletions include/boost/compute/algorithm/accumulate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ BOOST_PP_SEQ_FOR_EACH(
template<class T>
inline bool can_accumulate_with_reduce(T init, min<T>)
{
return init == std::numeric_limits<T>::max();
return init == (std::numeric_limits<T>::max)();
}

template<class T>
inline bool can_accumulate_with_reduce(T init, max<T>)
{
return init == std::numeric_limits<T>::min();
return init == (std::numeric_limits<T>::min)();
}

#undef BOOST_COMPUTE_DETAIL_DECLARE_CAN_ACCUMULATE_WITH_REDUCE
Expand Down
8 changes: 4 additions & 4 deletions include/boost/compute/async/wait.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace boost {
namespace compute {
namespace detail {

#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
template<class Event>
inline void insert_events_variadic(wait_list &l, Event&& event)
{
Expand All @@ -32,11 +32,11 @@ inline void insert_events_variadic(wait_list &l, Event&& event, Rest&&... rest)

insert_events_variadic(l, std::forward<Rest>(rest)...);
}
#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES

} // end detail namespace

#ifndef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
#ifndef BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
/// Blocks until all events have completed. Events can either be \ref event
/// objects or \ref future "future<T>" objects.
///
Expand All @@ -48,7 +48,7 @@ inline void wait_for_all(Events&&... events)
detail::insert_events_variadic(l, std::forward<Events>(events)...);
l.wait();
}
#endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
#endif // BOOST_COMPUTE_NO_VARIADIC_TEMPLATES

} // end compute namespace
} // end boost namespace
Expand Down
27 changes: 19 additions & 8 deletions include/boost/compute/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@
#error Boost.Compute requires Boost version 1.48 or later
#endif

// the BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES macro is defined
// the BOOST_COMPUTE_NO_VARIADIC_TEMPLATES macro is defined
// if the compiler does not *fully* support variadic templates
#if defined(BOOST_NO_VARIADIC_TEMPLATES) || \
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
defined(BOOST_NO_VARIADIC_TEMPLATES) || \
(defined(__GNUC__) && !defined(__clang__) && \
__GNUC__ == 4 && __GNUC_MINOR__ <= 6)
#define BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES
#endif
#define BOOST_COMPUTE_NO_VARIADIC_TEMPLATES
#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES

// the BOOST_COMPUTE_DETAIL_NO_STD_TUPLE macro is defined if the
// the BOOST_COMPUTE_NO_STD_TUPLE macro is defined if the
// compiler/stdlib does not support std::tuple
#if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
defined(BOOST_NO_0X_HDR_TUPLE) || \
defined(BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES)
#define BOOST_COMPUTE_DETAIL_NO_STD_TUPLE
#endif
defined(BOOST_COMPUTE_NO_VARIADIC_TEMPLATES)
#define BOOST_COMPUTE_NO_STD_TUPLE
#endif // BOOST_NO_CXX11_HDR_TUPLE

// defines BOOST_COMPUTE_CL_CALLBACK to the value of CL_CALLBACK
// if it is defined (it was added in OpenCL 1.1). this is used to
Expand All @@ -56,4 +57,14 @@
# define BOOST_COMPUTE_NO_RVALUE_REFERENCES
#endif // BOOST_NO_CXX11_RVALUE_REFERENCES

#if defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || \
defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
# define BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
#endif // BOOST_NO_CXX11_HDR_INITIALIZER_LIST

#if defined(BOOST_NO_CXX11_HDR_CHRONO) || \
defined(BOOST_NO_0X_HDR_CHRONO)
# define BOOST_COMPUTE_NO_HDR_CHRONO
#endif // BOOST_NO_CXX11_HDR_CHRONO

#endif // BOOST_COMPUTE_CONFIG_HPP
8 changes: 3 additions & 5 deletions include/boost/compute/container/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

#include <boost/compute/config.hpp>

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
!defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif

Expand Down Expand Up @@ -214,8 +213,7 @@ class vector
::boost::compute::copy(vector.begin(), vector.end(), begin(), queue);
}

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
!defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
#ifndef BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST
vector(std::initializer_list<T> list,
command_queue &queue = system::default_queue())
: m_size(list.size()),
Expand All @@ -225,7 +223,7 @@ class vector

::boost::compute::copy(list.begin(), list.end(), begin(), queue);
}
#endif // !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#endif // BOOST_COMPUTE_NO_HDR_INITIALIZER_LIST

vector<T>& operator=(const vector<T> &other)
{
Expand Down
6 changes: 3 additions & 3 deletions include/boost/compute/detail/duration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <boost/config.hpp>

#if !defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
#ifndef BOOST_COMPUTE_NO_HDR_CHRONO
#include <chrono>
#endif

Expand All @@ -23,7 +23,7 @@ namespace boost {
namespace compute {
namespace detail {

#if !defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
#ifndef BOOST_COMPUTE_NO_HDR_CHRONO
template<class Rep, class Period>
inline std::chrono::duration<Rep, Period>
make_duration_from_nanoseconds(std::chrono::duration<Rep, Period>, size_t nanoseconds)
Expand All @@ -32,7 +32,7 @@ make_duration_from_nanoseconds(std::chrono::duration<Rep, Period>, size_t nanose
std::chrono::nanoseconds(nanoseconds)
);
}
#endif // BOOST_NO_CXX11_HDR_CHRONO
#endif // BOOST_COMPUTE_NO_HDR_CHRONO

template<class Rep, class Period>
inline boost::chrono::duration<Rep, Period>
Expand Down
Loading