Skip to content

Commit

Permalink
ugly/compute-runtime updated patches
Browse files Browse the repository at this point in the history
  • Loading branch information
stef committed Mar 4, 2020
1 parent 7b538c4 commit ee97443
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 66 deletions.
21 changes: 11 additions & 10 deletions ugly/compute-runtime/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ subpackages="$pkgname-dev $pkgname-doc"
makedepends="cmake intel-gmmlib-dev igc-dev libva-dev libdrm-dev opencl-clang libexecinfo-dev libunwind-dev"

source="${pkgname}-${pkgver}.tar.gz::https://github.com/intel/$pkgname/archive/$pkgver.tar.gz
musl-compat.patch
unwind.patch
missing-null.patch
musl-dl-compat.patch
ioctl.patch
pthread_yield.patch
redeffed_select.patch
"
#select-name-collision.patch
#missing-libigc.patch

#builddir="$srcdir/gmmlib-$pkgname-$pkgver"

build() {
mkdir -p build
cd build
CC=clang CXX=clang++ cmake \
CC=clang CXX=clang++ CXXFLAGS=-DSANITIZER_BUILD \
cmake \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
Expand All @@ -36,6 +35,8 @@ package() {
make VERBOSE=1 DESTDIR="$pkgdir" install
}
sha512sums="d603127c3b8b1347e08f878f0333cb05f117c6d3386958678fa631d07ccc81275b7c93e44e6c6e9ed7ff1586c748f00034b0b33598753ca2a22106b7f2dbbffc compute-runtime-20.08.15750.tar.gz
d825b95db59cccf928fd2007b13f4c136767c54878a44ea95be4058dc52ec81fc9d13e233ccb3c53d3a6eaa310b6f36c271e14659f3943ecd3016449eb83d563 musl-compat.patch
f8f02ebd4a22849161b93c8d71720fa996b23e8284958533317cdae8e03929ea7487a96dddd830a15d3f7818c0e9cb51e0e1354aaef6b4cb44e5801a55598095 unwind.patch
a7e7a8ef4794455a06c7c7cc6c3bccea759bcbce03cc800f285e520a97e88fd44cfd2bd931270ea3e475ddd388a1813db5b5fdcc17941fc0597d13fb94c6daeb missing-null.patch"
6f884bd8e70e0a857da99d5e9eb98fd78d67320f30b44330da98e167df047d9263fb81498f33ba48d390429992722707b4be866e5df9304253c9564a16c3838c unwind.patch
ef43af5545fafe56010b829302277d8b213850e67d2d6bb04420ce88a5ef7c7fe4f19e20c3e9e78bd93d3b546dd6fc4fcb4e32bbcb5bd17198b99ddb439ace56 musl-dl-compat.patch
b4a5da71176d835450fb531e0ec0b1d9d0bad2491c30cd1b072b81eb54bc7aa7f389d77e18918ad80eca23e8410eedf4da04ad88b534d6b585f2b3a45e5774a2 ioctl.patch
6a8fa5ee10796e29b7f750566b349b6cd9d6587a8a11680cd58e95e9b512273d0b987fb84186cfea4c24f0d67cb31300c53f1603350bf0ad289cb1ef82133c9c pthread_yield.patch
51fc89154afe6758a1d721d7997c4fba44f7bec1af1f3a4fd00a2a38c8c8a66001edda5da731f2aea47aacfad1dbf1e0c2878aa977c7956f2530f7342198174e redeffed_select.patch"
24 changes: 24 additions & 0 deletions ugly/compute-runtime/ioctl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff -Nurw compute-runtime-20.08.15750/unit_tests/linux/mock_os_layer.h src/compute-runtime-20.08.15750/unit_tests/linux/mock_os_layer.h
--- compute-runtime-20.08.15750/unit_tests/linux/mock_os_layer.h 2020-03-04 16:29:18.498605132 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/linux/mock_os_layer.h 2020-03-04 16:29:31.308605717 +0000
@@ -20,7 +20,7 @@

extern "C" {
int open(const char *pathname, int flags, ...);
-int ioctl(int fd, unsigned long int request, ...) throw();
+int ioctl(int fd, int request, ...);
}

extern int (*c_open)(const char *pathname, int flags, ...);
diff -Nurw compute-runtime-20.08.15750/core/os_interface/linux/sys_calls_linux.cpp src/compute-runtime-20.08.15750/core/os_interface/linux/sys_calls_linux.cpp
--- compute-runtime-20.08.15750/core/os_interface/linux/sys_calls_linux.cpp 2020-03-04 19:47:02.252480862 +0000
+++ src/compute-runtime-20.08.15750/core/os_interface/linux/sys_calls_linux.cpp 2020-03-04 19:47:20.399148357 +0000
@@ -20,7 +20,7 @@
return ::open(file, flags);
}
int ioctl(int fileDescriptor, unsigned long int request, void *arg) {
- return ::ioctl(fileDescriptor, request, arg);
+ return ::ioctl(fileDescriptor, (int) request, arg);
}
} // namespace SysCalls
} // namespace NEO
19 changes: 0 additions & 19 deletions ugly/compute-runtime/missing-null.patch

This file was deleted.

14 changes: 0 additions & 14 deletions ugly/compute-runtime/musl-compat.patch

This file was deleted.

12 changes: 12 additions & 0 deletions ugly/compute-runtime/musl-dl-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Nurw compute-runtime-20.08.15750/core/os_interface/linux/os_library_linux.cpp src/compute-runtime-20.08.15750/core/os_interface/linux/os_library_linux.cpp
--- compute-runtime-20.08.15750/core/os_interface/linux/os_library_linux.cpp 2020-03-04 16:06:31.458542632 +0000
+++ src/compute-runtime-20.08.15750/core/os_interface/linux/os_library_linux.cpp 2020-03-04 16:07:02.031877363 +0000
@@ -30,7 +30,7 @@
this->handle = dlopen(0, RTLD_LAZY);
} else {
#ifdef SANITIZER_BUILD
- constexpr auto dlopenFlag = RTLD_LAZY;
+ constexpr auto dlopenFlag = RTLD_LAZY | RTLD_GLOBAL;
#else
constexpr auto dlopenFlag = RTLD_LAZY | RTLD_DEEPBIND;
#endif
21 changes: 21 additions & 0 deletions ugly/compute-runtime/pthread_yield.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -Nurw compute-runtime-20.08.15750/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp src/compute-runtime-20.08.15750/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp
--- compute-runtime-20.08.15750/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp 2020-03-04 19:49:52.062488625 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/os_interface/linux/drm_gem_close_worker_tests.cpp 2020-03-04 19:50:21.399156633 +0000
@@ -120,7 +120,7 @@

//wait for worker to complete or deadCnt drops
while (!worker->isEmpty() && (deadCnt-- > 0))
- pthread_yield(); //yield to another threads
+ sched_yield(); //yield to another threads

worker->close(false);

@@ -141,7 +141,7 @@

//wait for worker to complete or deadCnt drops
while (!worker->isEmpty() && (deadCnt-- > 0))
- pthread_yield(); //yield to another threads
+ sched_yield(); //yield to another threads

//and check if GEM was closed
EXPECT_EQ(1, this->drmMock->gem_close_cnt.load());
45 changes: 45 additions & 0 deletions ugly/compute-runtime/redeffed_select.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff -Nurw compute-runtime-20.08.15750/unit_tests/built_ins/built_in_kernels_tests.cpp src/compute-runtime-20.08.15750/unit_tests/built_ins/built_in_kernels_tests.cpp
--- compute-runtime-20.08.15750/unit_tests/built_ins/built_in_kernels_tests.cpp 2020-03-04 19:51:20.502492668 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/built_ins/built_in_kernels_tests.cpp 2020-03-04 19:51:41.509160296 +0000
@@ -6,7 +6,7 @@
*/

#include "runtime/builtin_kernels_simulation/opencl_c.h"
-
+#undef select
#include "gtest/gtest.h"

namespace BuiltinKernelsSimulation {
diff -Nurw compute-runtime-20.08.15750/unit_tests/command_queue/get_size_required_buffer_tests.cpp src/compute-runtime-20.08.15750/unit_tests/command_queue/get_size_required_buffer_tests.cpp
--- compute-runtime-20.08.15750/unit_tests/command_queue/get_size_required_buffer_tests.cpp 2020-03-04 19:51:20.505826001 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/command_queue/get_size_required_buffer_tests.cpp 2020-03-04 19:52:01.999161233 +0000
@@ -14,6 +14,7 @@
#include "runtime/event/event.h"
#include "runtime/helpers/hardware_commands_helper.h"
#include "runtime/kernel/kernel.h"
+#undef select
#include "test.h"
#include "unit_tests/command_queue/command_enqueue_fixture.h"
#include "unit_tests/command_queue/enqueue_fixture.h"
diff -Nurw compute-runtime-20.08.15750/unit_tests/execution_model/enqueue_execution_model_kernel_tests.cpp src/compute-runtime-20.08.15750/unit_tests/execution_model/enqueue_execution_model_kernel_tests.cpp
--- compute-runtime-20.08.15750/unit_tests/execution_model/enqueue_execution_model_kernel_tests.cpp 2020-03-04 19:51:20.509159335 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/execution_model/enqueue_execution_model_kernel_tests.cpp 2020-03-04 19:52:41.835829721 +0000
@@ -16,6 +16,7 @@
#include "runtime/event/user_event.h"
#include "runtime/helpers/per_thread_data.h"
#include "runtime/kernel/kernel.h"
+#undef select
#include "unit_tests/fixtures/device_host_queue_fixture.h"
#include "unit_tests/fixtures/execution_model_fixture.h"
#include "unit_tests/helpers/gtest_helpers.h"
diff -Nurw compute-runtime-20.08.15750/unit_tests/profiling/profiling_tests.cpp src/compute-runtime-20.08.15750/unit_tests/profiling/profiling_tests.cpp
--- compute-runtime-20.08.15750/unit_tests/profiling/profiling_tests.cpp 2020-03-04 19:51:20.529159336 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/profiling/profiling_tests.cpp 2020-03-04 19:52:59.095830510 +0000
@@ -15,6 +15,7 @@
#include "runtime/command_queue/enqueue_marker.h"
#include "runtime/command_queue/enqueue_migrate_mem_objects.h"
#include "runtime/helpers/dispatch_info.h"
+#undef select
#include "test.h"
#include "unit_tests/command_queue/command_enqueue_fixture.h"
#include "unit_tests/event/event_fixture.h"
22 changes: 0 additions & 22 deletions ugly/compute-runtime/select-name-collision.patch

This file was deleted.

38 changes: 37 additions & 1 deletion ugly/compute-runtime/unwind.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,43 @@ diff -Nurw compute-runtime-20.08.15750/offline_compiler/CMakeLists.txt src/compu

if(UNIX)
- target_link_libraries(ocloc dl pthread)
+ target_link_libraries(ocloc dl unwind execinfo igc)
+ target_link_libraries(ocloc dl unwind execinfo)
endif()

set_target_properties(ocloc PROPERTIES FOLDER "offline_compiler")
diff -Nurw compute-runtime-20.08.15750/unit_tests/offline_compiler/CMakeLists.txt src/compute-runtime-20.08.15750/unit_tests/offline_compiler/CMakeLists.txt
--- compute-runtime-20.08.15750/unit_tests/offline_compiler/CMakeLists.txt 2020-03-04 15:10:51.625056608 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/offline_compiler/CMakeLists.txt 2020-03-04 15:11:01.208390380 +0000
@@ -92,7 +92,7 @@
endif()

if(UNIX)
- target_link_libraries(ocloc_tests dl pthread)
+ target_link_libraries(ocloc_tests dl unwind execinfo)
endif()

get_property(CLOC_FOLDER TARGET ocloc PROPERTY FOLDER)
diff -Nurw compute-runtime-20.08.15750/unit_tests/offline_compiler/segfault_test/CMakeLists.txt src/compute-runtime-20.08.15750/unit_tests/offline_compiler/segfault_test/CMakeLists.txt
--- compute-runtime-20.08.15750/unit_tests/offline_compiler/segfault_test/CMakeLists.txt 2020-03-04 15:31:58.505114528 +0000
+++ src/compute-runtime-20.08.15750/unit_tests/offline_compiler/segfault_test/CMakeLists.txt 2020-03-04 15:32:44.751783310 +0000
@@ -38,7 +38,7 @@
target_link_libraries(ocloc_segfault_test dbghelp)
endif()
if(UNIX)
- target_link_libraries(ocloc_segfault_test dl pthread)
+ target_link_libraries(ocloc_segfault_test dl unwind execinfo)
endif()

set(CLOC_SEGFAULT_TEST_INCLUDES
diff -Nurw compute-runtime-20.08.15750/runtime/CMakeLists.txt src/compute-runtime-20.08.15750/runtime/CMakeLists.txt
--- compute-runtime-20.08.15750/runtime/CMakeLists.txt 2020-03-04 19:44:42.239141127 +0000
+++ src/compute-runtime-20.08.15750/runtime/CMakeLists.txt 2020-03-04 19:45:16.525809362 +0000
@@ -84,7 +84,7 @@
)
target_compile_definitions(${NEO_STATIC_LIB_NAME} PRIVATE OGL=1)
else()
- set(IGDRCL_EXTRA_LIBS dl pthread)
+ set(IGDRCL_EXTRA_LIBS dl unwind execinfo)
target_include_directories(${NEO_STATIC_LIB_NAME} PUBLIC
${NEO_SOURCE_DIR}/core/os_interface/linux
${NEO_SOURCE_DIR}/runtime/os_interface/linux

0 comments on commit ee97443

Please sign in to comment.