This adds support to the compiler and api for this CL 3.0 feature.
fixes CTS compiler features_macro
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
buf.as_vector<cl_name_version>() = dev.supported_extensions();
break;
+ case CL_DEVICE_OPENCL_C_FEATURES:
+ buf.as_vector<cl_name_version>() = dev.opencl_c_features();
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}
}
return vec;
}
+
+std::vector<cl_name_version>
+device::opencl_c_features() const {
+ std::vector<cl_name_version> vec;
+
+ vec.push_back( (cl_name_version) {CL_MAKE_VERSION(3, 0, 0), "__opencl_c_int64" });
+ if (has_doubles())
+ vec.push_back( (cl_name_version) {CL_MAKE_VERSION(3, 0, 0), "__opencl_c_fp64" });
+
+ return vec;
+}
std::vector<cl_name_version> opencl_c_all_versions() const;
std::vector<cl_name_version> supported_extensions() const;
+ std::vector<cl_name_version> opencl_c_features() const;
+
friend class command_queue;
friend class root_resource;
friend class hard_event;
std::to_string(CL_VERSION_MAJOR_KHR(dev_version)) +
std::to_string(CL_VERSION_MINOR_KHR(dev_version)) + "0");
+ if (CL_VERSION_MAJOR(dev.version) >= 3) {
+ const auto features = dev.opencl_c_features();
+ for (const auto &feature : features)
+ c.getPreprocessorOpts().addMacroDef(feature.name);
+ }
+
// clc.h requires that this macro be defined:
c.getPreprocessorOpts().addMacroDef("cl_clang_storage_class_specifiers");
c.getPreprocessorOpts().addRemappedFile(