dsharlet / array

C++ multidimensional arrays in the spirit of the STL
Apache License 2.0
198 stars 15 forks source link

Add CUDA support #30

Closed dsharlet closed 4 years ago

dsharlet commented 4 years ago

@jiawen found that adding CUDA support just required adding __host__ __device__ to some of the functions in array.h.

I think we should do a few things here:

  1. Add __host__ __device__ to appropriate helper functions in array.h to enable shape and array_ref to be used in __device__ functions.
  2. Add an allocator that uses cudaMalloc/cudaFree to enable array to be used on the host.
  3. Maybe we need some wrappers around cudaMemcpy*, ideally transparently with copy.

(1) by itself would be really useful and a good first step.

dsharlet commented 4 years ago

Fixed by #35.