Skip to content

Commit d26d491

Browse files
committed
Rename DeviceType -> MemoryLocation due to changes in Array2D
1 parent cc09b1b commit d26d491

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

genmetaballs/src/cuda/core/camera.cuh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ struct Intrinsics {
2020

2121
// Returns a 2D array of ray directions in camera frame in the specified pixel range
2222
// and store them in the provided buffer. By default, the full image is used
23-
template <DeviceType device>
24-
CUDA_CALLABLE Array2D<Vec3D, device>& get_ray_directions(Array2D<Vec3D, device> buffer,
25-
uint32_t px_start = 0,
26-
uint32_t px_end = UINT32_MAX,
27-
uint32_t py_start = 0,
28-
uint32_t py_end = UINT32_MAX) const {
23+
template <MemoryLocation location>
24+
CUDA_CALLABLE Array2D<Vec3D, location>& get_ray_directions(Array2D<Vec3D, location> buffer,
25+
uint32_t px_start = 0,
26+
uint32_t px_end = UINT32_MAX,
27+
uint32_t py_start = 0,
28+
uint32_t py_end = UINT32_MAX) const {
2929
for (auto i = max(0, px_start); i < min(height, px_end); ++i) {
3030
for (auto j = max(0, py_start); j < min(width, py_end); ++j) {
3131
buffer[i][j] = get_ray_direction(j, i);

tests/cpp_tests/test_camera.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace test_camera_gpu {
1414
// CUDA kernel to call get_ray_directions on device with multiple threads
1515
// Each thread processes one row of the image
1616
__global__ void get_ray_directions_kernel(Intrinsics intrinsics,
17-
Array2D<Vec3D, DeviceType::GPU> ray_buffer) {
17+
Array2D<Vec3D, MemoryLocation::DEVICE> ray_buffer) {
1818
uint32_t row_start = threadIdx.x * 2;
1919
uint32_t row_end = max(row_start + 2, intrinsics.height);
2020
uint32_t col_start = threadIdx.y * 2;
@@ -31,7 +31,8 @@ TEST(CameraTest, GetRayDirectionsDevice) {
3131

3232
// Create Array2D buffer on device
3333
thrust::device_vector<Vec3D> data(intrinsics.height * intrinsics.width);
34-
Array2D<Vec3D, DeviceType::GPU> ray_buffer(data.data(), intrinsics.height, intrinsics.width);
34+
Array2D<Vec3D, MemoryLocation::DEVICE> ray_buffer(data.data(), intrinsics.height,
35+
intrinsics.width);
3536

3637
// Launch kernel with multiple threads -- divide into 2x2 tiles
3738
test_camera_gpu::

0 commit comments

Comments
 (0)