clover: test for nir fp64 lowering options for cl_khr_fp64

With NIR we have softfp64, but we don't really want this for CL,
so check whether fp64 is lowered to a software implementation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7750

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19919>
This commit is contained in:
Gert Wollny
2022-11-22 09:20:59 +01:00
committed by Marge Bot
parent e30b6563ca
commit 9fe16c91b3
2 changed files with 8 additions and 2 deletions

View File

@@ -30,6 +30,7 @@
#include "util/u_debug.h"
#include "spirv/invocation.hpp"
#include "nir/invocation.hpp"
#include "nir.h"
#include <fstream>
using namespace clover;
@@ -359,7 +360,12 @@ device::image_support() const {
bool
device::has_doubles() const {
return pipe->get_param(pipe, PIPE_CAP_DOUBLES);
nir_shader_compiler_options *options =
(nir_shader_compiler_options *)pipe->get_compiler_options(pipe,
PIPE_SHADER_IR_NIR,
PIPE_SHADER_COMPUTE);
return pipe->get_param(pipe, PIPE_CAP_DOUBLES) &&
!(options->lower_doubles_options & nir_lower_fp64_full_software);
}
bool

View File

@@ -164,5 +164,5 @@ libclover = static_library(
],
gnu_symbol_visibility : 'hidden',
link_with : [libclllvm, libclspirv, libclnir],
dependencies : idep_mesautil,
dependencies : [idep_mesautil, idep_nir],
)