24 enum class Vendor { UNKNOWN, NVIDIA, AMD, INTEL, APPLE };
34 case Vendor::UNKNOWN:
return "Unknown";
35 case Vendor::NVIDIA :
return "Nvidia";
36 case Vendor::AMD :
return "AMD";
37 case Vendor::INTEL :
return "Intel";
38 case Vendor::APPLE :
return "Apple";
45 enum class Backend { UNKNOWN, CUDA, ROCM, OPENMP };
56 case Backend::UNKNOWN:
return "Unknown";
57 case Backend::CUDA :
return "CUDA";
58 case Backend::ROCM :
return "ROCm";
59 case Backend::OPENMP :
return "OpenMP";
72 case DeviceType::CPU:
return "CPU";
73 case DeviceType::GPU:
return "GPU";
74 default :
return "UNKNOWN";
138 bool is_mpi_direct_capable;
std::size_t usize
size_t alias
Represents a SYCL device.
usize device_id
The id of the device.
DeviceMPIProperties mpi_prop
Properties of the device regarding MPI.
sycl::device dev
The SYCL device object.
DeviceProperties prop
Properties of the device.
void update_mpi_prop()
Update the MPI properties of the device.
void print_info()
Print info about the device.
This header file contains utility functions related to exception handling in the code.
namespace for backends this one is named only sham since shambackends is too long to write
std::string backend_name(Backend b)
Returns the name of the given backend.
Device sycl_dev_to_sham_dev(usize i, const sycl::device &dev)
Convert a SYCL device to a shamrock backend device.
std::vector< std::unique_ptr< Device > > get_device_list()
Get a list of all available devices.
std::string vendor_name(Vendor v)
Returns the name of the given vendor.
std::string device_type_name(DeviceType t)
Returns the name of the given device type.
DeviceType
The type of a device.
void throw_unimplemented(SourceLocation loc=SourceLocation{})
Throw a std::runtime_error saying that the function is unimplemented.
std::string platform
The name of the platform of the device.
usize global_mem_size
The amount of global memory on the device in bytes.
uint64_t max_mem_alloc_size_dev
The maximum size of memory that can be allocated on the device in bytes.
usize global_mem_cache_size
The amount of global memory cache on the device in bytes.
uint32_t max_compute_units
The number of compute units on the device.
std::vector< std::string > warnings
Warnings emitted during property fetching.
uint32_t mem_base_addr_align
The base address alignment for memory allocations on the device in bytes.
std::optional< std::string > pci_address
PCI address of the device.
usize global_mem_cache_line_size
The size of the cache line used by the device in bytes.
uint32_t default_work_group_size
Default work group size.
uint64_t max_mem_alloc_size_host
The maximum size of memory that can be allocated on the host in bytes.
DeviceType type
The type of the device.
std::vector< size_t > sub_group_sizes
SYCL sub group sizes property.
Vendor vendor
The vendor of the device.
usize local_mem_size
The amount of shared local memory on the device in bytes.
std::string name
The name of the device.
Backend backend
The backend of the device.