GpuView.hpp
Go to the documentation of this file.
61 //TODO: we probably dont need anything like this or is it useful to have views also be able to handle things on CPU?
369 // TODO: find a better way to handle exceptions in kernels, this will possibly be printed many times
383 // TODO: find a better way to handle exceptions in kernels, this will possibly be printed many times
396 // TODO: find a better way to handle exceptions in kernels, this will possibly be printed many times
397 assert(idx < m_numberOfElements && "The index provided was not in the range [0, buffersize-1]");
Iterator class to make GpuViews more similar to std containers. Definition: GpuView.hpp:218 std::ptrdiff_t difference_type Definition: GpuView.hpp:222 __host__ __device__ bool operator>(const iterator &other) const Greater than comparison. Definition: GpuView.hpp:313 __host__ __device__ iterator operator--(int) Post-decrement operator. Definition: GpuView.hpp:264 __host__ __device__ bool operator==(const iterator &other) const Inequality comparison operator. Definition: GpuView.hpp:278 std::forward_iterator_tag iterator_category Definition: GpuView.hpp:221 __host__ __device__ reference operator*() const Dereference operator. Definition: GpuView.hpp:234 __host__ __device__ difference_type operator-(const iterator &other) const subtraction operator Definition: GpuView.hpp:285 __host__ __device__ iterator & operator++() Pre-increment operator. Definition: GpuView.hpp:240 __host__ __device__ iterator operator+(difference_type n) const Addition operator with diffptr. Definition: GpuView.hpp:299 __host__ __device__ iterator operator-(difference_type n) const Subtraction of given number of elements from iterator. Definition: GpuView.hpp:292 __host__ __device__ iterator operator++(int) Post-increment operator. Definition: GpuView.hpp:248 __host__ __device__ iterator & operator--() Pre-decrement operator. Definition: GpuView.hpp:256 __host__ __device__ bool operator!=(const iterator &other) const Inequality comparison operator. Definition: GpuView.hpp:272 __host__ __device__ iterator(T *ptr) Create iterator from a pointer. Definition: GpuView.hpp:230 __host__ __device__ bool operator<(const iterator &other) const Less than comparison. Definition: GpuView.hpp:306 The GpuView class is provides a view of some data allocated on the GPU Essenstially is only stores a ... Definition: GpuView.hpp:53 __host__ __device__ GpuView(T *dataOnHost, size_t numberOfElements) GpuView allocates new GPU memory of size numberOfElements * sizeof(T) and copies numberOfElements fro... Definition: GpuView.hpp:100 __host__ __device__ iterator begin() Get an iterator pointing to the first element of the buffer. Definition: GpuView.hpp:326 GpuView()=default Default constructor that will initialize cublas and allocate 0 bytes of memory. __host__ __device__ size_t size() const size returns the size (number of T elements) in the vector Definition: GpuView.hpp:208 void copyFromHost(const T *dataPointer, size_t numberOfElements) copyFromHost copies numberOfElements from the CPU memory dataPointer __host__ __device__ iterator end() const Get a const iterator pointing to the address after the last element of the buffer. Definition: GpuView.hpp:350 __host__ __device__ T operator[](size_t idx) const operator[] to retrieve a copy of an item in the buffer Definition: GpuView.hpp:83 void copyFromHost(const std::vector< T > &data) copyToHost copies data from an std::vector void copyToHost(T *dataPointer, size_t numberOfElements) const copyFromHost copies numberOfElements to the CPU memory dataPointer GpuView(std::vector< T > &data) constructor based on std::vectors, this will make a view on the CPU void copyToHost(std::vector< T > &data) const copyToHost copies data to an std::vector __host__ __device__ iterator end() Get an iterator pointing to the address after the last element of the buffer. Definition: GpuView.hpp:342 __host__ __device__ T & operator[](size_t idx) operator[] to retrieve a reference to an item in the buffer Definition: GpuView.hpp:71 std::vector< T > asStdVector() const creates an std::vector of the same size and copies the GPU data to this std::vector __host__ __device__ iterator begin() const Get a const iterator pointing to the first element of the buffer. Definition: GpuView.hpp:334 Definition: autotuner.hpp:29 |