Skip to content
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

RNGBase: Separate noise generation and application steps #2934

Merged
merged 5 commits into from
May 10, 2021

Conversation

jantonguirao
Copy link
Contributor

Signed-off-by: Joaquin Anton janton@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • Refactoring RNGBase to separate noise generation from noise application, so that later we can rework to allow the same noise to be applied to all channels (monochrome noise).

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    Created Impl for all RNGBase based classes, with Generate(...) and Apply(...) methods (Apply only applicable for noise generators)
    Dropped float16 support for the sake of better maintainability
  • Affected modules and functionalities:
    RNG and Noise generators
  • Key points relevant for the review:
    All
  • Validation and testing:
    Existing tests apply
  • Documentation (including examples):
    NA

JIRA TASK: [DALI-2010]

@jantonguirao jantonguirao force-pushed the rng_base_rework branch 2 times, most recently from f462569 to 771f972 Compare May 7, 2021 10:48
Signed-off-by: Joaquin Anton <janton@nvidia.com>

namespace dali {

template <typename Backend, typename T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need a T here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove

Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Joaquin Anton <janton@nvidia.com>
Comment on lines 56 to 57
template <typename T, typename Dist, bool IsNoiseGen, bool DefaultDist>
__global__ void RNGKernel(BlockDesc<IsNoiseGen>* __restrict__ block_descs,
Copy link
Contributor

@mzient mzient May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
template <typename T, typename Dist, bool IsNoiseGen, bool DefaultDist>
__global__ void RNGKernel(BlockDesc<IsNoiseGen>* __restrict__ block_descs,
template <typename T, typename Dist, bool DefaultDist, bool IsNoiseGen,>
__global__ void RNGKernel(BlockDesc<IsNoiseGen>* __restrict__ block_descs,

Nitpick: This way you won't have to pass IsNoiseGen explicitly - it will be inferred from block_descs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2353184]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2353184]: BUILD PASSED

@jantonguirao jantonguirao merged commit 934949d into NVIDIA:master May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants