Skip to content

Commit

Permalink
Fix conflicting device_projection declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Nov 26, 2024
1 parent b589ae8 commit ee1dae0
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 10 deletions.
16 changes: 10 additions & 6 deletions cpp/cuproj/include/cuproj/projection.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ namespace cuproj {
* @file
*/

/**
* @brief A projection object that can be invoked from `__device__` code to transform coordinates.
*
* @tparam Coordinate the coordinate type. This type is expected to have a `value_type` member type.
*/
template <typename Coordinate>
using device_projection = detail::pipeline<Coordinate>;
using device_projection = typename detail::pipeline<Coordinate>;

/**
* @brief A projection transforms coordinates between coordinate reference systems
Expand All @@ -48,12 +53,10 @@ using device_projection = detail::pipeline<Coordinate>;
* The operations are applied in order, either forward or inverse.
*
* @tparam Coordinate the coordinate type
* @tparam T the coordinate value type
* @tparam T the coordinate value type. Specify this if `Coordinate` does not have a `value_type`
*/
template <typename Coordinate, typename T = typename Coordinate::value_type>
class projection {
using device_projection = device_projection<Coordinate>;

public:
/**
* @brief Construct a new projection object
Expand All @@ -80,10 +83,11 @@ class projection {
* @param dir the direction of the transform, FORWARD or INVERSE.
* @return the device projection
*/
device_projection get_device_projection(direction dir) const
device_projection<Coordinate> get_device_projection(direction dir) const
{
dir = (constructed_direction_ == direction::FORWARD) ? dir : reverse(dir);
return device_projection{params_, operations_.data().get(), operations_.size(), dir};
return device_projection<Coordinate>{
params_, operations_.data().get(), operations_.size(), dir};
}

/**
Expand Down
5 changes: 1 addition & 4 deletions cpp/cuproj/tests/wgs_to_utm_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ TYPED_TEST_CASE(ProjectionTest, TestTypes);
template <typename T>
using coordinate = typename cuspatial::vec_2d<T>;

template <typename T>
using device_projection = cuproj::device_projection<coordinate<T>>;

enum class transform_call_type { HOST, DEVICE };

template <typename Coordinate, typename T = typename Coordinate::value_type>
__global__ void transform_kernel(device_projection<T> const d_proj,
__global__ void transform_kernel(cuproj::device_projection<Coordinate> const d_proj,
Coordinate const* in,
Coordinate* out,
size_t n)
Expand Down
Loading

0 comments on commit ee1dae0

Please sign in to comment.