I have report a bug issue on github for OpenCL CTS do not match spec requirement. And the Issue link issue2051
For exclusive_logical_and, the identity value is true (non-zero).
But if the identity is 0xffff ffff, the OpenCL-CTS will report an error. Which is compared by compare_ordered(rr, tr).
tr = TypeManager<Ty>::identify_limits(operation);
for (const int &active_work_item : active_work_items)
{
rr = my[ii + active_work_item];
if (!compare_ordered(rr, tr))
{
log_error(
"ERROR: %s_%s(%s) "
"mismatch for local id %d in sub group %d in "
"group %d %s\n",
func_name.c_str(), operation_names(operation),
TypeManager<Ty>::name(), i, j, k,
print_expected_obtained(tr, rr).c_str());
return TEST_FAIL;
}
tr = calculate<Ty>(tr, mx[ii + active_work_item],
operation);
}
The compare_ordered useing == to compare cl_int type.
template <typename Ty> inline bool compare_ordered(const Ty &lhs, const Ty &rhs)
{
return lhs == rhs;
}
And identify_limits will return (cl_int)1 for logical_and.
template <> struct TypeManager<cl_int> : public CommonTypeManager<cl_int>
{
...
static cl_int identify_limits(ArithmeticOp operation)
{
switch (operation)
{
case ArithmeticOp::add_: return (cl_int)0;
case ArithmeticOp::max_:
return (std::numeric_limits<cl_int>::min)();
case ArithmeticOp::min_:
return (std::numeric_limits<cl_int>::max)();
case ArithmeticOp::mul_: return (cl_int)1;
case ArithmeticOp::and_: return (cl_int)~0;
case ArithmeticOp::or_: return (cl_int)0;
case ArithmeticOp::xor_: return (cl_int)0;
case ArithmeticOp::logical_and: return (cl_int)1;
case ArithmeticOp::logical_or: return (cl_int)0;
case ArithmeticOp::logical_xor: return (cl_int)0;
default: log_error("Unknown operation request\n"); break;
}
return 0;
}
};
So actually CTS compares -1(0xffff ffff) == 1 to verify the result, which does not meet the non-zero requirement.
