-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrays.h
46 lines (35 loc) · 781 Bytes
/
rays.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright (C) 2015-2018, Nils Moehrle
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#ifndef CACC_RAYS_HEADER
#define CACC_RAYS_HEADER
#include "defines.h"
#include "primitives.h"
#include "vector.h"
CACC_NAMESPACE_BEGIN
class Rays {
public:
struct Data {
uint num_rays;
Ray * rays_ptr;
};
private:
Data data;
public:
Rays(uint num_rays) {
data.num_rays = num_rays;
CHECK(cudaMalloc(&data.rays_ptr, num_rays * sizeof(Ray)));
}
~Rays() {
CHECK(cudaFree(data.rays_ptr));
}
Data const & cdata() {
return data;
}
};
CACC_NAMESPACE_END
#endif /* CACC_RAYS_HEADER */