Initial implementation of tensor working compiling

This commit is contained in:
Alejandro Saucedo 2021-03-06 17:25:35 +00:00
parent b81896a780
commit ad18c2e546
12 changed files with 417 additions and 210 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17.0)
cmake_minimum_required(VERSION 3.4.1)
project(kompute_array_mult VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 14)
@ -23,10 +23,6 @@ endif()
find_package(Vulkan REQUIRED)
if(KOMPUTE_OPT_ENABLE_SPDLOG)
find_package(spdlog REQUIRED)
endif()
add_executable(kompute_array_mult
src/Main.cpp)

View file

@ -15,8 +15,11 @@ This project has the option to either import the Kompute dependency relative to
To build you just need to run the cmake command in this folder as follows:
```
cmake \
-Bbuild
cmake -Bbuild/ \
-DCMAKE_BUILD_TYPE=Debug \
-DKOMPUTE_OPT_INSTALL=0 \
-DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1 \
-DKOMPUTE_OPT_ENABLE_SPDLOG=1
```
You can pass the following optional parameters based on your desired configuration:

View file

@ -7,16 +7,11 @@
int main()
{
#if KOMPUTE_ENABLE_SPDLOG
spdlog::set_level(
static_cast<spdlog::level::level_enum>(SPDLOG_ACTIVE_LEVEL));
#endif
kp::Manager mgr;
auto tensorInA = mgr.tensor({ 2.0, 4.0, 6.0 });
auto tensorInB = mgr.tensor({ 0.0, 1.0, 2.0 });
auto tensorOut = mgr.tensor({ 0.0, 0.0, 0.0 });
auto tensorInA = mgr.tensor<float>({ 2.0, 4.0, 6.0 });
auto tensorInB = mgr.tensor<float>({ 0.0, 1.0, 2.0 });
auto tensorOut = mgr.tensor<float>({ 0.0, 0.0, 0.0 });
std::string shader(R"(
// The version to use