From 9f73339c615aa9422024955331ede49872a5f947 Mon Sep 17 00:00:00 2001 From: Oleg 'livelace' Popov Date: Fri, 1 Oct 2021 23:21:20 +0300 Subject: [PATCH] ci --- src/const.cpp | 6 ------ src/data.cpp | 7 ++++--- src/device.h | 5 +++-- src/opencl.h | 1 + 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/const.cpp b/src/const.cpp index 779d0a6..fe46bc7 100644 --- a/src/const.cpp +++ b/src/const.cpp @@ -13,10 +13,4 @@ namespace defaults extern const std::string DEFAULT_OPENCL_KERNEL_NAME = "clmixer"; extern const unsigned long DEFAULT_OPENCL_BUFFER_SIZE = 1 * 1024 * 1024 * 1024; // 1g extern const unsigned long DEFAULT_RANDOM_SEED = 42; // 42! - extern const double RANDOM_DOUBLE_BEGIN = std::pow(2, sizeof(double) * 8) / -2; - extern const double RANDOM_DOUBLE_END = std::pow(2, sizeof(double) * 8) / 2; - extern const int RANDOM_INT_BEGIN = std::pow(2, sizeof(int) * 8) / -2; - extern const int RANDOM_INT_END = std::pow(2, sizeof(int) * 8) / 2; - extern const long RANDOM_LONG_BEGIN = std::pow(2, sizeof(long) * 8) / -2; - extern const long RANDOM_LONG_END = std::pow(2, sizeof(long) * 8) / 2; } diff --git a/src/data.cpp b/src/data.cpp index 31b20b8..aa63d86 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -26,7 +26,8 @@ void Data::generate_data() { if (m_generator == "random") { m_double = new double[m_length]; - std::uniform_real_distribution dist(defaults::RANDOM_DOUBLE_BEGIN, defaults::RANDOM_DOUBLE_END); + std::uniform_real_distribution dist(std::numeric_limits::min(), + std::numeric_limits::max()); for (unsigned long i=0; i < m_length; ++i) { m_double[i] = dist(m_mt); } } @@ -51,7 +52,7 @@ void Data::generate_data() { if (m_generator == "random") { m_int = new int[m_length]; - std::uniform_int_distribution dist(defaults::RANDOM_INT_BEGIN, defaults::RANDOM_INT_END); + std::uniform_int_distribution dist(std::numeric_limits::min(), std::numeric_limits::max()); for (unsigned long i=0; i < m_length; ++i) { m_int[i] = dist(m_mt); } } @@ -76,7 +77,7 @@ void Data::generate_data() { if (m_generator == "random") { m_long = new long[m_length]; - std::uniform_int_distribution dist(defaults::RANDOM_LONG_BEGIN, defaults::RANDOM_LONG_END); + std::uniform_int_distribution dist(std::numeric_limits::min(), std::numeric_limits::max()); for (unsigned long i=0; i < m_length; ++i) { m_long[i] = dist(m_mt); } } diff --git a/src/device.h b/src/device.h index 0e5664f..fc6ef7c 100644 --- a/src/device.h +++ b/src/device.h @@ -4,6 +4,7 @@ #define CL_MINIMUM_OPENCL_VERSION 110 #define CL_HPP_MINIMUM_OPENCL_VERSION 110 +#define CL_HPP_TARGET_OPENCL_VERSION 300 #include #include @@ -15,7 +16,7 @@ class Device { public: unsigned int id; - uint clock_speed{0}; + unsigned int clock_speed{0}; bool image_support{false}; ulong memory_global_size{0}; ulong memory_max_allocate{0}; @@ -25,7 +26,7 @@ class Device { bool svm_coarse_grained_buffer{false}; bool svm_fine_grained_buffer{false}; bool svm_fine_grained_system{false}; - uint work_group_dimension{0}; + unsigned int work_group_dimension{0}; size_t work_group_size{0}; cl::Device cl_device; diff --git a/src/opencl.h b/src/opencl.h index a310a56..09f0e0c 100644 --- a/src/opencl.h +++ b/src/opencl.h @@ -4,6 +4,7 @@ #define CL_MINIMUM_OPENCL_VERSION 110 #define CL_HPP_MINIMUM_OPENCL_VERSION 110 +#define CL_HPP_TARGET_OPENCL_VERSION 300 #include