Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
Device.cpp File Reference
#include "shambackends/Device.hpp"
#include "shambase/logs/loglevels.hpp"
#include "shambase/memory.hpp"
#include "shambase/numeric_limits.hpp"
#include "shambase/popen.hpp"
#include "shambase/string.hpp"
#include "shambackends/sysinfo.hpp"
#include "shamcmdopt/env.hpp"
#include "shamcomm/logs.hpp"
#include "shamcomm/mpiInfo.hpp"
#include <fmt/ranges.h>
#include <nlohmann/json.hpp>
+ Include dependency graph for Device.cpp:

Go to the source code of this file.

Namespaces

namespace  sham
 namespace for backends this one is named only sham since shambackends is too long to write
 

Macros

#define FETCH_PROP(info_, info_type)
 Fetches a property of a SYCL device.
 
#define FETCH_PROPN(info_, info_type, n)
 Fetches a property of a SYCL device (for cases where multiple prop would have the same name)
 
#define FETCH_PROPN_FULL(info_, info_type, n)
 Fetches a property of a SYCL device (for cases where multiple prop would have the same name)
 

Functions

Backend sham::get_device_backend (const sycl::device &dev)
 Returns the type of backend of a SYCL device.
 
DeviceType sham::get_device_type (const sycl::device &dev)
 Returns the type of a SYCL device.
 
DeviceProperties sham::fetch_properties (const sycl::device &dev)
 Fetches the properties of a SYCL device.
 
DeviceMPIProperties sham::fetch_mpi_properties (const sycl::device &dev, const DeviceProperties &prop)
 Fetches the MPI-related properties of a SYCL device.
 
std::vector< sycl::device > sham::get_sycl_device_list ()
 Get a list of all SYCL devices.
 
Device sham::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 > > sham::get_device_list ()
 Get a list of all available devices.
 

Variables

auto SHAM_MAX_ALLOC_SIZE = shamcmdopt::getenv_str_register("SHAM_MAX_ALLOC_SIZE", "shamrock max alloc size if set")
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file Device.cpp.

Macro Definition Documentation

◆ FETCH_PROP

#define FETCH_PROP (   info_,
  info_type 
)
Value:
std::optional<info_type> info_ = [&]() -> std::optional<info_type> { \
try { \
return {dev.get_info<sycl::info::device::info_>()}; \
} catch (...) { \
warnings.push_back( \
"dev.get_info<sycl::info::device::" #info_ ">() raised an exception for device " \
+ name); \
return {}; \
} \
}();

Fetches a property of a SYCL device.

Definition at line 154 of file Device.cpp.

◆ FETCH_PROPN

#define FETCH_PROPN (   info_,
  info_type,
 
)
Value:
std::optional<info_type> n = [&]() -> std::optional<info_type> { \
try { \
return {dev.get_info<sycl::info::device::info_>()}; \
} catch (...) { \
warnings.push_back( \
"dev.get_info<sycl::info::device::" #info_ ">() raised an exception for device " \
+ name); \
return {}; \
} \
}();

Fetches a property of a SYCL device (for cases where multiple prop would have the same name)

Definition at line 167 of file Device.cpp.

◆ FETCH_PROPN_FULL

#define FETCH_PROPN_FULL (   info_,
  info_type,
 
)
Value:
std::optional<info_type> n = [&]() -> std::optional<info_type> { \
try { \
return {dev.get_info<info_>()}; \
} catch (...) { \
warnings.push_back( \
"dev.get_info<" #info_ ">() raised an exception for device " + name); \
return {}; \
} \
}();

Fetches a property of a SYCL device (for cases where multiple prop would have the same name)

Definition at line 180 of file Device.cpp.

Variable Documentation

◆ SHAM_MAX_ALLOC_SIZE

auto SHAM_MAX_ALLOC_SIZE = shamcmdopt::getenv_str_register("SHAM_MAX_ALLOC_SIZE", "shamrock max alloc size if set")

Definition at line 30 of file Device.cpp.