Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
livelace committed Oct 1, 2021
1 parent 99aa72b commit 9f73339
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/const.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 4 additions & 3 deletions src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ void Data::generate_data() {
if (m_generator == "random")
{
m_double = new double[m_length];
std::uniform_real_distribution<double> dist(defaults::RANDOM_DOUBLE_BEGIN, defaults::RANDOM_DOUBLE_END);
std::uniform_real_distribution<double> dist(std::numeric_limits<double>::min(),
std::numeric_limits<double>::max());
for (unsigned long i=0; i < m_length; ++i) { m_double[i] = dist(m_mt); }
}

Expand All @@ -51,7 +52,7 @@ void Data::generate_data() {
if (m_generator == "random")
{
m_int = new int[m_length];
std::uniform_int_distribution<int> dist(defaults::RANDOM_INT_BEGIN, defaults::RANDOM_INT_END);
std::uniform_int_distribution<int> dist(std::numeric_limits<int>::min(), std::numeric_limits<int>::max());
for (unsigned long i=0; i < m_length; ++i) { m_int[i] = dist(m_mt); }
}

Expand All @@ -76,7 +77,7 @@ void Data::generate_data() {
if (m_generator == "random")
{
m_long = new long[m_length];
std::uniform_int_distribution<long> dist(defaults::RANDOM_LONG_BEGIN, defaults::RANDOM_LONG_END);
std::uniform_int_distribution<long> dist(std::numeric_limits<long>::min(), std::numeric_limits<int>::max());
for (unsigned long i=0; i < m_length; ++i) { m_long[i] = dist(m_mt); }
}

Expand Down
5 changes: 3 additions & 2 deletions src/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
#include <CL/opencl.hpp>
Expand All @@ -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};
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/opencl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <memory>

Expand Down

0 comments on commit 9f73339

Please sign in to comment.