Skip to content

Commit

Permalink
Fix Blaze build
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jan 28, 2025
1 parent 4f5375f commit f444b51
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions implementations/blaze/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.16)
project(blaze_benchmark)
include(/app/repo/vendor/noa/cmake/noa.cmake)
include(/app/repo/vendor/core/cmake/Sourcemeta.cmake)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mtune=native")
add_subdirectory(/app/repo blaze)
add_executable(blaze_benchmark main.cc)
noa_add_default_options(PRIVATE blaze_benchmark)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::jsontoolkit::json)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::jsontoolkit::jsonl)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::jsontoolkit::jsonschema)
sourcemeta_add_default_options(PRIVATE blaze_benchmark)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::core::json)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::core::jsonl)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::core::jsonschema)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::blaze::compiler)
target_link_libraries(blaze_benchmark PRIVATE sourcemeta::blaze::evaluator)
18 changes: 9 additions & 9 deletions implementations/blaze/main.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <sourcemeta/jsontoolkit/json.h>
#include <sourcemeta/jsontoolkit/jsonl.h>
#include <sourcemeta/jsontoolkit/jsonschema.h>
#include <sourcemeta/core/json.h>
#include <sourcemeta/core/jsonl.h>
#include <sourcemeta/core/jsonschema.h>

#include <sourcemeta/blaze/compiler.h>
#include <sourcemeta/blaze/evaluator.h>
Expand All @@ -27,17 +27,17 @@ bool validate_all(auto &evaluator, const auto &instances, const auto &schema_tem

int validate(const std::filesystem::path &example) {
const auto schema{
sourcemeta::jsontoolkit::from_file(example / "schema-noformat.json")};
auto stream{sourcemeta::jsontoolkit::read_file(example / "instances.jsonl")};
std::vector<sourcemeta::jsontoolkit::JSON> instances;
for (const auto &instance : sourcemeta::jsontoolkit::JSONL{stream}) {
sourcemeta::core::from_file(example / "schema-noformat.json")};
auto stream{sourcemeta::core::read_file(example / "instances.jsonl")};
std::vector<sourcemeta::core::JSON> instances;
for (const auto &instance : sourcemeta::core::JSONL{stream}) {
instances.push_back(instance);
}

const auto compile_start{std::chrono::high_resolution_clock::now()};
const auto schema_template{sourcemeta::blaze::compile(
schema, sourcemeta::jsontoolkit::default_schema_walker,
sourcemeta::jsontoolkit::official_resolver,
schema, sourcemeta::core::default_schema_walker,
sourcemeta::core::official_resolver,
sourcemeta::blaze::default_schema_compiler,
sourcemeta::blaze::Mode::FastValidation)};

Expand Down

0 comments on commit f444b51

Please sign in to comment.