FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
freetensor::Device Class Reference

#include <device.h>

Public Member Functions

 Device (const TargetType &targetType, int num=0)
 
 Device (const TargetType &targetType, const std::string &getDeviceByName)
 
 Device (const TargetType &targetType, const std::string &getDeviceByFullName, size_t nth)
 
TargetType type () const
 
MemType mainMemType () const
 
int num () const
 
const Ref< Target > & target () const
 
void sync ()
 

Friends

bool operator== (const Device &lhs, const Device &rhs)
 
std::ostream & operator<< (std::ostream &os, const Device &device)
 

Detailed Description

A computing device can be constructed from

  1. (TargetType, DeviceNumber)
  2. (TargetType, getDeviceByName): cuda uses best matches criteria.
  3. (TargetType, FullName, nth): get nth(from 0) device named Fullname.

E.g. Device(TargetType::GPU, 0) means the 0-th GPU (device) Device(TargetType::GPU, "V100") means a GPU which best matches "V100" Device(TargetType::GPU, "NVIDIA GeForce RTX 3060 Laptop GPU", 0)

Constructor & Destructor Documentation

◆ Device() [1/3]

freetensor::Device::Device ( const TargetType targetType,
int  num = 0 
)

◆ Device() [2/3]

freetensor::Device::Device ( const TargetType targetType,
const std::string &  getDeviceByName 
)

◆ Device() [3/3]

freetensor::Device::Device ( const TargetType targetType,
const std::string &  getDeviceByFullName,
size_t  nth 
)

Member Function Documentation

◆ mainMemType()

MemType freetensor::Device::mainMemType ( ) const
inline

◆ num()

int freetensor::Device::num ( ) const
inline

◆ sync()

void freetensor::Device::sync ( )

◆ target()

const Ref< Target > & freetensor::Device::target ( ) const
inline

◆ type()

TargetType freetensor::Device::type ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Device device 
)
friend

◆ operator==

bool operator== ( const Device lhs,
const Device rhs 
)
friend

The documentation for this class was generated from the following files: