Change image with host ptr creation logic in multi device setup

When multi device config is available,
then allocations are created in system memory pool.

Related-To: NEO-5508
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2021-03-29 16:39:45 +00:00
committed by Compute-Runtime-Automation
parent 0a84f88599
commit c3143ccf1f
6 changed files with 74 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -99,5 +99,6 @@ const cl_image_desc Image1dArrayDefaults::imageDesc = {
static float imageMemory[imageWidth * imageHeight * imageDepth] = {};
void *Image1dDefaults::hostPtr = imageMemory;
void *ImageWithoutHostPtr::hostPtr = nullptr;
NEO::Context *Image1dDefaults::context = nullptr;

View File

@@ -55,6 +55,11 @@ struct LuminanceImage : public Image2dDefaults {
static const cl_image_format imageFormat;
};
struct ImageWithoutHostPtr : public Image1dDefaults {
enum { flags = 0 };
static void *hostPtr;
};
template <typename BaseClass>
struct ImageUseHostPtr : public BaseClass {
enum { flags = BaseClass::flags | CL_MEM_USE_HOST_PTR };
@@ -90,7 +95,6 @@ struct ImageHelper {
Traits::hostPtr,
retVal);
assert(image != nullptr);
return image;
}
};