Disable Rapid Json to be used by Default (#2936)

To enable the json dump we can now build with -DCK_ENABLE_JSON_DUMP=1

[ROCm/composable_kernel commit: e92e69318e]
This commit is contained in:
rahjain-amd
2025-09-26 21:35:35 +05:30
committed by GitHub
parent 659a331d36
commit 8ad7f1b2ca
2 changed files with 23 additions and 1 deletions

View File

@@ -339,6 +339,7 @@ endif()
option(USE_BITINT_EXTENSION_INT4 "Whether to enable clang's BitInt extension to provide int4 data type." OFF)
option(USE_OPT_GFX11 "Whether to enable LDS cumode and Wavefront32 mode for GFX11 silicons." OFF)
option(ENABLE_ASM_DUMP "Whether to enable assembly dump for kernels." OFF)
option(ENABLE_JSON_DUMP "Whether to enable json dump for examples." OFF)
if(USE_BITINT_EXTENSION_INT4)
add_compile_definitions(CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4)
@@ -352,6 +353,11 @@ if(ENABLE_ASM_DUMP)
message("CK compiled with ENABLE_ASM_DUMP set to ${ENABLE_ASM_DUMP}")
endif()
if (ENABLE_JSON_DUMP)
add_compile_definitions(CK_ENABLE_JSON_DUMP)
message("CK compiled with ENABLE_JSON_DUMP set to ${ENABLE_JSON_DUMP}")
endif()
## Threads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

View File

@@ -1,10 +1,10 @@
#ifdef CK_ENABLE_JSON_DUMP
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/document.h"
#include "rapidjson/rapidjson.h"
// #include <fstream>
#pragma GCC diagnostic pop
#define START_JSON_DUMP_FILE(file_name) \
@@ -76,6 +76,18 @@ static void add_perf_to_json(rapidjson::Writer<rapidjson::StringBuffer>& writer,
writer.EndArray();
}
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
#define START_JSON_DUMP_FILE(file_name)
#define END_JSON_DUMP_FILE() \
std::cout << "JSON dump disabled, To enable, set CK_ENABLE_JSON_DUMP cmake option" << std::endl;
#define ADD_KEY_VALUE(key, value)
#define ADD_PERF_TO_JSON(_time, tflops, gbytes)
#endif
// Helper traits to check for static member existence
template <typename T, typename = void>
struct has_warp_tile_members : std::false_type
@@ -698,3 +710,7 @@ void dump_fmha_bwd_json_results(const std::string& json_filename,
ADD_PERF_TO_JSON(ave_time, tflops, gb_per_sec)
END_JSON_DUMP_FILE();
}
#ifndef CK_ENABLE_JSON_DUMP
#pragma GCC diagnostic pop
#endif