ComputationKernel Class Reference

HiCR: HiCR::backend::ascend::ComputationKernel Class Reference
HiCR
HiCR::backend::ascend::ComputationKernel Class Referencefinal

#include <computationKernel.hpp>

Inheritance diagram for HiCR::backend::ascend::ComputationKernel:
HiCR::backend::ascend::Kernel

Classes

struct  tensorData_t
 

Public Member Functions

 ComputationKernel (const char *kernelName, const std::vector< tensorData_t > &inputs, const std::vector< tensorData_t > &outputs, const aclopAttr *kernelAttrs)
 
 ComputationKernel (const char *kernelPath, const char *kernelName, const std::vector< tensorData_t > &inputs, const std::vector< tensorData_t > &outputs, const aclopAttr *kernelAttrs)
 
__INLINE__ void start (const aclrtStream stream) override
 
- Public Member Functions inherited from HiCR::backend::ascend::Kernel
__INLINE__ ~Kernel ()=default
 

Static Public Member Functions

static tensorData_t createTensorData (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot, aclTensorDesc *tensorDescriptor)
 

Detailed Description

This class represents a replicable Computation Kernel for the Ascend backend. A Computation Kernel enables the kernel execution in the HiCR runtime, and in particular enables the concatenation of kernel execution and memcpy operations in a common stream of operations.

Constructor & Destructor Documentation

◆ ComputationKernel() [1/2]

HiCR::backend::ascend::ComputationKernel::ComputationKernel ( const char *  kernelName,
const std::vector< tensorData_t > &  inputs,
const std::vector< tensorData_t > &  outputs,
const aclopAttr *  kernelAttrs 
)
inline

Constructor for the Computation Kernel unit class of the Ascend backend. This will not perform any model loading so this aspect should be handled manually (e.g., with aclopSetModelDir())

Parameters
kernelNamename of the kernel
inputskernel input tensor data descriptors
outputskernel output tensor data descriptors
kernelAttrskernel attributes

◆ ComputationKernel() [2/2]

HiCR::backend::ascend::ComputationKernel::ComputationKernel ( const char *  kernelPath,
const char *  kernelName,
const std::vector< tensorData_t > &  inputs,
const std::vector< tensorData_t > &  outputs,
const aclopAttr *  kernelAttrs 
)
inline

Constructor for the Computation Kernel unit class of the Ascend backend. This will load an operator binary file located at the provided path with aclopLoad()

Parameters
kernelPathpath the the kernel .om file
kernelNamename of the kernel
inputskernel input tensor data descriptors
outputskernel output tensor data descriptors
kernelAttrskernel attributes

Member Function Documentation

◆ createTensorData()

static tensorData_t HiCR::backend::ascend::ComputationKernel::createTensorData ( const std::shared_ptr< HiCR::LocalMemorySlot > &  memorySlot,
aclTensorDesc *  tensorDescriptor 
)
inlinestatic

Creates the Ascend-specific Tensor data to be used as input/output parameter to Ascend kernels

Parameters
memorySlotThe memory slot to be used as input/output
tensorDescriptorAscend-specific metadata about the passed memory slot
Returns
The new Ascend tensor data object

◆ start()

__INLINE__ void HiCR::backend::ascend::ComputationKernel::start ( const aclrtStream  stream)
inlineoverridevirtual

Start the kernel using the given ACL stream

Parameters
streamthe ACL stream on which the kernel is to be executed

Implements HiCR::backend::ascend::Kernel.


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