Skip to content
Closed
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
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
4 changes: 2 additions & 2 deletions include/boost/compute/random/normal_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ class normal_distribution
}

/// Returns the minimum value of the distribution.
result_type min() const
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return -std::numeric_limits<RealType>::infinity();
}

/// Returns the maximum value of the distribution.
result_type max() const
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return std::numeric_limits<RealType>::infinity();
}
Expand Down
69 changes: 38 additions & 31 deletions include/boost/compute/random/threefry_engine.hpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
// Added By: Muhammad Junaid Muzammil <mjunaidmuzammil@gmail.com>
// Copyright 2010-2012, D. E. Shaw Research.
// All rights reserved.

// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:

// * Redistributions of source code must retain the above copyright
// notice, this list of conditions, and the following disclaimer.

// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions, and the following disclaimer in the
// documentation and/or other materials provided with the distribution.

// * Neither the name of D. E. Shaw Research nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//---------------------------------------------------------------------------//
// Copyright (c) 2015 Muhammad Junaid Muzammil <mjunaidmuzammil@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.
//---------------------------------------------------------------------------//

#ifndef BOOST_COMPUTE_RANDOM_THREEFRY_HPP
#define BOOST_COMPUTE_RANDOM_THREEFRY_HPP
Expand Down Expand Up @@ -97,6 +75,35 @@ class threefry_engine
std::string cache_key =
std::string("threefry_engine_32x2");

// Copyright 2010-2012, D. E. Shaw Research.
// All rights reserved.

// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:

// * Redistributions of source code must retain the above copyright
// notice, this list of conditions, and the following disclaimer.

// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions, and the following disclaimer in the
// documentation and/or other materials provided with the distribution.

// * Neither the name of D. E. Shaw Research nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
const char source[] =
"#define THREEFRY2x32_DEFAULT_ROUNDS 20\n"
"#define SKEIN_KS_PARITY_32 0x1BD11BDA\n"
Expand Down
2 changes: 1 addition & 1 deletion include/boost/compute/random/uniform_int_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class uniform_int_distribution
/// Creates a new uniform distribution producing numbers in the range
/// [\p a, \p b].
explicit uniform_int_distribution(IntType a = 0,
IntType b = std::numeric_limits<IntType>::max())
IntType b = (std::numeric_limits<IntType>::max)())
: m_a(a),
m_b(b)
{
Expand Down
9 changes: 9 additions & 0 deletions perf/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
#
# ---------------------------------------------------------------------------

include_directories(../include)

set(PERF_BOOST_COMPONENTS system timer chrono program_options)
Expand Down
7 changes: 7 additions & 0 deletions perf/perf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/usr/bin/python

# 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.

# driver script for boost.compute benchmarking. will run a
# benchmark for a given function (e.g. accumulate, sort).

Expand Down
2 changes: 1 addition & 1 deletion perf/perf_accumulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void tune_accumulate(const compute::vector<T>& data,
const compute::uint_ tpbs[] = { 4, 8, 16, 32, 64, 128, 256, 512, 1024 };
const compute::uint_ vpts[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };

double min_time = std::numeric_limits<double>::max();
double min_time = (std::numeric_limits<double>::max)();
compute::uint_ best_tpb = 0;
compute::uint_ best_vpt = 0;

Expand Down
10 changes: 10 additions & 0 deletions perf/perf_exclusive_scan.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2014 Benoit
//
// 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 <algorithm>
#include <iostream>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion perf/perf_saxpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void tune_saxpy(const compute::vector<T>& x,
const compute::uint_ tpbs[] = { 4, 8, 16, 32, 64, 128, 256, 512, 1024 };
const compute::uint_ vpts[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };

double min_time = std::numeric_limits<double>::max();
double min_time = (std::numeric_limits<double>::max)();
compute::uint_ best_tpb = 0;
compute::uint_ best_vpt = 0;

Expand Down
2 changes: 1 addition & 1 deletion perf/perf_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void tune_sort(const std::vector<T>& data,

const compute::uint_ tpbs[] = { 32, 64, 128, 256, 512, 1024 };

double min_time = std::numeric_limits<double>::max();
double min_time = (std::numeric_limits<double>::max)();
compute::uint_ best_tpb = 0;

for(size_t i = 0; i < sizeof(tpbs) / sizeof(*tpbs); i++){
Expand Down
12 changes: 11 additions & 1 deletion perf/perf_tbb_merge.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 <algorithm>
#include <iostream>
#include <vector>
Expand All @@ -17,7 +27,7 @@ struct ParallelMergeRange {
Iterator out; // where to put merged sequence
bool empty() const {return (end1-begin1)+(end2-begin2)==0;}
bool is_divisible() const {
return std::min( end1-begin1, end2-begin2 ) > grainsize;
return (std::min)( end1-begin1, end2-begin2 ) > grainsize;
}
ParallelMergeRange( ParallelMergeRange& r, split ) {
if( r.end1-r.begin1 < r.end2-r.begin2 ) {
Expand Down
2 changes: 1 addition & 1 deletion perf/perf_thrust_exclusive_scan.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
// Copyright (c) 2014 Benoit
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
Expand Down
7 changes: 7 additions & 0 deletions perf/perfdoc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/usr/bin/python

# 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.

import os
import sys
import pylab
Expand Down
9 changes: 9 additions & 0 deletions test/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
#
# ---------------------------------------------------------------------------

include_directories(../include)

set(BOOST_COMPONENTS unit_test_framework)
Expand Down
10 changes: 10 additions & 0 deletions test/context_setup.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 Denis Demidov
//
// 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.
//---------------------------------------------------------------------------//

#ifndef BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP
#define BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP

Expand Down
9 changes: 9 additions & 0 deletions test/extra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ---------------------------------------------------------------------------
# Copyright (c) 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
#
# ---------------------------------------------------------------------------

# include local test headers
include_directories(..)

Expand Down
10 changes: 10 additions & 0 deletions test/opencl_version_check.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//---------------------------------------------------------------------------//
// Copyright (c) 2014 Denis Demidov
//
// 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.
//---------------------------------------------------------------------------//

#ifndef BOOST_COMPUTE_TEST_OPENCL_VERSION_CHECK_HPP
#define BOOST_COMPUTE_TEST_OPENCL_VERSION_CHECK_HPP

Expand Down
Loading