-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resampling ND - ground work #1366
Conversation
!build |
CI MESSAGE: [940918]: BUILD STARTED |
* @remarks The function clamps input coordinates to fit in range defined by `in` dimensions. | ||
* Scales can be negative to achieve flipping. | ||
*/ | ||
template <typename Out, typename In, int n> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: rename n
to spatial_ndim
for consistency
const OutTensorCPU<SampleBlockInfo, 1> &sample_lookup) { | ||
assert(sample_lookup.shape[0] >= total_blocks.pass[0] + total_blocks.pass[1]); | ||
int blocks_in_all_passes = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: surround this by #if DALI_DEBUG
CI MESSAGE: [940918]: BUILD PASSED |
@@ -92,7 +87,7 @@ __global__ void BatchedSeparableResampleKernel( | |||
} | |||
break; | |||
case ResamplingFilterType::Linear: | |||
if (axis == 1) { | |||
if (axis == spatial_ndim - 1) { | |||
LinearHorz(x0, x1, y0, y1, origin, scale, sample_out, out_stride, sample_in, in_stride, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this Horz/Vert naming is a bit misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: you could have some constants to make this more readable:
(e.g kHorizontalAxis = 0
and kHorizontalDim = spatial_ndim - 1
)
d9a40d6
to
7d3e448
Compare
!build |
CI MESSAGE: [943957]: BUILD STARTED |
CI MESSAGE: [943957]: BUILD PASSED |
@@ -81,6 +81,8 @@ struct ResamplingParams { | |||
}; | |||
|
|||
using ResamplingParams2D = std::array<ResamplingParams, 2>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using ResamplingParams2D = std::array<ResamplingParams, 2>; | |
using ResamplingParams2D = ResamplingParamsND<2>; |
?
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Switch coordinate order in resampling from DHW (matrix rank) to XYZ (geometric). Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Change some separate scalar x,y to vectors in resampling kernel. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
7d3e448
to
e3220df
Compare
!build |
CI MESSAGE: [982102]: BUILD STARTED |
Unlock int16, uint16 and int32 resize. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
!build |
CI MESSAGE: [982113]: BUILD STARTED |
DeviceArray<uintptr_t, num_buffers> pointers; | ||
DeviceArray<ptrdiff_t, num_buffers> offsets; | ||
DeviceArray<Strides, num_buffers> strides; | ||
DeviceArray<Shape, num_buffers> shapes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can align the the shape with the rest of variables.
CI MESSAGE: [982113]: BUILD PASSED |
Signed-off-by: Michal Zientkiewicz michalz@nvidia.com
Why we need this PR?
Pick one
What happened in this PR?
dim
is a tensor-like dimensions (0 is outermost),axis
is vector-like (0 is X).JIRA TASK: [DALI-1075]