|
4 | 4 |
|
5 | 5 | #include "shared_test_classes/base/ov_subgraph.hpp"
|
6 | 6 | #include "subgraphs_builders.hpp"
|
| 7 | +#include "openvino/op/relu.hpp" |
7 | 8 |
|
8 | 9 | namespace {
|
9 | 10 |
|
@@ -65,4 +66,44 @@ TEST_F(LSTMSequenceTest, smoke_serialize) {
|
65 | 66 | TEST_F(GRUSequenceTest, smoke_serialize) {
|
66 | 67 | run();
|
67 | 68 | }
|
| 69 | + |
| 70 | +class GpuCacheDirWithDotsParamTest : public ::testing::TestWithParam<std::string> { |
| 71 | +protected: |
| 72 | + ov::Core core; |
| 73 | + std::string cacheDir; |
| 74 | + |
| 75 | + void SetUp() override { |
| 76 | + std::stringstream ss; |
| 77 | + ss << std::hex << std::hash<std::string>{}(std::string(::testing::UnitTest::GetInstance()->current_test_info()->name())); |
| 78 | + |
| 79 | + // Base (no trailing slash first) |
| 80 | + cacheDir = ss.str() + GetParam(); |
| 81 | + |
| 82 | + // Clean previous |
| 83 | + ov::test::utils::removeFilesWithExt(cacheDir, "blob"); |
| 84 | + ov::test::utils::removeFilesWithExt(cacheDir, "cl_cache"); |
| 85 | + ov::test::utils::removeDir(cacheDir); |
| 86 | + |
| 87 | + core.set_property(ov::cache_dir(cacheDir)); |
| 88 | + } |
| 89 | + |
| 90 | + void TearDown() override { |
| 91 | + ov::test::utils::removeFilesWithExt(cacheDir, "blob"); |
| 92 | + ov::test::utils::removeFilesWithExt(cacheDir, "cl_cache"); |
| 93 | + ov::test::utils::removeDir(cacheDir); |
| 94 | + } |
| 95 | +}; |
| 96 | + |
| 97 | +TEST_P(GpuCacheDirWithDotsParamTest, smoke_PopulateAndReuseCache) { |
| 98 | + auto param = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{1, 3, 8, 8}); |
| 99 | + auto relu = std::make_shared<ov::op::v0::Relu>(param); |
| 100 | + auto res = std::make_shared<ov::op::v0::Result>(relu); |
| 101 | + auto model = std::make_shared<ov::Model>(ov::ResultVector{res}, ov::ParameterVector{param}, "CacheDotsModel"); |
| 102 | + core.compile_model(model, "GPU"); |
| 103 | +} |
| 104 | + |
| 105 | +INSTANTIATE_TEST_SUITE_P(CacheDirDotVariants, |
| 106 | + GpuCacheDirWithDotsParamTest, |
| 107 | + ::testing::Values("/test_encoder/test_encoder.encrypted/", "/test_encoder/test_encoder.encrypted")); |
| 108 | + |
68 | 109 | } // namespace
|
0 commit comments