From 8483ca5040d4f10823194e9052072de24ef49190 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 8 Aug 2014 16:09:29 -0400
Subject: [PATCH] P4 to Git Change 1064550 by rili@rili_opencl_stg on
2014/08/08 15:16:52
EPR #403687 - [CQE OCL][2.0][NI][QR] WF 1.2 Conf: Failures observed in Images/ClFillImage test in Linux & Windows; Faulty CL#1057445
Issue: This issue happens because the image setting for NI is different from SI and above. It may take some time to fix NI issue for image RGB_101010.
Current user(MM team) is NOT asking RBG_101010 support for NI and previous asics.
Solution: Support image format (CL_RGB, CL_UNORM_INT_101010) on gpu only from OCL 2.0.
Code Review Request: 5494
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#107 edit
---
rocclr/runtime/platform/memory.cpp | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/rocclr/runtime/platform/memory.cpp b/rocclr/runtime/platform/memory.cpp
index 161c051f50..f13eee6e04 100644
--- a/rocclr/runtime/platform/memory.cpp
+++ b/rocclr/runtime/platform/memory.cpp
@@ -918,9 +918,6 @@ Image::supportedFormats[] = {
{CL_RG, CL_HALF_FLOAT}, {CL_RG, CL_FLOAT},
- // RGB
- {CL_RGB, CL_UNORM_INT_101010},
-
// RGBA
{CL_RGBA, CL_SNORM_INT8}, {CL_RGBA, CL_SNORM_INT16},
{CL_RGBA, CL_UNORM_INT8}, {CL_RGBA, CL_UNORM_INT16},
@@ -949,10 +946,17 @@ Image::supportedFormats[] = {
{CL_INTENSITY, CL_UNORM_INT8}, {CL_INTENSITY, CL_UNORM_INT16},
{CL_INTENSITY, CL_HALF_FLOAT}, {CL_INTENSITY, CL_FLOAT},
+ // RGB
+ {CL_RGB, CL_UNORM_INT_101010},
+
+ // sRGB
{CL_sRGBA, CL_UNORM_INT8},
+
+ // DEPTH
{CL_DEPTH, CL_UNORM_INT16}, {CL_DEPTH, CL_FLOAT},
};
+const cl_uint NUM_CHANNEL_ORDER_OF_RGB = 1; // The number of channel orders of RGB at the end of the table supportedFormats above and before sRGB and depth.
const cl_uint NUM_CHANNEL_ORDER_OF_sRGB = 1; // The number of channel orders of sRGB at the end of the table supportedFormats above and before depth.
const cl_uint NUM_CHANNEL_ORDER_OF_DEPTH = 2; // The number of channel orders of DEPTH at the end of the table supportedFormats above.
@@ -1005,7 +1009,8 @@ Image::numSupportedFormats(const Context& context, cl_mem_object_type image_type
}
}
else {
- numFormats -= NUM_CHANNEL_ORDER_OF_sRGB; // substract channel order of DEPTH type.
+ numFormats -= NUM_CHANNEL_ORDER_OF_RGB; // substract channel order of RGB type.
+ numFormats -= NUM_CHANNEL_ORDER_OF_sRGB; // substract channel order of sRGB type.
numFormats -= NUM_CHANNEL_ORDER_OF_DEPTH; // substract channel order of DEPTH type.
}
@@ -1057,8 +1062,9 @@ Image::getSupportedFormats(
}
}
else {
- numSupportedFormats -= NUM_CHANNEL_ORDER_OF_sRGB;
- numSupportedFormats -= NUM_CHANNEL_ORDER_OF_DEPTH;
+ numSupportedFormats -= NUM_CHANNEL_ORDER_OF_RGB; // substract channel order of RGB type.
+ numSupportedFormats -= NUM_CHANNEL_ORDER_OF_sRGB; // substract channel order of sRGB type.
+ numSupportedFormats -= NUM_CHANNEL_ORDER_OF_DEPTH; // substract channel order of DEPTH type.
}
for (size_t i = 0; i < numSupportedFormats; i++) {