Skip to content

A small header-only C++ 11 Object Oriented CUDA wrapper, with a Fluent API

License

Notifications You must be signed in to change notification settings

michaelsutton/oo-cuda-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run CUDA kernels with a few lines of code

This is just a minor kikoff for a possible complete CUDA wrapper. Further ideas and contributions would be welcomed.

Usage example

__global__ void AddKernel(const int *a, const int *b, int *c) { ... }
    
int size = ...
int *a = ... , *b = ..., *c = ... // Allocated host buffers 

cuda::CudaContext()
    .RegisterKernel(AddKernel, dim3(1), dim3(size), cuda::Input(a, size), cuda::Input(b, size), cuda::Output(c, size))
    .InvalidateInputs()
    .Launch()
    .GatherOutputs()
    .Sync();

Requirements

C++ 11. CUDA 7.0 or higher.

About

A small header-only C++ 11 Object Oriented CUDA wrapper, with a Fluent API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published