Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ cc_test(
":benchmark_helper",
":gemma_lib",
"@googletest//:gtest_main", # buildcleaner: keep
"//io",
"@highway//:hwy",
"@highway//:hwy_test_util",
"@highway//:nanobenchmark",
Expand Down
3 changes: 1 addition & 2 deletions evals/benchmark_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
namespace gcpp {

GemmaEnv::GemmaEnv(const GemmaArgs& args)
: initializer_value_(gcpp::InternalInit()),
ctx_(args.threading),
: ctx_(args.threading),
env_(ctx_),
gemma_(args, ctx_) {
const ModelConfig& config = gemma_.Config();
Expand Down
2 changes: 0 additions & 2 deletions evals/benchmark_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ class GemmaEnv {
MatMulEnv& MutableEnv() { return env_; }

private:
// This is used to ensure that InternalInit is called before anything else.
int initializer_value_ = 0;
ThreadingContext ctx_;
MatMulEnv env_;
Gemma gemma_;
Expand Down
4 changes: 3 additions & 1 deletion evals/gemma_batch_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "evals/benchmark_helper.h"
#include "gemma/gemma.h"
#include "io/io.h"
#include "hwy/base.h"
#include "hwy/nanobenchmark.h"
#include "hwy/profiler.h"
Expand Down Expand Up @@ -146,6 +147,8 @@ TEST_F(GemmaBatchBench, RandomQuestionsBatched) {
} // namespace gcpp

int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);

fprintf(stderr, "GemmaEnv setup..\n");
gcpp::ConsumedArgs consumed(argc, argv);
gcpp::GemmaArgs args(argc, argv, consumed);
Expand All @@ -154,7 +157,6 @@ int main(int argc, char** argv) {
gcpp::GemmaEnv env(args);
gcpp::s_env = &env;

testing::InitGoogleTest(&argc, argv);

return RUN_ALL_TESTS();
}
Loading