From 53832b4f1d5bb3973cf7ae763b35b31753f9f393 Mon Sep 17 00:00:00 2001 From: CNugteren Date: Thu, 28 May 2015 13:34:12 +0200 Subject: [PATCH 1/4] Reduced requirements to GCC 4.7 --- CMakeLists.txt | 4 ++-- README.md | 2 +- include/internal/clpp11.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 927045e..11396b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,8 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH false) # Don't add the automatically deter # Compiler-version check (requires at least CMake 2.8.10) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - message(FATAL_ERROR "GCC version must be at least 4.8") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + message(FATAL_ERROR "GCC version must be at least 4.7") endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) diff --git a/README.md b/README.md index d5ff049..e9c75c8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ CLTune can be compiled as a shared library using CMake. The pre-requisites are: * CMake version 2.8.10 or higher * A C++11 compiler, for example: - - GCC 4.8.0 or newer + - GCC 4.7.0 or newer - Clang 3.3 or newer - AppleClang 5.0 or newer - ICC 14.0 or newer diff --git a/include/internal/clpp11.h b/include/internal/clpp11.h index 636afa4..d97f4ab 100644 --- a/include/internal/clpp11.h +++ b/include/internal/clpp11.h @@ -52,11 +52,11 @@ namespace cltune { class Object { protected: - // Error handling - [[noreturn]] void Error(const std::string &message) const { + // Error handling (NOTE: these functions are [[noreturn]]) + void Error(const std::string &message) const { throw std::runtime_error("Internal OpenCL error: "+message); } - [[noreturn]] void Error(const cl_int status) const { + void Error(const cl_int status) const { throw std::runtime_error("Internal OpenCL error with status: "+std::to_string(status)); } }; From 841a46a59b96648ad30ce3dfc32373e37f5d5642 Mon Sep 17 00:00:00 2001 From: CNugteren Date: Thu, 28 May 2015 14:25:57 +0200 Subject: [PATCH 2/4] Repaired various Clang warnings --- CMakeLists.txt | 3 ++ include/internal/kernel_info.h | 2 +- include/internal/searcher.h | 5 +-- include/internal/searchers/annealing.h | 5 +-- include/internal/searchers/full_search.h | 1 + include/internal/searchers/pso.h | 7 ++-- include/internal/searchers/random_search.h | 1 + include/internal/tuner_impl.h | 2 +- samples/conv/conv.cc | 38 +++++++++++++--------- samples/gemm/gemm.cc | 34 +++++++++++-------- samples/simple/simple.cc | 2 +- src/kernel_info.cc | 2 +- src/searchers/annealing.cc | 14 ++++---- src/searchers/pso.cc | 8 ++--- src/searchers/random_search.cc | 2 +- src/tuner_impl.cc | 13 +++++--- 16 files changed, 81 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11396b5..2720781 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,9 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") endif() elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(FLAGS "${FLAGS} -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded") + set(FLAGS "${FLAGS} -Wno-missing-prototypes -Wno-float-equal -Wno-weak-vtables") + set(FLAGS "${FLAGS} -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes") + set(FLAGS "${FLAGS} -Wno-missing-noreturn -Wno-covered-switch-default") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") diff --git a/include/internal/kernel_info.h b/include/internal/kernel_info.h index f6cbfa4..1c004a8 100644 --- a/include/internal/kernel_info.h +++ b/include/internal/kernel_info.h @@ -91,7 +91,7 @@ class KernelInfo { // Exception of the KernelInfo class class Exception : public std::runtime_error { public: - Exception(const std::string &message): std::runtime_error(message) { }; + Exception(const std::string &message): std::runtime_error(message) { } }; // Initializes the class with a given name and a string of OpenCL source-code diff --git a/include/internal/searcher.h b/include/internal/searcher.h index e2747d0..4dca9fc 100644 --- a/include/internal/searcher.h +++ b/include/internal/searcher.h @@ -48,6 +48,7 @@ class Searcher { // Base constructor Searcher(const Configurations &configurations); + virtual ~Searcher() { } // Pushes feedback (in the form of execution time) from the tuner to the search algorithm virtual void PushExecutionTime(const double execution_time); @@ -63,10 +64,10 @@ class Searcher { protected: // Pseudo-random seed based on the time - unsigned long RandomSeed() const { + unsigned int RandomSeed() const { // std::random_device rd; // return rd(); - return std::chrono::system_clock::now().time_since_epoch().count(); + return static_cast(std::chrono::system_clock::now().time_since_epoch().count()); } // Protected member variables accessible by derived classes diff --git a/include/internal/searchers/annealing.h b/include/internal/searchers/annealing.h index 23b6395..eb029c3 100644 --- a/include/internal/searchers/annealing.h +++ b/include/internal/searchers/annealing.h @@ -42,14 +42,15 @@ class Annealing: public Searcher { // Maximum number of successive visits to already visited states. If this number is exceeded, the // algorithm ends - static constexpr auto kMaxAlreadyVisitedStates = 10; + static constexpr auto kMaxAlreadyVisitedStates = size_t{10}; // Maximum number of differences to consider this still a neighbour - static constexpr auto kMaxDifferences = 3; + static constexpr auto kMaxDifferences = size_t{3}; // Takes additionally a fraction of configurations to consider Annealing(const Configurations &configurations, const double fraction, const double max_temperature); + ~Annealing() {} // Retrieves the next configuration to test virtual KernelInfo::Configuration GetConfiguration() override; diff --git a/include/internal/searchers/full_search.h b/include/internal/searchers/full_search.h index 4f56731..b24d243 100644 --- a/include/internal/searchers/full_search.h +++ b/include/internal/searchers/full_search.h @@ -40,6 +40,7 @@ namespace cltune { class FullSearch: public Searcher { public: FullSearch(const Configurations &configurations); + ~FullSearch() {} // Retrieves the next configuration to test virtual KernelInfo::Configuration GetConfiguration() override; diff --git a/include/internal/searchers/pso.h b/include/internal/searchers/pso.h index 3b789c8..b463af9 100644 --- a/include/internal/searchers/pso.h +++ b/include/internal/searchers/pso.h @@ -53,6 +53,7 @@ class PSO: public Searcher { PSO(const Configurations &configurations, const Parameters ¶meters, const double fraction, const size_t swarm_size, const double influence_global, const double influence_local, const double influence_random); + ~PSO() { } // Retrieves the next configuration to test virtual KernelInfo::Configuration GetConfiguration() override; @@ -77,9 +78,9 @@ class PSO: public Searcher { // Percentages of influence on the whole swarm's best (global), the particle's best (local), and // the random values. The remainder fraction is the chance of staying in the current position. - float influence_global_; - float influence_local_; - float influence_random_; + double influence_global_; + double influence_local_; + double influence_random_; // Locations of the particles in the swarm size_t particle_index_; diff --git a/include/internal/searchers/random_search.h b/include/internal/searchers/random_search.h index 9f23be6..9bdb449 100644 --- a/include/internal/searchers/random_search.h +++ b/include/internal/searchers/random_search.h @@ -42,6 +42,7 @@ class RandomSearch: public Searcher { // Takes additionally a fraction of configurations to try (1.0 == full search) RandomSearch(const Configurations &configurations, const double fraction); + ~RandomSearch() {} // Retrieves the next configuration to test virtual KernelInfo::Configuration GetConfiguration() override; diff --git a/include/internal/tuner_impl.h b/include/internal/tuner_impl.h index 29fa0cd..34fc2e9 100644 --- a/include/internal/tuner_impl.h +++ b/include/internal/tuner_impl.h @@ -59,7 +59,7 @@ class TunerImpl { // Parameters static constexpr auto kMaxL2Norm = 1e-4; // This is the threshold for 'correctness' - static constexpr auto kNumRuns = 1; // This is used for more-accurate execution time measurement + static constexpr auto kNumRuns = size_t{1}; // This is used for more-accurate execution time measurement // Messages printed to stdout (in colours) static const std::string kMessageFull; diff --git a/samples/conv/conv.cc b/samples/conv/conv.cc index df1fd94..d258f18 100644 --- a/samples/conv/conv.cc +++ b/samples/conv/conv.cc @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -52,8 +54,8 @@ constexpr auto kDefaultSearchParameter1 = 4; #define FS (HFS+HFS+1) // Filter size // Settings (sizes) -constexpr auto kSizeX = 8192; // Matrix dimension X -constexpr auto kSizeY = 4096; // Matrix dimension Y +constexpr auto kSizeX = size_t{8192}; // Matrix dimension X +constexpr auto kSizeY = size_t{4096}; // Matrix dimension Y // ================================================================================================= @@ -81,19 +83,23 @@ int main(int argc, char* argv[]) { auto mat_b = std::vector(kSizeX*kSizeY); auto coeff = std::vector(FS*FS); - // Populates data structures - srand(time(nullptr)); - for (auto &item: mat_a) { item = (float)rand() / (float)RAND_MAX; } + // Create a random number generator + const auto random_seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::default_random_engine generator(static_cast(random_seed)); + std::uniform_real_distribution distribution(-2.0f, 2.0f); + + // Populates input data structures + for (auto &item: mat_a) { item = distribution(generator); } for (auto &item: mat_b) { item = 0.0; } // Creates the filter coefficients (gaussian blur) auto sigma = 1.0f; auto mean = FS/2.0f; auto sum = 0.0f; - for (auto x=0; x(exp(exponent) / (2.0f * M_PI * sigma * sigma)); sum += coeff[y*FS + x]; } } @@ -102,7 +108,7 @@ int main(int argc, char* argv[]) { // =============================================================================================== // Initializes the tuner (platform 0, device 'device_id') - cltune::Tuner tuner(0, device_id); + cltune::Tuner tuner(0, static_cast(device_id)); // Sets one of the following search methods: // 0) Random search @@ -111,8 +117,8 @@ int main(int argc, char* argv[]) { // 3) Full search auto fraction = 1/32.0f; if (method == 0) { tuner.UseRandomSearch(fraction); } - else if (method == 1) { tuner.UseAnnealing(fraction, search_param_1); } - else if (method == 2) { tuner.UsePSO(fraction, search_param_1, 0.4, 0.0, 0.4); } + else if (method == 1) { tuner.UseAnnealing(fraction, static_cast(search_param_1)); } + else if (method == 2) { tuner.UsePSO(fraction, static_cast(search_param_1), 0.4, 0.0, 0.4); } else { tuner.UseFullSearch(); } // Outputs the search process to a file @@ -187,8 +193,8 @@ int main(int argc, char* argv[]) { // Sets the function's arguments. Note that all kernels have to accept (but not necessarily use) // all input arguments. - tuner.AddArgumentScalar(kSizeX); - tuner.AddArgumentScalar(kSizeY); + tuner.AddArgumentScalar(static_cast(kSizeX)); + tuner.AddArgumentScalar(static_cast(kSizeY)); tuner.AddArgumentInput(mat_a); tuner.AddArgumentInput(coeff); tuner.AddArgumentOutput(mat_b); @@ -201,8 +207,8 @@ int main(int argc, char* argv[]) { tuner.PrintToFile("output.csv"); // Also prints the performance of the best-case in terms of GB/s and GFLOPS - constexpr auto kMB = (sizeof(float)*2*(long)kSizeX*(long)kSizeY) / (1.0e6); - constexpr auto kMFLOPS = ((1+2*FS*FS)*(long)kSizeX*(long)kSizeY) / (1.0e6); + constexpr auto kMB = (sizeof(float)*2*kSizeX*kSizeY) * 1.0e-6; + constexpr auto kMFLOPS = ((1+2*FS*FS)*kSizeX*kSizeY) * 1.0e-6; if (time_ms != 0.0) { printf("[ -------> ] %.1lf ms or %.1lf GB/s or %1.lf GFLOPS\n", time_ms, kMB/time_ms, kMFLOPS/time_ms); diff --git a/samples/gemm/gemm.cc b/samples/gemm/gemm.cc index dfa5f37..6e9a5db 100644 --- a/samples/gemm/gemm.cc +++ b/samples/gemm/gemm.cc @@ -33,6 +33,8 @@ #include #include #include +#include +#include // Includes the OpenCL tuner library #include "cltune.h" @@ -48,9 +50,9 @@ constexpr auto kDefaultSearchMethod = 1; constexpr auto kDefaultSearchParameter1 = 4; // Settings (sizes) -constexpr auto kSizeM = 2048; -constexpr auto kSizeN = 2048; -constexpr auto kSizeK = 2048; +constexpr auto kSizeM = size_t{2048}; +constexpr auto kSizeN = size_t{2048}; +constexpr auto kSizeK = size_t{2048}; // ================================================================================================= @@ -78,14 +80,18 @@ int main(int argc, char* argv[]) { auto mat_b = std::vector(kSizeN*kSizeK); auto mat_c = std::vector(kSizeM*kSizeN); + // Create a random number generator + const auto random_seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::default_random_engine generator(static_cast(random_seed)); + std::uniform_real_distribution distribution(-2.0f, 2.0f); + // Populates input data structures - srand(time(nullptr)); - for (auto &item: mat_a) { item = (float)rand() / (float)RAND_MAX; } - for (auto &item: mat_b) { item = (float)rand() / (float)RAND_MAX; } + for (auto &item: mat_a) { item = distribution(generator); } + for (auto &item: mat_b) { item = distribution(generator); } for (auto &item: mat_c) { item = 0.0; } // Initializes the tuner (platform 0, device 'device_id') - cltune::Tuner tuner(0, device_id); + cltune::Tuner tuner(0, static_cast(device_id)); // Sets one of the following search methods: // 0) Random search @@ -94,8 +100,8 @@ int main(int argc, char* argv[]) { // 3) Full search auto fraction = 1/2048.0f; if (method == 0) { tuner.UseRandomSearch(fraction); } - else if (method == 1) { tuner.UseAnnealing(fraction, search_param_1); } - else if (method == 2) { tuner.UsePSO(fraction, search_param_1, 0.4, 0.0, 0.4); } + else if (method == 1) { tuner.UseAnnealing(fraction, static_cast(search_param_1)); } + else if (method == 2) { tuner.UsePSO(fraction, static_cast(search_param_1), 0.4, 0.0, 0.4); } else { tuner.UseFullSearch(); } // Outputs the search process to a file @@ -168,9 +174,9 @@ int main(int argc, char* argv[]) { // Sets the function's arguments. Note that all kernels have to accept (but not necessarily use) // all input arguments. - tuner.AddArgumentScalar(kSizeM); - tuner.AddArgumentScalar(kSizeN); - tuner.AddArgumentScalar(kSizeK); + tuner.AddArgumentScalar(static_cast(kSizeM)); + tuner.AddArgumentScalar(static_cast(kSizeN)); + tuner.AddArgumentScalar(static_cast(kSizeK)); tuner.AddArgumentInput(mat_a); tuner.AddArgumentInput(mat_b); tuner.AddArgumentOutput(mat_c); @@ -184,9 +190,9 @@ int main(int argc, char* argv[]) { tuner.PrintFormatted(); // Also prints the performance of the best-case in terms of GFLOPS - constexpr auto kGFLOP = (2*(long)kSizeM*(long)kSizeN*(long)kSizeK) / (1000.0*1000.0*1000.0); + constexpr auto kMGFLOP = (2*kSizeM*kSizeN*kSizeK) * 1.0e-6; if (time_ms != 0.0) { - printf("[ -------> ] %.1lf ms or %.3lf GFLOPS\n", time_ms, 1000*kGFLOP/time_ms); + printf("[ -------> ] %.1lf ms or %.3lf GFLOPS\n", time_ms, kMGFLOP/time_ms); } // End of the tuner example diff --git a/samples/simple/simple.cc b/samples/simple/simple.cc index cbb7b06..4763748 100644 --- a/samples/simple/simple.cc +++ b/samples/simple/simple.cc @@ -50,7 +50,7 @@ int main() { // Create a random number generator const auto random_seed = std::chrono::system_clock::now().time_since_epoch().count(); - std::default_random_engine generator(random_seed); + std::default_random_engine generator(static_cast(random_seed)); std::uniform_real_distribution distribution(-2.0f, 2.0f); // Populates input data structures diff --git a/src/kernel_info.cc b/src/kernel_info.cc index cd82c84..b51a458 100644 --- a/src/kernel_info.cc +++ b/src/kernel_info.cc @@ -41,7 +41,7 @@ KernelInfo::KernelInfo(const std::string name, const std::string source, const D parameters_(), configurations_(), constraints_(), - local_memory_(LocalMemory{[] (std::vector v) { return 0UL; }, std::vector(0)}), + local_memory_(LocalMemory{[] (std::vector v) { return size_t{0}; }, std::vector(0)}), device_(device), global_base_(), local_base_(), global_(), local_(), diff --git a/src/searchers/annealing.cc b/src/searchers/annealing.cc index c5a49ba..412cc99 100644 --- a/src/searchers/annealing.cc +++ b/src/searchers/annealing.cc @@ -46,9 +46,9 @@ Annealing::Annealing(const Configurations &configurations, neighbour_state_(0), num_already_visisted_states_(0), generator_(RandomSeed()), - int_distribution_(0, configurations_.size()), + int_distribution_(0, static_cast(configurations_.size())), probability_distribution_(0.0, 1.0) { - auto random_initial_state = int_distribution_(generator_); + auto random_initial_state = static_cast(int_distribution_(generator_)); current_state_ = random_initial_state; index_ = random_initial_state; } @@ -82,7 +82,7 @@ void Annealing::CalculateNextIndex() { // Computes the new neighbour state auto neighbours = GetNeighboursOf(current_state_); - neighbour_state_ = neighbours[int_distribution_(generator_) % neighbours.size()]; + neighbour_state_ = neighbours[static_cast(int_distribution_(generator_))%neighbours.size()]; // Checks whether this neighbour was already visited. If so, calculate a new neighbour instead. // This continues up to a maximum number, because all neighbours might already be visited. In @@ -102,7 +102,7 @@ void Annealing::CalculateNextIndex() { // The number of configurations is equal to all possible configurations size_t Annealing::NumConfigurations() { - return configurations_.size()*fraction_; + return std::max(size_t{1}, static_cast(configurations_.size()*fraction_)); } // ================================================================================================= @@ -123,12 +123,12 @@ void Annealing::PushExecutionTime(const double execution_time) { // configurations is large. std::vector Annealing::GetNeighboursOf(const size_t reference_id) const { auto neighbours = std::vector{}; - auto other_id = 0; + auto other_id = size_t{0}; for (auto &configuration: configurations_) { // Count the number of different settings for this configuration - auto differences = 0; - auto setting_id = 0; + auto differences = size_t{0}; + auto setting_id = size_t{0}; for (auto &setting: configuration) { if (setting.value != configurations_[reference_id][setting_id].value) { ++differences; } ++setting_id; diff --git a/src/searchers/pso.cc b/src/searchers/pso.cc index 68925c1..2547974 100644 --- a/src/searchers/pso.cc +++ b/src/searchers/pso.cc @@ -52,10 +52,10 @@ PSO::PSO(const Configurations &configurations, const Parameters ¶meters, local_best_configs_(swarm_size_), parameters_(parameters), generator_(RandomSeed()), - int_distribution_(0, configurations_.size()), + int_distribution_(0, static_cast(configurations_.size())), probability_distribution_(0.0, 1.0) { for (auto &position: particle_positions_) { - position = int_distribution_(generator_); + position = static_cast(int_distribution_(generator_)); } index_ = particle_positions_[particle_index_]; } @@ -91,7 +91,7 @@ void PSO::CalculateNextIndex() { } // Move in a random direction else if (probability_distribution_(generator_) <= influence_random_) { - std::uniform_int_distribution distribution(0, parameters_[i].values.size()); + std::uniform_int_distribution distribution(0, parameters_[i].values.size()); next_configuration[i].value = parameters_[i].values[distribution(generator_)]; } // Else: stay at current location @@ -108,7 +108,7 @@ void PSO::CalculateNextIndex() { // The number of configurations is equal to all possible configurations size_t PSO::NumConfigurations() { - return configurations_.size()*fraction_; + return std::max(size_t{1}, static_cast(configurations_.size()*fraction_)); } // ================================================================================================= diff --git a/src/searchers/random_search.cc b/src/searchers/random_search.cc index 0a01fd0..00be074 100644 --- a/src/searchers/random_search.cc +++ b/src/searchers/random_search.cc @@ -56,7 +56,7 @@ void RandomSearch::CalculateNextIndex() { // The number of configurations is equal to all possible configurations size_t RandomSearch::NumConfigurations() { - return configurations_.size()*fraction_; + return std::max(size_t{1}, static_cast(configurations_.size()*fraction_)); } // ================================================================================================= diff --git a/src/tuner_impl.cc b/src/tuner_impl.cc index 1f6de48..46682f6 100644 --- a/src/tuner_impl.cc +++ b/src/tuner_impl.cc @@ -103,7 +103,7 @@ TunerImpl::TunerImpl(size_t platform_id, size_t device_id): // End of the tuner TunerImpl::~TunerImpl() { for (auto &reference_output: reference_outputs_) { - delete[] (int*)reference_output; + delete[] static_cast(reference_output); } if (!suppress_output_) { fprintf(stdout, "\n%s End of the tuning process\n\n", kMessageFull.c_str()); @@ -246,6 +246,7 @@ TunerImpl::TunerResult TunerImpl::RunKernel(const std::string &source, const Ker for (auto &output: arguments_output_) { switch (output.type) { case MemType::kInt: ResetMemArgument(output); break; + case MemType::kSizeT: ResetMemArgument(output); break; case MemType::kFloat: ResetMemArgument(output); break; case MemType::kDouble: ResetMemArgument(output); break; case MemType::kFloat2: ResetMemArgument(output); break; @@ -283,7 +284,7 @@ TunerImpl::TunerResult TunerImpl::RunKernel(const std::string &source, const Ker // Runs the kernel (this is the timed part) fprintf(stdout, "%s Running %s\n", kMessageRun.c_str(), kernel.name().c_str()); auto events = std::vector(kNumRuns); - for (auto t=0; t::max(); - for (auto t=0; t(output_buffer); break; + case MemType::kSizeT: DownloadReference(output_buffer); break; case MemType::kFloat: DownloadReference(output_buffer); break; case MemType::kDouble: DownloadReference(output_buffer); break; case MemType::kFloat2: DownloadReference(output_buffer); break; @@ -370,10 +372,11 @@ template void TunerImpl::DownloadReference(MemArgument &device_buff bool TunerImpl::VerifyOutput() { auto status = true; if (has_reference_) { - auto i = 0; + auto i = size_t{0}; for (auto &output_buffer: arguments_output_) { switch (output_buffer.type) { case MemType::kInt: status &= DownloadAndCompare(output_buffer, i); break; + case MemType::kSizeT: status &= DownloadAndCompare(output_buffer, i); break; case MemType::kFloat: status &= DownloadAndCompare(output_buffer, i); break; case MemType::kDouble: status &= DownloadAndCompare(output_buffer, i); break; case MemType::kFloat2: status &= DownloadAndCompare(output_buffer, i); break; @@ -398,7 +401,7 @@ bool TunerImpl::DownloadAndCompare(MemArgument &device_buffer, const size_t i) { if (status != CL_SUCCESS) { throw OpenCLException("Read buffer error: ", status); } // Compares the results (L2 norm) - T* reference_output = (T*)reference_outputs_[i]; + T* reference_output = static_cast(reference_outputs_[i]); for (auto j=0UL; j Date: Thu, 28 May 2015 14:33:57 +0200 Subject: [PATCH 3/4] Don't enable warning flags when building GTest --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2720781..9b84215 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,9 @@ endif() # ================================================================================================== # Optional: Enables compilation of the Google tests if (TESTS) + + # The tests use specific flags to reduce the amount of warnings from GTest. + set(CMAKE_CXX_FLAGS "-O3 -std=c++11") # Enables Google Test tests (source-code is shipped with the project) add_subdirectory(external/gtest-1.7.0) @@ -143,6 +146,5 @@ if (TESTS) # Adds the tests add_test(name unit_tests command unit_tests) - endif() # ================================================================================================== From 12a7f4fd12b7f4ac94372ca5d650a10396e5f43a Mon Sep 17 00:00:00 2001 From: CNugteren Date: Thu, 28 May 2015 14:36:25 +0200 Subject: [PATCH 4/4] Updated to version 1.6.4 --- CHANGELOG | 4 ++++ CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e156d79..df93173 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,8 @@ +Version 1.6.4 +- Reduced the requirements from GCC 4.8.0 to 4.7.0 +- Fixes various warnings on Clang + Version 1.6.3 - Reduced the requirements from GCC 4.9.0 to 4.8.0 - Minor updates to the CMake file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b84215..a8b97a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 2.8.10) project("cltune" CXX) set(cltune_VERSION_MAJOR 1) set(cltune_VERSION_MINOR 6) -set(cltune_VERSION_PATCH 3) +set(cltune_VERSION_PATCH 4) # Options option(SAMPLES "Enable compilation of sample programs" ON) @@ -131,7 +131,7 @@ endif() # ================================================================================================== # Optional: Enables compilation of the Google tests if (TESTS) - + # The tests use specific flags to reduce the amount of warnings from GTest. set(CMAKE_CXX_FLAGS "-O3 -std=c++11")