17 #include <doctest/doctest.h> 28 void DeleteAsType(
const void*
const blob)
30 delete static_cast<const T*
>(blob);
37 TestWorkloadFactory(
void* ptr)
43 return GetCloneIdStatic();
59 TEST_CASE (
"PreCompiledLayerClonePreservesObject")
68 std::unique_ptr<std::string> payload = std::make_unique<std::string>(
"Hello");
71 TestWorkloadFactory factory(payloadObject.get());
74 layer->CreateWorkload(factory);
77 CHECK(std::strcmp(clone->
GetName(),
"preCompiled") == 0);
81 TEST_CASE (
"PreCompiledLayerCloneNoObject")
92 TestWorkloadFactory factory(
nullptr);
93 layer->CreateWorkload(factory);
96 CHECK(std::strcmp(clone->
GetName(),
"preCompiled") == 0);
TEST_SUITE("TestConstTensorLayerVisitor")
virtual const BackendId & GetBackendId() const =0
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
std::unique_ptr< void, PreCompiledObjectDeleter > PreCompiledObjectPtr
PreCompiledLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
void SetPreCompiledObject(PreCompiledObjectPtr preCompiledObject)
void * m_PreCompiledObject
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
std::unique_ptr< IWorkload > CreatePreCompiled(const PreCompiledQueueDescriptor &, const WorkloadInfo &) const override
Contains information about TensorInfos of a layer.
const char * GetName() const override
Returns the name of the layer.
A PreCompiledDescriptor for the PreCompiledLayer.