Misc

hardware_supported

static vector<string> Tensor::hardware_supported()

Returns a list with hardware accelerators for which this library has been compiled.

Returns

vector of strings with the supported accelerator

vector<string> = Tensor::hardware_supported();
// {"cpu", "cuda", "cuda", "fpga"}

is_hardware_supported

static bool Tensor::is_hardware_supported(string hardware)

Check if a specific hardware is supported.

Returns

bool

bool supported = Tensor::is_hardware_supported("cudnn");
// true

getDeviceID

static int Tensor::getDeviceID(const string &dev)

Returns the device ID given a device name.

Returns

int

Tensor* new_t = new Tensor({3, 3}, Tensor::getDeviceID("cuda:0"));