mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
test: add option to pass extra build flags to build scratch kernel function
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ce3cb71773
commit
85c1f71257
@@ -392,18 +392,23 @@ int lib_func_add5(int x) {
|
||||
void createScratchModuleKernel(ze_context_handle_t &context,
|
||||
ze_device_handle_t &device,
|
||||
ze_module_handle_t &module,
|
||||
ze_kernel_handle_t &kernel) {
|
||||
ze_kernel_handle_t &kernel,
|
||||
std::string *additionalBuildOptions) {
|
||||
std::string buildLog;
|
||||
auto spirV = LevelZeroBlackBoxTests::compileToSpirV(LevelZeroBlackBoxTests::scratchKernelSrc, "", buildLog);
|
||||
LevelZeroBlackBoxTests::printBuildLog(buildLog);
|
||||
SUCCESS_OR_TERMINATE((0 == spirV.size()));
|
||||
|
||||
std::string buildOptions = LevelZeroBlackBoxTests::scratchKernelBuildOptions;
|
||||
if (additionalBuildOptions != nullptr) {
|
||||
buildOptions += (*additionalBuildOptions);
|
||||
}
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
moduleDesc.inputSize = spirV.size();
|
||||
moduleDesc.pBuildFlags = LevelZeroBlackBoxTests::scratchKernelBuildOptions;
|
||||
moduleDesc.pBuildFlags = buildOptions.c_str();
|
||||
|
||||
if (zeModuleCreate(context, device, &moduleDesc, &module, &buildlog) != ZE_RESULT_SUCCESS) {
|
||||
size_t szLog = 0;
|
||||
|
||||
@@ -48,6 +48,7 @@ extern const char *exportModuleSrc2CircDep;
|
||||
void createScratchModuleKernel(ze_context_handle_t &context,
|
||||
ze_device_handle_t &device,
|
||||
ze_module_handle_t &module,
|
||||
ze_kernel_handle_t &kernel);
|
||||
ze_kernel_handle_t &kernel,
|
||||
std::string *additionalBuildOptions);
|
||||
|
||||
} // namespace LevelZeroBlackBoxTests
|
||||
|
||||
@@ -148,7 +148,7 @@ int main(int argc, char *argv[]) {
|
||||
ze_module_handle_t module = nullptr;
|
||||
ze_kernel_handle_t kernel = nullptr;
|
||||
|
||||
LevelZeroBlackBoxTests::createScratchModuleKernel(context, device, module, kernel);
|
||||
LevelZeroBlackBoxTests::createScratchModuleKernel(context, device, module, kernel, nullptr);
|
||||
|
||||
const std::string regularCaseName = "Regular Command List";
|
||||
const std::string immediateCaseName = "Immediate Command List";
|
||||
|
||||
Reference in New Issue
Block a user