Added OpenCL versions 2.1/2.2/3.0.

PiperOrigin-RevId: 316505978
Change-Id: I5e35dc8e625aef2feb8f59b10a6a60d175a08314
This commit is contained in:
Raman Sarokin 2020-06-15 11:21:03 -07:00 committed by TensorFlower Gardener
parent ba658404f2
commit d1a34523f4
2 changed files with 26 additions and 2 deletions

View File

@ -105,8 +105,18 @@ OpenCLVersion ParseCLVersion(const std::string& version) {
} else {
return OpenCLVersion::CL_1_0;
}
} else if (major == 2) {
if (minor == 2) {
return OpenCLVersion::CL_2_2;
} else if (minor == 1) {
return OpenCLVersion::CL_2_1;
} else {
return OpenCLVersion::CL_2_0;
}
} else if (major == 3) {
return OpenCLVersion::CL_3_0;
} else {
return OpenCLVersion::CL_2_0;
return OpenCLVersion::CL_1_0;
}
}
@ -227,6 +237,12 @@ std::string OpenCLVersionToString(OpenCLVersion version) {
return "1.2";
case OpenCLVersion::CL_2_0:
return "2.0";
case OpenCLVersion::CL_2_1:
return "2.1";
case OpenCLVersion::CL_2_2:
return "2.2";
case OpenCLVersion::CL_3_0:
return "3.0";
}
}

View File

@ -31,7 +31,15 @@ namespace cl {
enum class Vendor { QUALCOMM, MALI, POWERVR, NVIDIA, AMD, INTEL, UNKNOWN };
std::string VendorToString(Vendor v);
enum class OpenCLVersion { CL_1_0, CL_1_1, CL_1_2, CL_2_0 };
enum class OpenCLVersion {
CL_1_0,
CL_1_1,
CL_1_2,
CL_2_0,
CL_2_1,
CL_2_2,
CL_3_0
};
std::string OpenCLVersionToString(OpenCLVersion version);
// for use only in cl_device.cc, but putted here to make tests