From 6ae801c4d832c490f1c45b2665d2f380dd958c6f Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 17 Jun 2023 21:54:42 +0200 Subject: [PATCH] rusticl/device: rename doubles to fp64 and long to int64 They are obviously the better names. Signed-off-by: Karol Herbst Reviewed-by: Nora Allen Part-of: --- src/gallium/frontends/rusticl/api/device.rs | 8 ++++---- src/gallium/frontends/rusticl/core/device.rs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs index cf4541c..7b32241 100644 --- a/src/gallium/frontends/rusticl/api/device.rs +++ b/src/gallium/frontends/rusticl/api/device.rs @@ -60,14 +60,14 @@ impl CLInfo for cl_device_id { cl_prop::(0) } CL_DEVICE_DOUBLE_FP_CONFIG => cl_prop::( - if dev.doubles_supported() { + if dev.fp64_supported() { let mut fp64_config = CL_FP_FMA | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_DENORM; - if dev.doubles_is_softfp() { + if dev.fp64_is_softfp() { fp64_config |= CL_FP_SOFT_FLOAT; } fp64_config @@ -190,7 +190,7 @@ impl CLInfo for cl_device_id { CL_DEVICE_NAME => cl_prop::<&str>(&dev.screen().name()), CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR => cl_prop::(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE => { - cl_prop::(if dev.doubles_supported() { 1 } else { 0 }) + cl_prop::(if dev.fp64_supported() { 1 } else { 0 }) } CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT => cl_prop::(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF => cl_prop::(0), @@ -229,7 +229,7 @@ impl CLInfo for cl_device_id { CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT => cl_prop::(0), CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR => cl_prop::(1), CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE => { - cl_prop::(if dev.doubles_supported() { 1 } else { 0 }) + cl_prop::(if dev.fp64_supported() { 1 } else { 0 }) } CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT => cl_prop::(1), CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF => cl_prop::(0), diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index bc82500..14b1837 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -373,7 +373,7 @@ impl Device { // TODO check req formats } - !self.long_supported() + !self.int64_supported() } fn parse_env_device_type() -> Option { @@ -517,12 +517,12 @@ impl Device { add_spirv("SPV_KHR_integer_dot_product"); add_spirv("SPV_KHR_no_integer_wrap_decoration"); - if self.doubles_supported() { + if self.fp64_supported() { add_ext(1, 0, 0, "cl_khr_fp64"); add_feat(1, 0, 0, "__opencl_c_fp64"); } - if self.long_supported() { + if self.int64_supported() { if self.embedded { add_ext(1, 0, 0, "cles_khr_int64"); }; @@ -616,7 +616,7 @@ impl Device { res as cl_device_type } - pub fn doubles_supported(&self) -> bool { + pub fn fp64_supported(&self) -> bool { if !Platform::features().fp64 { return false; } @@ -648,14 +648,14 @@ impl Device { self.get_nir_options().has_pack_32_4x8 } - pub fn doubles_is_softfp(&self) -> bool { + pub fn fp64_is_softfp(&self) -> bool { bit_check( self.get_nir_options().lower_doubles_options as u32, nir_lower_doubles_options::nir_lower_fp64_full_software as u32, ) } - pub fn long_supported(&self) -> bool { + pub fn int64_supported(&self) -> bool { self.screen.param(pipe_cap::PIPE_CAP_INT64) == 1 } @@ -868,8 +868,8 @@ impl Device { pub fn cl_features(&self) -> clc_optional_features { clc_optional_features { fp16: false, - fp64: self.doubles_supported(), - int64: self.long_supported(), + fp64: self.fp64_supported(), + int64: self.int64_supported(), images: self.image_supported(), images_read_write: self.image_read_write_supported(), images_write_3d: self.image_3d_write_supported(), -- 2.7.4