clow 0.1.0

Lower-Level wrapper around Cudarc pointer types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

struct char_vec {
public:
    __device__ char_vec(const unsigned char * __restrict__ input) {
        *reinterpret_cast<int2*>(data) = *reinterpret_cast<const int2*>(input);
    }
    __device__ void store(unsigned char * output) const {
        *reinterpret_cast<int2*>(output) = *reinterpret_cast<const int2*>(data);
    }

public:
    static constexpr int size = 8;
    unsigned char data[size];
};

__device__ const int test_func(int x) {
    return max(x, 1);
}