a comma-separated list of features to enable. Those are disabled by default
as they might not be stable enough or break OpenCL conformance.
+ - ``fp64`` enables OpenCL double support
+
.. envvar:: RUSTICL_DEBUG
a comma-separated list of debug channels to enable.
use crate::api::icd::*;
use crate::api::util::*;
use crate::core::format::*;
+use crate::core::platform::*;
use crate::core::util::*;
use crate::core::version::*;
use crate::impl_cl_type_trait;
}
pub fn doubles_supported(&self) -> bool {
- false
- /*
+ if !Platform::features().fp64 {
+ return false;
+ }
self.screen.param(pipe_cap::PIPE_CAP_DOUBLES) == 1
- */
}
pub fn doubles_is_softfp(&self) -> bool {
pub program: bool,
}
-pub struct PlatformFeatures {}
+pub struct PlatformFeatures {
+ pub fp64: bool,
+}
static PLATFORM_ENV_ONCE: Once = Once::new();
static PLATFORM_ONCE: Once = Once::new();
devs: Vec::new(),
};
static mut PLATFORM_DBG: PlatformDebug = PlatformDebug { program: false };
-static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures {};
+static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures { fp64: false };
fn load_env() {
let debug = unsafe { &mut PLATFORM_DBG };
if let Ok(feature_flags) = env::var("RUSTICL_FEATURES") {
for flag in feature_flags.split(',') {
match flag {
+ "fp64" => features.fp64 = true,
_ => eprintln!("Unknown RUSTICL_FEATURES flag found: {}", flag),
}
}