mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 00:09:02 +00:00
Re-enabling narrowing errors (#1144)
Fixes narrowing conversion build errors in test_common Removing disable of narrowing errors in main CMakeLists.txt and moving it down to specific test_conformance suite's CMakeLists.txt where there are many more build errors revealed from this fix. Fixes a few simple issues under test_conformance in the process. Contributes #787 Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> --------- Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
@@ -25,22 +25,28 @@
|
||||
class Version {
|
||||
public:
|
||||
Version(): m_major(0), m_minor(0) {}
|
||||
Version(int major, int minor): m_major(major), m_minor(minor) {}
|
||||
bool operator>(const Version &rhs) const { return to_int() > rhs.to_int(); }
|
||||
bool operator<(const Version &rhs) const { return to_int() < rhs.to_int(); }
|
||||
Version(cl_uint major, cl_uint minor): m_major(major), m_minor(minor) {}
|
||||
bool operator>(const Version &rhs) const
|
||||
{
|
||||
return to_uint() > rhs.to_uint();
|
||||
}
|
||||
bool operator<(const Version &rhs) const
|
||||
{
|
||||
return to_uint() < rhs.to_uint();
|
||||
}
|
||||
bool operator<=(const Version &rhs) const
|
||||
{
|
||||
return to_int() <= rhs.to_int();
|
||||
return to_uint() <= rhs.to_uint();
|
||||
}
|
||||
bool operator>=(const Version &rhs) const
|
||||
{
|
||||
return to_int() >= rhs.to_int();
|
||||
return to_uint() >= rhs.to_uint();
|
||||
}
|
||||
bool operator==(const Version &rhs) const
|
||||
{
|
||||
return to_int() == rhs.to_int();
|
||||
return to_uint() == rhs.to_uint();
|
||||
}
|
||||
int to_int() const { return m_major * 10 + m_minor; }
|
||||
cl_uint to_uint() const { return m_major * 10 + m_minor; }
|
||||
std::string to_string() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
@@ -49,8 +55,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
int m_major;
|
||||
int m_minor;
|
||||
cl_uint m_major;
|
||||
cl_uint m_minor;
|
||||
};
|
||||
|
||||
Version get_device_cl_version(cl_device_id device);
|
||||
|
||||
Reference in New Issue
Block a user