Skip to content

Commit c870628

Browse files
Rename SHARED_RESOURCE allocation type to SHARED_RESOURCE_COPY
Change-Id: Ie846450384730171304788bbb1709d7f088036a8
1 parent d56daf1 commit c870628

10 files changed

+14
-14
lines changed

runtime/memory_manager/graphics_allocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
6262
INDIRECT_OBJECT_HEAP,
6363
SURFACE_STATE_HEAP,
6464
DYNAMIC_STATE_HEAP,
65-
SHARED_RESOURCE,
65+
SHARED_RESOURCE_COPY,
6666
SVM,
6767
UNDECIDED,
6868
};

runtime/memory_manager/memory_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryInPreferredPool(Allocat
310310
}
311311

312312
GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &allocationData) {
313-
if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE || allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE) {
313+
if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE || allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) {
314314
UNRECOVERABLE_IF(allocationData.imgInfo == nullptr);
315315
return allocateGraphicsMemoryForImage(allocationData);
316316
}

runtime/memory_manager/memory_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class MemoryManager {
231231
status = AllocationStatus::Error;
232232
switch (allocationData.type) {
233233
case GraphicsAllocation::AllocationType::IMAGE:
234-
case GraphicsAllocation::AllocationType::SHARED_RESOURCE:
234+
case GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY:
235235
break;
236236
default:
237237
if (!allocationData.flags.useSystemMemory && !(allocationData.flags.allow32Bit && this->force32bitAllocations)) {

runtime/os_interface/debug_settings_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ const char *DebugSettingsManager<DebugLevel>::getAllocationTypeString(GraphicsAl
313313
return "SURFACE_STATE_HEAP";
314314
case OCLRT::GraphicsAllocation::AllocationType::DYNAMIC_STATE_HEAP:
315315
return "DYNAMIC_STATE_HEAP";
316-
case OCLRT::GraphicsAllocation::AllocationType::SHARED_RESOURCE:
317-
return "SHARED_RESOURCE";
316+
case OCLRT::GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY:
317+
return "SHARED_RESOURCE_COPY";
318318
case OCLRT::GraphicsAllocation::AllocationType::SVM:
319319
return "SVM";
320320
case OCLRT::GraphicsAllocation::AllocationType::UNDECIDED:

runtime/sharings/d3d/d3d_surface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo
9191
}
9292

9393
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
94-
allocProperties.allocationType = GraphicsAllocation::AllocationType::SHARED_RESOURCE;
94+
allocProperties.allocationType = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY;
9595
DevicesBitfield devices = 0;
9696

9797
alloc = context->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);

unit_tests/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ TEST(MemoryManagerTest, givenNotSetUseSystemMemoryWhenGraphicsAllocationInDevice
2424
memoryManager.freeGraphicsMemory(allocation);
2525
}
2626

27-
TEST(MemoryManagerTest, givenImageOrSharedResourceWhenGraphicsAllocationInDevicePoolIsAllocatedThenNullptrIsReturned) {
27+
TEST(MemoryManagerTest, givenImageOrSharedResourceCopyWhenGraphicsAllocationInDevicePoolIsAllocatedThenNullptrIsReturned) {
2828
ExecutionEnvironment executionEnvironment;
2929
OsAgnosticMemoryManager memoryManager(false, false, executionEnvironment);
3030

@@ -34,7 +34,7 @@ TEST(MemoryManagerTest, givenImageOrSharedResourceWhenGraphicsAllocationInDevice
3434
allocData.flags.allocateMemory = true;
3535

3636
GraphicsAllocation::AllocationType types[] = {GraphicsAllocation::AllocationType::IMAGE,
37-
GraphicsAllocation::AllocationType::SHARED_RESOURCE};
37+
GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY};
3838

3939
for (uint32_t i = 0; i < arrayCount(types); i++) {
4040
allocData.type = types[i];

unit_tests/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static const GraphicsAllocation::AllocationType allocationTypesWith32BitAnd64KbP
162162
GraphicsAllocation::AllocationType::TIMESTAMP_TAG_BUFFER,
163163
GraphicsAllocation::AllocationType::IMAGE,
164164
GraphicsAllocation::AllocationType::INSTRUCTION_HEAP,
165-
GraphicsAllocation::AllocationType::SHARED_RESOURCE};
165+
GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY};
166166

167167
INSTANTIATE_TEST_CASE_P(Disallow32BitAnd64kbPagesTypes,
168168
MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest,

unit_tests/memory_manager/memory_manager_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ TEST(OsAgnosticMemoryManager, givenLocalMemorySupportedAndAubUsageWhenMemoryMana
11441144
EXPECT_EQ(heap32Base, memoryManager.allocator32Bit->getBase());
11451145
}
11461146

1147-
TEST(MemoryManager, givenSharedResourceWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForImageIsCalled) {
1147+
TEST(MemoryManager, givenSharedResourceCopyWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForImageIsCalled) {
11481148
ExecutionEnvironment executionEnvironment;
11491149
MockMemoryManager memoryManager(false, true, executionEnvironment);
11501150
cl_image_desc imgDesc = {};
@@ -1157,7 +1157,7 @@ TEST(MemoryManager, givenSharedResourceWhenAllocatingGraphicsMemoryThenAllocateG
11571157

11581158
MockMemoryManager::AllocationData allocationData;
11591159
allocationData.imgInfo = &imgInfo;
1160-
allocationData.type = GraphicsAllocation::AllocationType::SHARED_RESOURCE;
1160+
allocationData.type = GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY;
11611161

11621162
auto imageAllocation = memoryManager.allocateGraphicsMemory(allocationData);
11631163
EXPECT_NE(nullptr, imageAllocation);

unit_tests/os_interface/debug_settings_manager_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ AllocationTypeTestCase allocationTypeValues[] = {
888888
{OCLRT::GraphicsAllocation::AllocationType::INDIRECT_OBJECT_HEAP, "INDIRECT_OBJECT_HEAP"},
889889
{OCLRT::GraphicsAllocation::AllocationType::SURFACE_STATE_HEAP, "SURFACE_STATE_HEAP"},
890890
{OCLRT::GraphicsAllocation::AllocationType::DYNAMIC_STATE_HEAP, "DYNAMIC_STATE_HEAP"},
891-
{OCLRT::GraphicsAllocation::AllocationType::SHARED_RESOURCE, "SHARED_RESOURCE"},
891+
{OCLRT::GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY, "SHARED_RESOURCE_COPY"},
892892
{OCLRT::GraphicsAllocation::AllocationType::SVM, "SVM"},
893893
{OCLRT::GraphicsAllocation::AllocationType::UNDECIDED, "UNDECIDED"}};
894894

unit_tests/os_interface/linux/drm_memory_manager_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,7 @@ TEST_F(DrmMemoryManagerTest, givenDisabledHostPtrTrackingWhenAllocateGraphicsMem
30763076
memoryManager->freeGraphicsMemory(allocation);
30773077
}
30783078

3079-
TEST_F(DrmMemoryManagerTest, givenImageOrSharedResourceWhenGraphicsAllocationInDevicePoolIsAllocatedThenNullptrIsReturned) {
3079+
TEST_F(DrmMemoryManagerTest, givenImageOrSharedResourceCopyWhenGraphicsAllocationInDevicePoolIsAllocatedThenNullptrIsReturned) {
30803080
ExecutionEnvironment executionEnvironment;
30813081
std::unique_ptr<TestedDrmMemoryManager> memoryManager(new (std::nothrow) TestedDrmMemoryManager(Drm::get(0), false, false, executionEnvironment));
30823082

@@ -3086,7 +3086,7 @@ TEST_F(DrmMemoryManagerTest, givenImageOrSharedResourceWhenGraphicsAllocationInD
30863086
allocData.flags.allocateMemory = true;
30873087

30883088
GraphicsAllocation::AllocationType types[] = {GraphicsAllocation::AllocationType::IMAGE,
3089-
GraphicsAllocation::AllocationType::SHARED_RESOURCE};
3089+
GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY};
30903090

30913091
for (uint32_t i = 0; i < arrayCount(types); i++) {
30923092
allocData.type = types[i];

0 commit comments

Comments
 (0)