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

Allow building CUB tests without cuRand #250

Merged

Conversation

gevtushenko
Copy link
Collaborator

Description

closes #249

This PR allows building CUB tests without cuRand. The cuRand usage is disabled by default if there's no CTK found. To force this behavior, one can provide -DCUB_C2H_ENABLE_CURAND=NO CMake option.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@gevtushenko gevtushenko requested review from a team as code owners July 20, 2023 11:02
@gevtushenko gevtushenko requested review from alliepiper, ericniebler and elstehle and removed request for a team July 20, 2023 11:02
Comment on lines 19 to 26
find_package(CUDAToolkit)

set(curand_default OFF)
if (CUDAToolkit_FOUND)
set(curand_default ON)
endif()

option(CUB_C2H_ENABLE_CURAND "Use CUDA CURAND library" ${curand_default})
Copy link
Collaborator

@miscco miscco Jul 21, 2023

Choose a reason for hiding this comment

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

Could that just be

Suggested change
find_package(CUDAToolkit)
set(curand_default OFF)
if (CUDAToolkit_FOUND)
set(curand_default ON)
endif()
option(CUB_C2H_ENABLE_CURAND "Use CUDA CURAND library" ${curand_default})
find_package(CUDAToolkit)
option(CUB_C2H_ENABLE_CURAND "Use CUDA CURAND library" CUDAToolkit_FOUND)

cub/test/c2h/generators.cu Show resolved Hide resolved
float *generator_t::prepare_random_generator(seed_t seed,
std::size_t num_items)
{
m_distribution.resize(num_items);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be

Suggested change
m_distribution.resize(num_items);
this->m_distribution.resize(num_items);

cub/test/c2h/generators.cu Show resolved Hide resolved
@miscco miscco added cub For all items related to CUB infrastructure Shared CMake, github, etc infrastructure labels Jul 24, 2023
@jrhemstad jrhemstad changed the base branch from main to branch/2.2.x August 2, 2023 16:26
@wmaxey wmaxey requested a review from a team as a code owner August 2, 2023 22:21
@wmaxey wmaxey requested review from jarmak-nv and removed request for a team August 2, 2023 22:21
@wmaxey wmaxey merged commit 3558814 into NVIDIA:branch/2.2.x Aug 3, 2023
368 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cub For all items related to CUB infrastructure Shared CMake, github, etc infrastructure
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[FEA]: Allow building CUB tests without cuRand
4 participants