Prepare object lib for precompiled builtins in bindless mode

Releated-To: NEO-5138

Change-Id: I18e564a9e32041fba5e887bc18d2195a1c4ddda8
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2020-10-01 13:31:19 +02:00
committed by sys_ocldev
parent 1962a89b05
commit 4dc3827b8e
36 changed files with 383 additions and 124 deletions

View File

@ -48,7 +48,7 @@ set(IGDRCL_SRCS_tests_local
${CMAKE_CURRENT_SOURCE_DIR}/libult/os_interface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ult_configuration.cpp
${NEO_SHARED_TEST_DIRECTORY}/unit_test/tests_configuration.h
${NEO_SOURCE_DIR}/opencl/source/helpers/heap_assigner_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp
)
if(WIN32)
@ -87,7 +87,7 @@ set(NEO_IGDRCL_TESTS__TARGET_OBJECTS
$<TARGET_OBJECTS:${SHARINGS_ENABLE_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_SOURCES_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_VME_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDFUL_LIB_NAME}>
$<TARGET_OBJECTS:${SCHEDULER_BINARY_LIB_NAME}>
)

View File

@ -52,7 +52,7 @@ target_include_directories(igdrcl_aub_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(igdrcl_aub_tests PRIVATE
${NEO_SHARED_TEST_DIRECTORY}/unit_test/page_fault_manager/default_asan_options.cpp
${NEO_SHARED_DIRECTORY}/gmm_helper/resource_info.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/heap_assigner_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_mode.h
)

View File

@ -10,6 +10,7 @@ set(IGDRCL_SRCS_tests_built_in
${CMAKE_CURRENT_SOURCE_DIR}/built_ins_file_names.cpp
${CMAKE_CURRENT_SOURCE_DIR}/built_in_kernels_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/built_in_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/built_in_tests_ocl.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/get_built_ins_file_names.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sip_tests.cpp
)

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/built_ins/built_ins.h"
#include "shared/test/unit_test/built_ins/built_in_tests_shared.inl"
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
#include "test.h"
#include "gtest/gtest.h"
#include <string>
using namespace NEO;
TEST(BuiltInTestsOcl, givenUseBindlessBuiltinInApiDependentModeWhenBinExtensionPassedThenNameHasBindfulPrefix) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.UseBindlessBuiltins.set(-1);
EBuiltInOps::Type builtin = EBuiltInOps::CopyBufferToBuffer;
const std::string extension = ".bin";
const std::string platformName = "skl";
const uint32_t deviceRevId = 9;
std::string resourceNameGeneric = createBuiltinResourceName(builtin, extension);
std::string resourceNameForPlatform = createBuiltinResourceName(builtin, extension, platformName);
std::string resourceNameForPlatformAndStepping = createBuiltinResourceName(builtin, extension, platformName, deviceRevId);
std::string expectedResourceNameGeneric = "bindful_copy_buffer_to_buffer.builtin_kernel.bin";
std::string expectedResourceNameForPlatform = platformName.c_str();
expectedResourceNameForPlatform += "_0_bindful_copy_buffer_to_buffer.builtin_kernel.bin";
std::string expectedResourceNameForPlatformAndStepping = platformName.c_str();
expectedResourceNameForPlatformAndStepping += "_";
expectedResourceNameForPlatformAndStepping += std::to_string(deviceRevId).c_str();
expectedResourceNameForPlatformAndStepping += "_bindful_copy_buffer_to_buffer.builtin_kernel.bin";
EXPECT_EQ(0, strcmp(expectedResourceNameGeneric.c_str(), resourceNameGeneric.c_str()));
EXPECT_EQ(0, strcmp(expectedResourceNameForPlatform.c_str(), resourceNameForPlatform.c_str()));
EXPECT_EQ(0, strcmp(expectedResourceNameForPlatformAndStepping.c_str(), resourceNameForPlatformAndStepping.c_str()));
}
TEST(BuiltInTestsOcl, givenUseBindlessBuiltinDisabledInOclApiWhenBinExtensionPassedThenNameHasBindfulPrefix) {
givenUseBindlessBuiltinDisabledWhenBinExtensionPassedThenNameHasBindfulPrefix();
}
TEST(BuiltInTestsOcl, givenUseBindlessBuiltinEnabledInOclApiWhenBinExtensionPassedThenNameHasBindlessPrefix) {
givenUseBindlessBuiltinEnabledWhenBinExtensionPassedThenNameHasBindlessPrefix();
}

View File

@ -26,7 +26,7 @@ add_executable(igdrcl_${target_name}
${NEO_SOURCE_DIR}/opencl/source/dll/linux/options_linux.cpp
${NEO_SOURCE_DIR}/opencl/source/dll/linux/os_interface.cpp
${NEO_SOURCE_DIR}/opencl/source/os_interface/linux/platform_teardown_linux.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/heap_assigner_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/aub_stream_mocks/aub_stream_interface_mock.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/linux${BRANCH_DIR_SUFFIX}/drm_other_requests.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/create_drm_memory_manager.cpp

View File

@ -18,7 +18,7 @@ add_custom_target(run_mt_unit_tests)
add_executable(igdrcl_mt_tests EXCLUDE_FROM_ALL
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${NEO_SOURCE_DIR}/shared/test/unit_test/test_macros/test_checks_shared.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/heap_assigner_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/os_interface.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/ult_configuration.cpp

View File

@ -199,4 +199,5 @@ PerformImplicitFlushForIdleGpu = -1
ProvideVerboseImplicitFlush = false
PauseOnGpuMode = -1
PrintTagAllocationAddress = 0
DoNotFlushCaches = false
DoNotFlushCaches = false
UseBindlessBuiltins = -1

View File

@ -19,7 +19,7 @@ if(WIN32)
${NEO_SOURCE_DIR}/opencl/source/dll/create_command_stream.cpp
${NEO_SOURCE_DIR}/opencl/source/dll${BRANCH_DIR_SUFFIX}/get_devices.cpp
${NEO_SOURCE_DIR}/opencl/source/dll/windows/os_interface.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/heap_assigner_config_ocl.cpp
${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp
${NEO_SHARED_DIRECTORY}/os_interface/windows/wddm/wddm_create.cpp
${NEO_SOURCE_DIR}/opencl/test/unit_test/ult_configuration.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/get_devices_tests.cpp