PeriDyno 1.0.0
Loading...
Searching...
No Matches
Scan.h
Go to the documentation of this file.
1#pragma once
2#include "Array/Array.h"
3
4namespace dyno
5{
6#define SCAN_LEVEL 2
7
8 template<typename T>
9 class Scan
10 {
11 public:
14
15 void exclusive(T* output, const T* input, size_t length, bool bcao = true);
16 void exclusive(T* data, size_t length, bool bcao = true);
17
18 void exclusive(DArray<T>& output, DArray<T>& input, bool bcao = true);
19 void exclusive(DArray<T>& data, bool bcao = true);
20
21 private:
22 void scanLargeDeviceArray(T*d_out, const T*d_in, size_t length, bool bcao, size_t level);
23 void scanSmallDeviceArray(T*d_out, const T*d_in, size_t length, bool bcao);
24 void scanLargeEvenDeviceArray(T*output, const T*input, size_t length, bool bcao, size_t level);
25
26 bool isPowerOfTwo(size_t x);
27 size_t nextPowerOfTwo(size_t x);
28
29
30 private:
32
35 };
36
37}
38
39
#define SCAN_LEVEL
Definition Scan.h:6
DArray< T > m_incr[SCAN_LEVEL]
Definition Scan.h:34
void exclusive(T *output, const T *input, size_t length, bool bcao=true)
DArray< T > m_sums[SCAN_LEVEL]
Definition Scan.h:33
void scanSmallDeviceArray(T *d_out, const T *d_in, size_t length, bool bcao)
DArray< T > m_buffer
Definition Scan.h:31
void exclusive(DArray< T > &output, DArray< T > &input, bool bcao=true)
void scanLargeDeviceArray(T *d_out, const T *d_in, size_t length, bool bcao, size_t level)
void exclusive(DArray< T > &data, bool bcao=true)
size_t nextPowerOfTwo(size_t x)
bool isPowerOfTwo(size_t x)
void exclusive(T *data, size_t length, bool bcao=true)
void scanLargeEvenDeviceArray(T *output, const T *input, size_t length, bool bcao, size_t level)
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89