MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / TEST

Function TEST

oneflow/core/embedding/key_value_store_test.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174TEST(PersistentTableKeyValueStore, PersistentTableKeyValueStore) {
175 if (!HasCudaDevice()) { return; }
176 Singleton<ep::DeviceManagerRegistry>::New();
177 PersistentTableKeyValueStoreOptions options{};
178 uint32_t value_length = 128;
179
180 std::string path = CreateTempDirectory();
181 options.table_options.path = path;
182 options.table_options.value_size = value_length * sizeof(float);
183 options.table_options.key_size = GetSizeOfDataType(DataType::kUInt64);
184 options.table_options.physical_block_size = 512;
185
186 std::unique_ptr<KeyValueStore> store = NewPersistentTableKeyValueStore(options);
187 store->ReserveQueryLength(128);
188 TestKeyValueStore(store.get(), 1024, 1024, value_length);
189 store.reset();
190 PosixFile::RecursiveDelete(path);
191 Singleton<ep::DeviceManagerRegistry>::Delete();
192}
193
194TEST(CachedKeyValueStore, LRU) {
195 if (!HasCudaDevice()) { return; }

Callers

nothing calls this directly

Calls 9

CreateTempDirectoryFunction · 0.85
GetSizeOfDataTypeFunction · 0.85
TestKeyValueStoreFunction · 0.85
DeleteFunction · 0.85
NewCacheFunction · 0.85
HasCudaDeviceFunction · 0.70
NewFunction · 0.50
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected