From 32caa1aa60bc37a1a8cc7df8545aefc01bdaeae7 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sat, 3 Oct 2020 11:59:52 +0100 Subject: [PATCH] Added base for building kompute --- .../android/android-simple/app/build.gradle | 2 +- single_include/kompute/Kompute.hpp | 18 ++++++++++++++++-- src/CMakeLists.txt | 10 +++++----- src/include/kompute/Core.hpp | 4 ++-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/examples/android/android-simple/app/build.gradle b/examples/android/android-simple/app/build.gradle index 1f3249a37..34bde80dc 100644 --- a/examples/android/android-simple/app/build.gradle +++ b/examples/android/android-simple/app/build.gradle @@ -17,7 +17,7 @@ android { externalNativeBuild { cmake { abiFilters "armeabi-v7a", 'arm64-v8a', 'x86', 'x86_64' - arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static', '-DKOMPUTE_OPT_ANDOID_BUILD=1', '-DKOMPUTE_OPT_INSTALL=0' + arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static', '-DKOMPUTE_OPT_ANDOID_BUILD=1', '-DKOMPUTE_OPT_INSTALL=0', '-DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1' } } } diff --git a/single_include/kompute/Kompute.hpp b/single_include/kompute/Kompute.hpp index a3afd44bf..5452c7927 100755 --- a/single_include/kompute/Kompute.hpp +++ b/single_include/kompute/Kompute.hpp @@ -1,5 +1,20 @@ -#include + +#if defined(VK_USE_PLATFORM_ANDROID_KHR) +#include +#include +#endif + +//#define VK_NO_PROTOTYPES 1 +//#undef VK_NO_PROTOTYPES +#undef DEBUG +#ifndef RELEASE +#define RELEASE 1 +#endif +//#define USE_DEBUG_EXTENTIONS +#include + +#undef VK_NO_PROTOTYPES #include // SPDLOG_ACTIVE_LEVEL must be defined before spdlog.h import @@ -820,7 +835,6 @@ class Manager * sequences. * * @param tensors The tensors to be used in the operation recorded - * @param sequenceName The name of the sequence to be retrieved or created * @param TArgs Template parameters that will be used to initialise * Operation to allow for extensible configurations on initialisation */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 570f7b40d..ac5118263 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,15 +48,15 @@ if(KOMPUTE_OPT_ANDOID_BUILD) # ${VK_ANDROID_COMMON_DIR}/vulkan_wrapper.cpp) endif() -if(KOMPUTE_OPT_BUILD_SINGLE_HEADER) +if(KOMPUTE_OPT_ANDOID_BUILD) + add_library(kompute + ${kompute_CPP} + ${PROJECT_SOURCE_DIR}/vulkan_ndk_patch_include/kompute_vulkan_wrapper.cpp) +else() add_library(kompute ${kompute_CPP}) endif() -add_library(kompute - ${kompute_CPP} - ${PROJECT_SOURCE_DIR}/vulkan_ndk_patch_include/kompute_vulkan_wrapper.cpp) - target_include_directories( kompute PUBLIC $ diff --git a/src/include/kompute/Core.hpp b/src/include/kompute/Core.hpp index 078e284c7..8b4d9f120 100644 --- a/src/include/kompute/Core.hpp +++ b/src/include/kompute/Core.hpp @@ -12,9 +12,9 @@ #define RELEASE 1 #endif //#define USE_DEBUG_EXTENTIONS -//#include +#include -//#undef VK_NO_PROTOTYPES +#undef VK_NO_PROTOTYPES #include // SPDLOG_ACTIVE_LEVEL must be defined before spdlog.h import