Library

enum profit::simd_instruction_set

SIMD instruction sets choosers can choose from

Values:

enumerator AUTO

Automatically choose the best available SIMD instruction set.

enumerator NONE

No SIMD instruction set.

enumerator SSE2

The SSE2 instruction set.

enumerator AVX

The AVX instruction set.

bool profit::init()

Initializes the libprofit library. This function must be called once before using the library in any way. At the end, call finish(). If the user fails to call init() the library might work, but it’s not guaranteed that it will do so correctly, or as intended.

A successful initialization does not mean that all went internally. Use init_diagnose() to get a report on what may have possibly gone wrong, specially if a call to init() does not succeed.

Returns:

If the initialization was correct

void profit::finish()

Finalizes the libprofit library. All internal resources are freed. This method should be called after the library has been used. After a call to finish(), no other usage of the library should occur (except for finish_diagnose()) unless init() is called again.

std::string profit::version()

Returns the version of this libprofit library

Returns:

The version of this libprofit library

unsigned short profit::version_major()

Returns the major version of this libprofit library

Returns:

The major version of this libprofit library

unsigned short profit::version_minor()

Returns the minor version of this libprofit library

Returns:

The minor version of this libprofit library

unsigned short profit::version_patch()

Returns the patch version of this libprofit library

Returns:

The patch version of this libprofit library

bool profit::has_openmp()

Returns whether libprofit was compiled with OpenMP support

Returns:

Whether libprofit was compiled with OpenMP support

bool profit::has_fftw()

Returns whether libprofit was compiled with FFTW support

Returns:

Whether libprofit was compiled with FFTW support

bool profit::has_fftw_with_openmp()

Returns whether libprofit was compiled against an FFTW library with OpenMP support

Returns:

Whether libprofit was compiled against an FFTW library with OpenMP support

bool profit::has_opencl()

Returns whether libprofit was compiled with OpenCL support

Returns:

Whether libprofit was compiled with OpenCL support

unsigned short profit::opencl_version_major()

If OpenCL is supported, returns the major portion of the highest OpenCL platform version libprofit can work against. For example, if libprofit was compiled against a platform supporting OpenCL 2.1, this method returns 2. If OpenCL is not supported, the result is undefined.

Returns:

The major highest OpenCL platform version that libprofit can work against.

unsigned short profit::opencl_version_minor()

If OpenCL is supported, returns the minor portion of the highest OpenCL platform version libprofit can work against. For example, if libprofit was compiled against a platform supporting OpenCL 1.2, this method returns 2. If OpenCL is not supported, the result is undefined.

bool profit::has_simd_instruction_set(simd_instruction_set instruction_set)

Returns whether libprofit was compiled with support for the specified SIMD instruction set

Parameters:

instruction_set – The instruction set to check. AUTO and NONE will always be supported

Returns:

whether libprofit was compiled with support for the specified SIMD instruction set