Loading [MathJax]/extensions/tex2jax.js
Parallel numerical verification of the σ_odd problem  October 6, 2018
All Classes Namespaces Files Functions Variables Typedefs Macros
Typedefs | Functions | Variables
opencl Namespace Reference

Typedefs

using nat_type = sigmaodd::nat_type
 
using prime_type = sigmaodd::prime_type
 

Functions

std::string get_device_info_string (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl::Device get_first_device_gpu ()
 Return the first GPU device found. If not found then print an error message and exit. More...
 
std::string error_name (cl_int code)
 Return the error name corresponding to the error code. More...
 
void print_device (const cl::Device &device)
 Print information on this device. More...
 
void print_error (cl_int code, std::string message="", bool only_if_error=true, bool exit_if_error=true)
 Print an error message corresponding to the error code. More...
 
void print_platform (const cl::Platform &platform)
 Print information on this platform. More...
 
void print_platforms ()
 Print information on all platforms. More...
 
cl_bool get_device_info_cl_bool (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_device_fp_config get_device_info_cl_device_fp_config (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_device_local_mem_type get_device_info_cl_device_local_mem_type (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_device_mem_cache_type get_device_info_cl_device_mem_cache_type (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_device_type get_device_info_cl_device_type (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_uint get_device_info_cl_uint (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl_ulong get_device_info_cl_ulong (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
size_t get_device_info_size_t (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
VECTOR_CLASS<::size_t > get_device_info_vector_size_t (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
std::set< nat_typeopencl_check_gentle_varsigma_odd (nat_type first_n, nat_type last_n, unsigned int opencl_nb_number=65536, bool print_bad=true, bool print_time=true)
 Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all bad numbers between first_n and last_n (included). The consequence of the result is that: if (all numbers < first_n respect the conjecture) and (all perfect squares < last_n respect the conjecture) and (all bad numbers < last_n respect the conjecture) then all numbers < last_n respect the conjecture. More...
 
std::set< nat_typeopencl_check_gentle_varsigma_odd__parallelize_factorization (nat_type first_n, nat_type last_n, unsigned int opencl_nb=1024, bool print_bad=true, bool print_time=true)
 Like opencl_check_gentle_varsigma_odd() but instead parallelize on group of opencl_nb numbers, compute separately for each number and parallelize the factorization. More...
 
std::vector< nat_typeopencl_check_ns (const std::vector< nat_type > &ns)
 Check all numbers in ns and return vector of all bad numbers found. More...
 
std::vector< nat_typeopencl_run_program_on_ns (const std::string &filename, const std::string &kernal_name, const std::vector< nat_type > &ns)
 Run the OpenCL program from filename on ns. Used for tests. More...
 

Variables

const std::map< int32_t, std::string > errors_map
 Table associating error codes to error names. More...
 

Typedef Documentation

◆ nat_type

Definition at line 28 of file helper.hpp.

◆ prime_type

Definition at line 29 of file helper.hpp.

Function Documentation

◆ error_name()

std::string opencl::error_name ( cl_int  code)

Return the error name corresponding to the error code.

Definition at line 215 of file helper.cpp.

◆ get_device_info_cl_bool()

cl_bool opencl::get_device_info_cl_bool ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_device_fp_config()

cl_device_fp_config opencl::get_device_info_cl_device_fp_config ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_device_local_mem_type()

cl_device_local_mem_type opencl::get_device_info_cl_device_local_mem_type ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_device_mem_cache_type()

cl_device_mem_cache_type opencl::get_device_info_cl_device_mem_cache_type ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_device_type()

cl_device_type opencl::get_device_info_cl_device_type ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_uint()

cl_uint opencl::get_device_info_cl_uint ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_cl_ulong()

cl_ulong opencl::get_device_info_cl_ulong ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_size_t()

size_t opencl::get_device_info_size_t ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_device_info_string()

std::string opencl::get_device_info_string ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

Definition at line 169 of file helper.cpp.

◆ get_device_info_vector_size_t()

VECTOR_CLASS<::size_t> opencl::get_device_info_vector_size_t ( const cl::Device &  device,
cl_device_info  info 
)

Return the corresponding information about the device.

◆ get_first_device_gpu()

cl::Device opencl::get_first_device_gpu ( )

Return the first GPU device found. If not found then print an error message and exit.

Definition at line 194 of file helper.cpp.

◆ opencl_check_gentle_varsigma_odd()

std::set< nat_type > opencl::opencl_check_gentle_varsigma_odd ( nat_type  first_n,
nat_type  last_n,
unsigned int  opencl_nb_number = 65536,
bool  print_bad = true,
bool  print_time = true 
)

Check in the order all odd gentle numbers between first_n and last_n, and if print_bad then print all bad numbers between first_n and last_n (included). The consequence of the result is that: if (all numbers < first_n respect the conjecture) and (all perfect squares < last_n respect the conjecture) and (all bad numbers < last_n respect the conjecture) then all numbers < last_n respect the conjecture.

If prime_time then print the calculation time computed by OpenCL.

sigmaodd::primes.cpp must be compiled without the macro PRIME16.

Parameters
first_n3 <= odd <= last_n
last_n<= MAX_POSSIBLE_N
opencl_nb_numbernumber of n transmitted to OpenCL in one step
print_bad
print_time
Returns
the set of all bad numbers between first_n and last_n (included)

Definition at line 31 of file opencl.cpp.

◆ opencl_check_gentle_varsigma_odd__parallelize_factorization()

std::set< nat_type > opencl::opencl_check_gentle_varsigma_odd__parallelize_factorization ( nat_type  first_n,
nat_type  last_n,
unsigned int  opencl_nb = 1024,
bool  print_bad = true,
bool  print_time = true 
)

Like opencl_check_gentle_varsigma_odd() but instead parallelize on group of opencl_nb numbers, compute separately for each number and parallelize the factorization.

sigmaodd::primes.cpp must be compiled without the macro PRIME16.

Parameters
first_n3 <= odd <= last_n
last_n<= MAX_POSSIBLE_N
opencl_nbnumber of OpenCL units (must be a power of 2, at least 2)
print_bad
print_time
Returns
the set of all bad numbers between first_n and last_n (included)

Definition at line 219 of file opencl.cpp.

◆ opencl_check_ns()

std::vector< nat_type > opencl::opencl_check_ns ( const std::vector< nat_type > &  ns)

Check all numbers in ns and return vector of all bad numbers found.

Parameters
nsvector of odds

Definition at line 440 of file opencl.cpp.

◆ opencl_run_program_on_ns()

std::vector< nat_type > opencl::opencl_run_program_on_ns ( const std::string &  filename,
const std::string &  kernal_name,
const std::vector< nat_type > &  ns 
)

Run the OpenCL program from filename on ns. Used for tests.

Definition at line 516 of file opencl.cpp.

◆ print_device()

void opencl::print_device ( const cl::Device &  device)

Print information on this device.

Definition at line 225 of file helper.cpp.

◆ print_error()

void opencl::print_error ( cl_int  code,
std::string  message = "",
bool  only_if_error = true,
bool  exit_if_error = true 
)

Print an error message corresponding to the error code.

If only_if_error then print only if != 0, else print same if code == 0.

If exit_if_error and (code != 0) then exit.

Definition at line 352 of file helper.cpp.

◆ print_platform()

void opencl::print_platform ( const cl::Platform &  platform)

Print information on this platform.

Definition at line 373 of file helper.cpp.

◆ print_platforms()

void opencl::print_platforms ( )

Print information on all platforms.

Definition at line 407 of file helper.cpp.

Variable Documentation

◆ errors_map

const std::map< int32_t, std::string > opencl::errors_map

Table associating error codes to error names.

https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/errors.html

Definition at line 28 of file helper.cpp.