KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.94k stars 146 forks source link

Kompute.hpp - how to generate and why? #288

Open COM8 opened 2 years ago

COM8 commented 2 years ago

I noticed Kompute.hpp contains just a copy of all other headers. Is there any reason for not doing something like this:

#pragma once

#include <Tensor.hpp>
#include <Sequence.hpp>
// ...

Since then the preprocessor will take over the task of expanding all #include macros for us. An example of that can be found here: https://github.com/libcpr/cpr/blob/master/include/cpr/cpr.h

Then we also get rid of all the logic for compiling either Kompute as a single header via KOMPUTE_OPT_BUILD_SINGLE_HEADER.