Added base for building kompute

This commit is contained in:
Alejandro Saucedo 2020-10-03 11:59:52 +01:00
parent 20bc15a294
commit 32caa1aa60
4 changed files with 24 additions and 10 deletions

View file

@ -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'
}
}
}

View file

@ -1,5 +1,20 @@
#include <vulkan/vulkan.h>
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
#include <android/log.h>
#include <android_native_app_glue.h>
#endif
//#define VK_NO_PROTOTYPES 1
//#undef VK_NO_PROTOTYPES
#undef DEBUG
#ifndef RELEASE
#define RELEASE 1
#endif
//#define USE_DEBUG_EXTENTIONS
#include <kompute_vulkan_wrapper.hpp>
#undef VK_NO_PROTOTYPES
#include <vulkan/vulkan.hpp>
// 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
*/

View file

@ -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
$<INSTALL_INTERFACE:include>

View file

@ -12,9 +12,9 @@
#define RELEASE 1
#endif
//#define USE_DEBUG_EXTENTIONS
//#include <kompute_vulkan_wrapper.hpp>
#include <kompute_vulkan_wrapper.hpp>
//#undef VK_NO_PROTOTYPES
#undef VK_NO_PROTOTYPES
#include <vulkan/vulkan.hpp>
// SPDLOG_ACTIVE_LEVEL must be defined before spdlog.h import