|
1 | 1 | /* |
2 | | - * Copyright (c) 2017, Intel Corporation |
| 2 | + * Copyright (c) 2017 - 2018, Intel Corporation |
3 | 3 | * |
4 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | 5 | * copy of this software and associated documentation files (the "Software"), |
|
22 | 22 |
|
23 | 23 | #include "config.h" |
24 | 24 | #include "cl_api_tests.h" |
25 | | -#include "runtime/helpers/base_object.h" |
26 | 25 | #include "runtime/compiler_interface/compiler_interface.h" |
27 | 26 | #include "runtime/context/context.h" |
28 | | -#include "runtime/device/device.h" |
29 | 27 | #include "runtime/helpers/file_io.h" |
30 | | -#include "runtime/helpers/hw_info.h" |
31 | | -#include "runtime/helpers/options.h" |
32 | 28 | #include "runtime/program/program.h" |
33 | 29 | #include "unit_tests/helpers/kernel_binary_helper.h" |
34 | 30 | #include "unit_tests/helpers/test_files.h" |
35 | | -#include "unit_tests/helpers/memory_management.h" |
36 | 31 |
|
37 | 32 | using namespace OCLRT; |
38 | 33 |
|
@@ -97,11 +92,8 @@ TEST_F(clBuildProgramTests, FromBinaryBasic) { |
97 | 92 | cl_int binaryStatus = CL_SUCCESS; |
98 | 93 | void *pBinary = nullptr; |
99 | 94 | size_t binarySize = 0; |
100 | | - |
101 | | - std::string testFile(testFiles); |
102 | | - testFile.append("CopyBuffer_simd8_"); |
103 | | - testFile.append(hardwarePrefix[platformDevices[0]->pPlatform->eProductFamily]); |
104 | | - testFile.append(".bin"); |
| 95 | + std::string testFile; |
| 96 | + retrieveBinaryKernelFilename(testFile, "CopyBuffer_simd8_", ".bin"); |
105 | 97 |
|
106 | 98 | binarySize = loadDataFromFile( |
107 | 99 | testFile.c_str(), |
@@ -145,11 +137,8 @@ TEST_F(clBuildProgramTests, GivenProgramCreatedFromBinaryWhenBuildProgramWithOpt |
145 | 137 | cl_int binaryStatus = CL_SUCCESS; |
146 | 138 | void *pBinary = nullptr; |
147 | 139 | size_t binarySize = 0; |
148 | | - |
149 | | - std::string testFile(testFiles); |
150 | | - testFile.append("CopyBuffer_simd8_"); |
151 | | - testFile.append(hardwarePrefix[platformDevices[0]->pPlatform->eProductFamily]); |
152 | | - testFile.append(".bin"); |
| 140 | + std::string testFile; |
| 141 | + retrieveBinaryKernelFilename(testFile, "CopyBuffer_simd8_", ".bin"); |
153 | 142 |
|
154 | 143 | binarySize = loadDataFromFile( |
155 | 144 | testFile.c_str(), |
@@ -204,11 +193,8 @@ TEST_F(clBuildProgramTests, FromBinarySpir) { |
204 | 193 | size_t binarySize = 0; |
205 | 194 |
|
206 | 195 | KernelBinaryHelper kbHeler("CopyBuffer_simd8", false); |
207 | | - |
208 | | - std::string testFile(testFiles); |
209 | | - testFile.append("CopyBuffer_simd8_"); |
210 | | - testFile.append(hardwarePrefix[platformDevices[0]->pPlatform->eProductFamily]); |
211 | | - testFile.append(".bc"); |
| 196 | + std::string testFile; |
| 197 | + retrieveBinaryKernelFilename(testFile, "CopyBuffer_simd8_", ".bc"); |
212 | 198 |
|
213 | 199 | binarySize = loadDataFromFile( |
214 | 200 | testFile.c_str(), |
|
0 commit comments