Added a host-code check to make sure the avc_motion_estimation is available

pull/357/head
Cedric Nugteren 2019-05-07 20:47:50 +02:00
parent c6ba86cdc3
commit c5a82f6978
2 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,7 @@ std::shared_ptr<Program> CompileFromSource(
// For Intel GPUs with subgroup support, use subgroup shuffling.
if (device.IsGPU() && device.HasExtension(kKhronosIntelSubgroups) &&
device.HasExtension(kKhronosIntelAvcMotionEstimation) &&
(precision == Precision::kSingle || precision == Precision::kHalf)) {
header_string += "#define USE_SUBGROUP_SHUFFLING 1\n";
header_string += "#define SUBGROUP_SHUFFLING_INTEL 1\n";

View File

@ -48,6 +48,7 @@ using double2 = std::complex<double>;
const std::string kKhronosAttributesAMD = "cl_amd_device_attribute_query";
const std::string kKhronosAttributesNVIDIA = "cl_nv_device_attribute_query";
const std::string kKhronosIntelSubgroups = "cl_intel_subgroups";
const std::string kKhronosIntelAvcMotionEstimation = "cl_intel_device_side_avc_motion_estimation";
// Catched an unknown error
constexpr auto kUnknownError = -999;