yacx-YetAnotherCudaExecutor  0.6.2
wrapper to easily compile and execute cuda kernels
example_template.cpp
#include "yacx/main.hpp"
yacx::type_of;
int main() {
int result{};
try {
Source source{"template<typename T>\n"
"__global__ void f3(int *result) { *result = sizeof(T); }"};
std::vector<KernelArg> args;
args.push_back(KernelArg{&result, sizeof(int), true});
dim3 grid(1);
dim3 block(1);
source.program("f3")
.instantiate("int")
.compile()
.configure(grid, block)
.launch(args);
} catch (const std::exception &e) {
std::cerr << e.what() << std::endl;
}
std::cout << "Expected: " << sizeof(int) << " Actual: " << result
<< std::endl;
return 0;
}
main.hpp
C++ bindings to easily compile and execute CUDA kernels.
yacx::Options
Options for compiling a Program.
Definition: Options.hpp:20
yacx::KernelArg
Definition: KernelArgs.hpp:81
yacx::Kernel
Class to help launch and configure a CUDA kernel.
Definition: Kernel.hpp:31
yacx::Source
Class to wrap kernel strings.
Definition: Source.hpp:19