Skip to content

[BUG]: cub/agent/agent_find.cuh, line 106: error: no default constructor exists #7336

@zkhatami

Description

@zkhatami

Is this a duplicate?

Type of Bug

Compile-time Error

Component

CUB

Describe the bug

This test has started failing after this commit: c156e90

#include <execution>
#include <algorithm>
#include <vector>

template <typename T>
struct LocalWrapper
{
    explicit LocalWrapper(std::size_t k) : my_val(k) {}

  private:
    T my_val;
};

int32_t
main()
{
    typedef LocalWrapper<double> T;
    auto pred = [](const T& x) { return true; };
    const std::size_t max_n = 1000000;
    std::vector<T> in;
    in.reserve(max_n);
    const bool actual = std::is_partitioned(std::execution::par_unseq, in.begin(), in.begin() + 100, pred);
    return 0;
}

it fails with:

cub/agent/agent_find.cuh", line 106: error: no default constructor exists for class "LocalWrapper<TestUtils::float64_t>" (aka "LocalWrapper<double>")
      InputT input_items[items_per_thread];
             ^

How to Reproduce

nvc++ -stdpar --c++17   test_is_partitioned.cpp;

Expected behavior

Test should compile fine after the fix.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

Metadata

Metadata

Assignees

Labels

cubFor all items related to CUB

Type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions