diff --git a/CMakeLists.txt b/CMakeLists.txt index a707078..d52aeda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,8 +98,8 @@ set(SOURCES gemma/vit.h gemma/weights.cc gemma/weights.h - io/blob_store.cc - io/blob_store.h + io/blob_finder.cc + io/blob_finder.h io/fields.cc io/fields.h io/io_win.cc @@ -223,7 +223,7 @@ set(GEMMA_TEST_FILES evals/gemma_test.cc gemma/flash_attention_test.cc gemma/tensor_info_test.cc - io/blob_store_test.cc + io/blob_finder_test.cc io/fields_test.cc ops/bench_matmul.cc ops/dot_test.cc diff --git a/io/blob_store.cc b/io/blob_finder.cc similarity index 99% rename from io/blob_store.cc rename to io/blob_finder.cc index af9f81d..30d9815 100644 --- a/io/blob_store.cc +++ b/io/blob_finder.cc @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "io/blob_store.h" +#include "io/blob_finder.h" #include #include diff --git a/io/blob_store.h b/io/blob_finder.h similarity index 95% rename from io/blob_store.h rename to io/blob_finder.h index e5f2221..1173753 100644 --- a/io/blob_store.h +++ b/io/blob_finder.h @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_GEMMA_CPP_IO_BLOB_STORE_H_ -#define THIRD_PARTY_GEMMA_CPP_IO_BLOB_STORE_H_ +#ifndef THIRD_PARTY_GEMMA_CPP_IO_BLOB_FINDER_H_ +#define THIRD_PARTY_GEMMA_CPP_IO_BLOB_FINDER_H_ // Reads/writes arrays of bytes from/to file. @@ -48,11 +48,11 @@ struct BlobRange { // faster lookups. // TODO(janwas): rename to BlobFinder or similar. // Thread-safe: it is safe to concurrently call all methods except `CloseFile`. -class BlobReader { +class BlobFinder { public: // Acquires ownership of `file` (which must be non-null) and reads its header. // Aborts on error. - explicit BlobReader(const Path& blob_path); + explicit BlobFinder(const Path& blob_path); const Path& blob_path() const { return blob_path_; } @@ -136,4 +136,4 @@ class BlobWriter { } // namespace gcpp -#endif // THIRD_PARTY_GEMMA_CPP_IO_BLOB_STORE_H_ +#endif // THIRD_PARTY_GEMMA_CPP_IO_BLOB_FINDER_H_ diff --git a/io/blob_store_test.cc b/io/blob_finder_test.cc similarity index 96% rename from io/blob_store_test.cc rename to io/blob_finder_test.cc index bb41c7e..9b85f40 100644 --- a/io/blob_store_test.cc +++ b/io/blob_finder_test.cc @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "io/blob_store.h" +#include "io/blob_finder.h" #include @@ -32,10 +32,10 @@ namespace gcpp { namespace { #if !HWY_TEST_STANDALONE -class BlobStoreTest : public testing::Test {}; +class BlobFinderTest : public testing::Test {}; #endif -TEST(BlobStoreTest, TestReadWrite) { +TEST(BlobFinderTest, TestReadWrite) { ThreadingArgs threading_args; ThreadingContext ctx(threading_args); @@ -59,7 +59,7 @@ TEST(BlobStoreTest, TestReadWrite) { std::fill(buffer.begin(), buffer.end(), 0); - const BlobReader reader(path); + const BlobFinder reader(path); HWY_ASSERT_EQ(reader.Keys().size(), 2); HWY_ASSERT_STRING_EQ(reader.Keys()[0].c_str(), keyA.c_str()); @@ -92,7 +92,7 @@ TEST(BlobStoreTest, TestReadWrite) { } // Ensures padding works for any number of random-sized blobs. -TEST(BlobStoreTest, TestNumBlobs) { +TEST(BlobFinderTest, TestNumBlobs) { ThreadingArgs threading_args; ThreadingContext ctx(threading_args); hwy::RandomState rng; @@ -126,7 +126,7 @@ TEST(BlobStoreTest, TestNumBlobs) { HWY_ASSERT(blobs.size() == num_blobs); writer.Finalize(); - BlobReader reader(path); + BlobFinder reader(path); HWY_ASSERT_EQ(reader.Keys().size(), num_blobs); ParallelFor(