From c30abd843e68dfbd186ca25e8a8ecaefcf95776f Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Wed, 23 Nov 2022 12:11:32 +0000 Subject: Refactor: Remove m_ImportFlags from RefTensorHandle The import flags for a RefTensorHandle shouldn't be a data member, as RefTensorHandle can only import from MemorySource::Malloc. Instead, use m_ImportEnabled to determine what to return from GetImportFlags(). Simplifies the code in Import and CanBeImported. Signed-off-by: Matthew Bentham Change-Id: Ic629858920f7dd32f99ee27f150b81d8b67144cf --- src/backends/reference/test/RefTensorHandleTests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backends/reference/test') diff --git a/src/backends/reference/test/RefTensorHandleTests.cpp b/src/backends/reference/test/RefTensorHandleTests.cpp index 6f608e8541..b5fcc212a9 100644 --- a/src/backends/reference/test/RefTensorHandleTests.cpp +++ b/src/backends/reference/test/RefTensorHandleTests.cpp @@ -137,7 +137,7 @@ TEST_CASE("RefTensorHandleFactoryImport") TEST_CASE("RefTensorHandleImport") { TensorInfo info({ 1, 1, 2, 1 }, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); handle.Manage(); handle.Allocate(); @@ -224,7 +224,7 @@ TEST_CASE("TestManagedConstTensorHandle") TEST_CASE("CheckSourceType") { TensorInfo info({1}, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); int* testPtr = new int(4); @@ -243,7 +243,7 @@ TEST_CASE("CheckSourceType") TEST_CASE("ReusePointer") { TensorInfo info({1}, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); int* testPtr = new int(4); @@ -258,7 +258,7 @@ TEST_CASE("ReusePointer") TEST_CASE("MisalignedPointer") { TensorInfo info({2}, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); // Allocate a 2 int array int* testPtr = new int[2]; @@ -274,7 +274,7 @@ TEST_CASE("MisalignedPointer") TEST_CASE("CheckCanBeImported") { TensorInfo info({1}, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); int* testPtr = new int(4); @@ -291,7 +291,7 @@ TEST_CASE("CheckCanBeImported") TEST_CASE("MisalignedCanBeImported") { TensorInfo info({2}, DataType::Float32); - RefTensorHandle handle(info, static_cast(MemorySource::Malloc)); + RefTensorHandle handle(info); // Allocate a 2 int array int* testPtr = new int[2]; -- cgit v1.2.1