Loading [MathJax]/extensions/tex2jax.js
Parallel numerical verification of the σ_odd problem  October 6, 2018
All Classes Namespaces Files Functions Variables Typedefs Macros
Namespaces | Macros | Functions | Variables
helper.cpp File Reference
#include "../../common/helper/helper.hpp"
#include "helper.hpp"
#include "errors_map.txt"
Include dependency graph for helper.cpp:

Go to the source code of this file.

Namespaces

 opencl
 

Macros

#define GET_DEVICE_INFO_NAME_TYPE(NAME, TYPE)
 
#define GET_DEVICE_INFO_TYPE(TYPE)   GET_DEVICE_INFO_NAME_TYPE(TYPE, TYPE)
 

Functions

std::string opencl::get_device_info_string (const cl::Device &device, cl_device_info info)
 Return the corresponding information about the device. More...
 
cl::Device opencl::get_first_device_gpu ()
 Return the first GPU device found. If not found then print an error message and exit. More...
 
std::string opencl::error_name (cl_int code)
 Return the error name corresponding to the error code. More...
 
void opencl::print_device (const cl::Device &device)
 Print information on this device. More...
 
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. More...
 
void opencl::print_platform (const cl::Platform &platform)
 Print information on this platform. More...
 
void opencl::print_platforms ()
 Print information on all platforms. More...
 

Variables

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

Detailed Description

(January 8, 2018)

GPLv3 — Copyright (C) 2017, 2018 Olivier Pirson http://www.opimedia.be/

Definition in file helper.cpp.

Macro Definition Documentation

◆ GET_DEVICE_INFO_NAME_TYPE

#define GET_DEVICE_INFO_NAME_TYPE (   NAME,
  TYPE 
)
Value:
TYPE \
get_device_info_##NAME(const cl::Device &device, cl_device_info info) { \
TYPE value; \
\
const cl_int error = device.getInfo(info, &value); \
\
if (error != CL_SUCCESS) { \
std::cerr << "! Device::getInfo(" << info << ") error in get " \
<< #TYPE << ": \"" \
<< error_name(error) << '"' <<std::endl; \
} \
\
return value; \
}
std::string error_name(cl_int code)
Return the error name corresponding to the error code.
Definition: helper.cpp:215

Definition at line 127 of file helper.cpp.

◆ GET_DEVICE_INFO_TYPE

#define GET_DEVICE_INFO_TYPE (   TYPE)    GET_DEVICE_INFO_NAME_TYPE(TYPE, TYPE)

Definition at line 144 of file helper.cpp.