/home/runner/work/HiCR/HiCR/include/hicr/backends/ascend/device.hpp Source File
HiCR
|
device.hpp
Go to the documentation of this file.
54 Device(const deviceIdentifier_t id, const computeResourceList_t &computeResources, const memorySpaceList_t &memorySpaces)
61 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("Can not create context for device %ld. Error %d", _id, err);
97 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("Can not destroy context for device %ld. Error %d", _id, err);
133 if (input.contains(key) == false) HICR_THROW_LOGIC("The serialized object contains no '%s' key", key.c_str());
134 if (input[key].is_number() == false) HICR_THROW_LOGIC("The '%s' entry is not a number", key.c_str());
144 if (type != "Ascend Processor") HICR_THROW_LOGIC("The passed device type '%s' is not compatible with this topology manager", type.c_str());
160 if (type != "Ascend Device RAM") HICR_THROW_LOGIC("The passed device type '%s' is not compatible with this topology manager", type.c_str());
188 __INLINE__ static void selectDevice(const aclrtContext *deviceContext, const deviceIdentifier_t deviceId)
192 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("can not set the device %ld context. Error %d", deviceId, err);
This file implements the compute resource class for the Ascend backend.
This file implements the memory space class for the Ascend backend.
Definition device.hpp:53
__INLINE__ void deserialize(const nlohmann::json &input)
Definition device.hpp:152
std::vector< std::shared_ptr< ComputeResource > > computeResourceList_t
Definition device.hpp:59
std::vector< std::shared_ptr< MemorySpace > > memorySpaceList_t
Definition device.hpp:64
__INLINE__ void addMemorySpace(const std::shared_ptr< HiCR::MemorySpace > &memorySpace)
Definition device.hpp:99
__INLINE__ void addComputeResource(const std::shared_ptr< HiCR::ComputeResource > &computeResource)
Definition device.hpp:92
Definition device.hpp:39
__INLINE__ std::string getType() const override
Definition device.hpp:105
Device(const deviceIdentifier_t id, const computeResourceList_t &computeResources, const memorySpaceList_t &memorySpaces)
Definition device.hpp:54
__INLINE__ aclrtContext * getContext() const
Definition device.hpp:119
uint64_t deviceIdentifier_t
Definition device.hpp:45
__INLINE__ deviceIdentifier_t getId() const
Definition device.hpp:112
Provides a base definition for a HiCR Device class.
constexpr std::string_view _HICR_DEVICE_MEMORY_SPACES_KEY_
Definition device.hpp:40
constexpr std::string_view _HICR_DEVICE_COMPUTE_RESOURCES_KEY_
Definition device.hpp:35
Generated by