Namespace Library

namespace library

Typedefs

typedef khiva_backend Backend

Enums

enum khiva_backend

Values:

KHIVA_BACKEND_DEFAULT = af::Backend::AF_BACKEND_DEFAULT

Default backend order: OpenCL -> CUDA -> CPU.

KHIVA_BACKEND_CPU = af::Backend::AF_BACKEND_CPU

CPU a.k.a sequential algorithms.

KHIVA_BACKEND_CUDA = af::Backend::AF_BACKEND_CUDA

CUDA Compute Backend.

KHIVA_BACKEND_OPENCL = af::Backend::AF_BACKEND_OPENCL

OpenCL Compute Backend.

Functions

std::string backendInfo()

Get information from the active backend.

Return
std::string The information of the backend.

void setBackend(khiva::library::Backend be)

Set the backend.

Parameters
  • be: The desired backend.

khiva::library::Backend getBackend()

Get the active backend.

Return
khiva::library::Backend The active backend.

int getBackends()

Get the available backends.

Return
int The available backends.

void setDevice(int device)

Set the device.

Parameters
  • device: The desired device.

int getDevice()

Get the active device.

Return
int The active device.

int getDeviceCount()

Get the device count.

Return
int The device count.

void setDeviceMemoryInGB(double memory)

Set the memory of the device in use. This information is used for splitting some algorithms and execute them in batch mode. The default value used if it is not set is 4GB.

Parameters
  • memory: The device memory.

namespace internal

Enums

enum Complexity

Values:

LINEAR
CUADRATIC
CUBIC

Functions

void setDeviceMemoryInGB(double memory)

Set the memory of the device in use. This information is used for splitting some algorithms and execute them in batch mode. The default value used if it is not set is 4GB.

Parameters
  • memory: The device memory.

long getValueScaledToMemoryDevice(long value, Complexity complexity)

Get the value scaled to the memory of the device taking into account the Memory complexity.

Return
the scaled value.
Parameters
  • value: The value to scale.
  • complexity: The complexity to scale with.