mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
performance: Memory handling improvements
By default prefer allocating memory first by KMD, instead of malloc first. By default prefer not caching allocations on MTL devices. This results in allocations being handled with non-coherent pat index. For integrated devices when caching is not preferred do not allow direct memory access in CPU domain. For map/unmap operations create a dedicated memory allocation for CPU access, instead of accessing it directly, reusing the same logic as when mapping/unmapping local memory. Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1d07d999c8
commit
5b80bd4d7c
@@ -1298,6 +1298,7 @@ TEST(ImageTest, givenImageWhenAskedForPtrOffsetForCpuMappingThenReturnCorrectVal
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.ForceLinearImages.set(true);
|
||||
MockContext ctx;
|
||||
REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment());
|
||||
std::unique_ptr<Image> image(ImageHelper<Image3dDefaults>::create(&ctx));
|
||||
EXPECT_TRUE(image->mappingOnCpuAllowed());
|
||||
|
||||
@@ -1313,6 +1314,7 @@ TEST(ImageTest, givenImageWhenAskedForPtrOffsetForCpuMappingThenReturnCorrectVal
|
||||
|
||||
TEST(ImageTest, given1DArrayImageWhenAskedForPtrOffsetForMappingThenReturnCorrectValue) {
|
||||
MockContext ctx;
|
||||
REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment());
|
||||
std::unique_ptr<Image> image(ImageHelper<Image1dArrayDefaults>::create(&ctx));
|
||||
|
||||
MemObjOffsetArray origin = {{4, 5, 0}};
|
||||
@@ -1345,6 +1347,7 @@ TEST(ImageTest, givenImageWhenAskedForPtrLengthForCpuMappingThenReturnCorrectVal
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.ForceLinearImages.set(true);
|
||||
MockContext ctx;
|
||||
REQUIRE_CPU_MEM_ACCESS_OR_SKIP(ctx.getDevice(0)->getRootDeviceEnvironment());
|
||||
std::unique_ptr<Image> image(ImageHelper<Image3dDefaults>::create(&ctx));
|
||||
EXPECT_TRUE(image->mappingOnCpuAllowed());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user