From d9d398e652a2f2fc2d37cceaf1f5aa9e3d6636d8 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 5 Dec 2023 18:59:00 +0100 Subject: [PATCH] clc: allow debug flag to be read from other files Part-of: --- src/compiler/clc/clc.c | 10 +++++----- src/compiler/clc/clc.h | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/compiler/clc/clc.c b/src/compiler/clc/clc.c index 4d2c39ee7b6..b8d78865f9e 100644 --- a/src/compiler/clc/clc.c +++ b/src/compiler/clc/clc.c @@ -33,11 +33,6 @@ #include -enum clc_debug_flags { - CLC_DEBUG_DUMP_SPIRV = 1 << 0, - CLC_DEBUG_VERBOSE = 1 << 1, -}; - static const struct debug_named_value clc_debug_options[] = { { "dump_spirv", CLC_DEBUG_DUMP_SPIRV, "Dump spirv blobs" }, { "verbose", CLC_DEBUG_VERBOSE, NULL }, @@ -46,6 +41,11 @@ static const struct debug_named_value clc_debug_options[] = { DEBUG_GET_ONCE_FLAGS_OPTION(debug_clc, "CLC_DEBUG", clc_debug_options, 0) +uint64_t clc_debug_flags(void) +{ + return debug_get_option_debug_clc(); +} + static void clc_print_kernels_info(const struct clc_parsed_spirv *obj) { diff --git a/src/compiler/clc/clc.h b/src/compiler/clc/clc.h index daaf8e7b289..1a1ef2cd85d 100644 --- a/src/compiler/clc/clc.h +++ b/src/compiler/clc/clc.h @@ -267,6 +267,12 @@ clc_specialize_spirv(const struct clc_binary *in_spirv, const struct clc_spirv_specialization_consts *consts, struct clc_binary *out_spirv); +enum clc_debug_flags { + CLC_DEBUG_DUMP_SPIRV = 1 << 0, + CLC_DEBUG_VERBOSE = 1 << 1, +}; +uint64_t clc_debug_flags(void); + #ifdef __cplusplus } #endif